mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Photoshop ships with Auto-Select on and its target set to Group; PhotoCraft defaulted to Layer. ToolOptions::default and the serde default now return "group"; saved preferences keep their stored value. Co-authored-by: highperfocused <[email protected]>
This commit is contained in:
1 parent
049a92c288
commit
23abc4302b
2 files changed
+5
-4
No files matched your search
@@ -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");
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user