Skip to content

Brushes: Scale Proportionately art grows with the stroke weight - #7421

Merged
bflatastic merged 4 commits into
storytold:mainfrom
dotCooCoo:fix/art-brush-proportional-weight
Nov 14, 2026
Merged

bflatastic merged 4 commits into
storytold:mainfrom
dotCooCoo:fix/art-brush-proportional-weight

Conversation

@dotCooCoo

Copy link
Copy Markdown
Contributor

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_run in crates/brush/src/warp.rs now scales Proportional art by the run length over the art length times the same cross (stroke weight × Width / 100) that the other two modes use, and its unused width parameter 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 .ai import 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_aspect is unchanged.

Run on the branch head, based on main at 446bf59bc2 (it merges cleanly with main at 1e4e3534f5):

  • 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 ci passes (fmt, clippy, tests, assets, brands, layers, wasm).
  • No panics in shipped code: no unwrap(), expect(), panic!, unreachable!, todo! or
    unimplemented! outside tests, and no unchecked indexing on data from files, parameters or
    messages. Errors are returned as Result and shown to the user
    (why and how).
  • Clean-room: nothing copied from Adobe products or GPL/AGPL code (AGENTS.md).
  • Every new asset has a row in ASSETS.md.

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.
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 124e3cc and deb3c43.

Files selected for processing: 4

  • crates/brush/src/lib.rs
  • crates/brush/src/tests.rs
  • crates/brush/src/warp.rs
  • docs/target-app-parity.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@bflatastic
bflatastic merged commit a967f28 into storytold:main Nov 14, 2026
7 checks passed
@bflatastic

Copy link
Copy Markdown
Member

Merged, thanks @dotCooCoo! It passed its CI checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants