Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

fix(ui): default the Move tool Auto-Select target to Group (#4056) (#4093)

mroxso23abc4302bb3
diff --git a/crates/ui-egui/src/move_auto_select_tests.rs b/crates/ui-egui/src/move_auto_select_tests.rs
index 03ad1c21e..0f01222a5 100644
--- a/crates/ui-egui/src/move_auto_select_tests.rs
+++ b/crates/ui-egui/src/move_auto_select_tests.rs
@@ -51,10 +51,10 @@ fn drag(app: &mut PhotocraftApp, from: [f64; 2], by: [f64; 2], mods: egui::Modif
}
#[test]
-fn auto_select_is_on_by_default_with_the_layer_target() {
+fn auto_select_is_on_by_default_with_the_group_target() {
let o = ToolOptions::default();
assert!(o.move_auto_select, "Photoshop ships with Auto-Select checked");
- assert_eq!(o.move_target, "layer");
+ assert_eq!(o.move_target, "group", "Photoshop defaults Auto-Select to Group (#4056)");
// A saved tool preset that predates the option gets the default too.
let mut v = serde_json::to_value(&o).unwrap();
v.as_object_mut().unwrap().remove("move_auto_select");
diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs
index ee348d982..02b4f005d 100644
--- a/crates/ui-egui/src/state.rs
+++ b/crates/ui-egui/src/state.rs
@@ -594,7 +594,8 @@ pub struct ToolOptions {
#[serde(default = "one")]
pub marquee_height: f32,
/// Move tool: Auto-Select (with "layer" or "group" target) and Show Transform Controls.
- /// Auto-Select is on by default, as in current Photoshop; ⌘/Ctrl-click inverts it.
+ /// Auto-Select is on with the "group" target by default, as in current Photoshop;
+ /// ⌘/Ctrl-click inverts it.
#[serde(default = "yes")]
pub move_auto_select: bool,
#[serde(default = "default_move_target")]
@@ -706,7 +707,7 @@ fn default_crop_resolution_unit() -> String {
}
fn default_move_target() -> String {
- "layer".into()
+ "group".into()
}
fn default_curve_fit() -> f32 {