Repository navigation
Brushes: Scale Proportionately art grows with the stroke weight - #7421
Merged
bflatastic merged 4 commits intoNov 14, 2026
Merged
Conversation
An Art brush set to Scale Proportionately drew its art at the same size on every stroke weight: the art was scaled across only by how much the path stretched it along and by the brush's Width. Stretch to Fit Stroke Length and Stretch Between Guides already multiply by the stroke weight. Proportional art now does too, so a 3 pt stroke draws it three times as wide as a 1 pt stroke, still as long as the path. The same applies to each run with Overlap on and to a Width that follows the pen. Existing Scale Proportionately art brush strokes at weights other than 1 pt draw scaled by the stroke weight. Strokes at 1 pt draw as before.
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 16 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
3 of 4 tasks
3 of 4 tasks
Member
|
Merged, thanks @dotCooCoo! It passed its CI checks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
An Art brush set to Scale Proportionately drew its art at the same size on every stroke weight. Stretch to Fit Stroke Length and Stretch Between Guides already scale the art across by the stroke weight and the Width. Scale Proportionately now does too, on top of the scale the path length gives it, so a 3 pt stroke draws the art three times as wide as a 1 pt stroke, still as long as the path. The same holds for each run with Overlap on and for a Width that follows the pen.
art_on_runincrates/brush/src/warp.rsnow scales Proportional art by the run length over the art length times the samecross(stroke weight × Width / 100) that the other two modes use, and its unusedwidthparameter is removed.Existing Scale Proportionately art brush strokes at weights other than 1 pt draw scaled by the stroke weight. Strokes at 1 pt draw as before.
The Brushes page says Scale Proportionately keeps the art's proportions and does not say how the stroke weight applies; scaling by the weight as the other modes do is VectorCraft's own rule. Because the art grows with both the path length and the weight, a path scaled to 200% whose stroke weight doubles with it draws its art four times as wide.
#7383 makes
.aiimport and save keep an Art brush's scale, Scale Proportionately included; strokes it opens draw by this rule once both merge. The two branches merge without conflicts.How it was tested
New test
tests::art_brush_proportional_grows_with_weight(vectorcraft-brush): a 3 pt stroke draws 4 pt art 24 pt across on a path twice the art's length, a 50% Width halves that, a path twice as long at 2 pt draws it 4 times as wide, each Overlap run is scaled by its own length and the weight, and a Width on Pressure goes from 50% to 300% times a 2 pt weight. The test fails with the earlier expression put back (the first assertion reads 8 pt instead of 24 pt).art_brush_proportional_keeps_aspectis unchanged.Run on the branch head, based on
mainat446bf59bc2(it merges cleanly withmainat1e4e3534f5):cargo fmt --all -- --check: clean.cargo clippy -p vectorcraft-brush --all-targets -- -D warnings: clean.cargo test -p vectorcraft-brush: 85 passed.cargo test -p vectorcraft-engine --lib brush: 131 passed.cargo test -p vectorcraft-render brush: 32 passed.cargo test -p vectorcraft-eps art_brush: 9 passed.Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm).unwrap(),expect(),panic!,unreachable!,todo!orunimplemented!outside tests, and no unchecked indexing on data from files, parameters ormessages. Errors are returned as
Resultand shown to the user(why and how).
ASSETS.md.