mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-14 19:26:56 -04:00
Merge pull request #64 from storytold/pr/scale-strokes-off-by-default
M3: Scale Strokes & Effects is off by default
This commit is contained in:
3 files changed
+7
-4
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user