diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 49c1e4bdd..6e2f76eb7 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -367,7 +367,7 @@ impl Default for Prefs { double_click_to_isolate: true, transform_pattern_tiles: false, scale_corners: false, - scale_strokes: true, + scale_strokes: false, zoom_with_mouse_wheel: false, paste_offset: 10.0, selection_tolerance: 3.0, diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 554bca3f2..99ecd5f80 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -91,7 +91,10 @@ fn rotate_and_scale() { s.execute("object.scale", &json!({"sx": 200})).unwrap(); let b = s.doc().unwrap().doc.node(a).unwrap().geometric_bounds().unwrap(); assert!((b.width() - 20.0).abs() < 1e-9); - // stroke scaled with the object + // Scale Strokes & Effects is off by default: the stroke keeps its weight + assert_eq!(s.doc().unwrap().doc.node(a).unwrap().appearance.stroke_width(), 1.0); + // and scales with the object when asked + s.execute("object.scale", &json!({"sx": 200, "strokes": true})).unwrap(); assert_eq!(s.doc().unwrap().doc.node(a).unwrap().appearance.stroke_width(), 2.0); } diff --git a/docs/mcp.md b/docs/mcp.md index 4898dfbaf..7f48b721a 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -672,8 +672,8 @@ the preference `japaneseCropMarks` is on or `style: "japanese"` is given. ## Scale Strokes & Effects `object.scale`, `object.transform` and `object.transformEach` take `strokes?: bool` (Scale Strokes & Effects) and -`corners?: bool` (Scale Corners); without them the preferences `scaleStrokes` (default on) and `scaleCorners` (default -off) apply (`prefs.set {key, value}`). With strokes on, a scale by k (the square root of the transform's determinant) +`corners?: bool` (Scale Corners); without them the preferences `scaleStrokes` and `scaleCorners` (both off by +default) apply (`prefs.set {key, value}`). With strokes on, a scale by k (the square root of the transform's determinant) multiplies stroke weights, dash lengths and dash offsets, and every distance parameter of the object's, its fills' and its strokes' effects (drop shadow offsets and blur, offsets, radii…; `effect.list` gives each effect's `lengths`; relative Roughen, Tweak and Zig Zag sizes stay percentages), in groups and layers too. With it off, nothing painted