Add support for shape filling to whiskers - #188
Open
abey79 wants to merge 12 commits into
Open
Conversation
This was referenced Jan 4, 2026
abey79
force-pushed
the
pr4-metadata-refactor
branch
from
February 8, 2026 10:05
7268e0f to
c064346
Compare
abey79
force-pushed
the
pr5-whiskers-fill-support
branch
from
February 8, 2026 10:05
d3d02ef to
6dfc072
Compare
abey79
force-pushed
the
pr4-metadata-refactor
branch
from
February 15, 2026 10:00
c064346 to
953df45
Compare
abey79
force-pushed
the
pr5-whiskers-fill-support
branch
2 times, most recently
from
February 15, 2026 13:37
de11ee0 to
b7e27df
Compare
abey79
force-pushed
the
pr4-metadata-refactor
branch
from
February 21, 2026 13:08
953df45 to
69fbf67
Compare
abey79
force-pushed
the
pr5-whiskers-fill-support
branch
from
February 21, 2026 13:08
763c3c0 to
4838e7a
Compare
abey79
force-pushed
the
pr5-whiskers-fill-support
branch
2 times, most recently
from
February 21, 2026 13:48
ea243dc to
38d515f
Compare
abey79
force-pushed
the
pr4-metadata-refactor
branch
from
February 22, 2026 13:13
69fbf67 to
a0db2dd
Compare
abey79
force-pushed
the
pr5-whiskers-fill-support
branch
from
February 22, 2026 13:13
38d515f to
cad2568
Compare
abey79
force-pushed
the
pr4-metadata-refactor
branch
from
February 22, 2026 20:28
a0db2dd to
10d677b
Compare
abey79
force-pushed
the
pr5-whiskers-fill-support
branch
from
February 22, 2026 20:28
cad2568 to
22cacc2
Compare
abey79
force-pushed
the
pr4-metadata-refactor
branch
from
February 22, 2026 20:29
10d677b to
69f7d5c
Compare
abey79
force-pushed
the
pr5-whiskers-fill-support
branch
from
February 22, 2026 20:29
22cacc2 to
06a14cb
Compare
abey79
changed the base branch from
pr4-metadata-refactor
to
pr45-intobezpaths
February 22, 2026 20:44
abey79
force-pushed
the
pr45-intobezpaths
branch
from
February 22, 2026 21:03
31300b2 to
77f7fdb
Compare
abey79
force-pushed
the
pr5-whiskers-fill-support
branch
from
February 22, 2026 21:03
06a14cb to
5ef5e59
Compare
abey79
force-pushed
the
pr45-intobezpaths
branch
from
February 22, 2026 21:07
77f7fdb to
e77e60e
Compare
abey79
force-pushed
the
pr5-whiskers-fill-support
branch
from
February 22, 2026 21:07
5ef5e59 to
53da09d
Compare
abey79
force-pushed
the
pr45-intobezpaths
branch
from
February 22, 2026 21:31
e77e60e to
60b6bfd
Compare
abey79
force-pushed
the
pr5-whiskers-fill-support
branch
from
February 22, 2026 21:31
53da09d to
6c07a27
Compare
abey79
force-pushed
the
pr45-intobezpaths
branch
from
March 1, 2026 08:49
60b6bfd to
fbb909a
Compare
abey79
force-pushed
the
pr5-whiskers-fill-support
branch
from
March 1, 2026 08:49
6c07a27 to
f856c2c
Compare
abey79
force-pushed
the
pr45-intobezpaths
branch
from
March 1, 2026 09:15
fbb909a to
e473904
Compare
abey79
force-pushed
the
pr5-whiskers-fill-support
branch
from
March 1, 2026 09:15
f856c2c to
bb22373
Compare
- Removed target_layer field and set_layer() method
- Added stroke_layer: Option<LayerID> and fill_layer: Option<LayerID> fields
- Added style_stack: Vec<StyleState> for push/pop style
- Added LayerHandle struct with pen_width(), color(), name(), hatch_angle() methods
- Added routing methods: stroke_layer(), fill_layer(), stroke_only(), fill_only(), stroke_and_fill()
- Added style stack: push_style(), pop_style(), with_style()
- Updated add_path() to route to stroke/fill layers with hatching support
- Added 13 unit tests
abey79
force-pushed
the
pr45-intobezpaths
branch
from
March 1, 2026 09:36
e473904 to
2358c23
Compare
abey79
force-pushed
the
pr5-whiskers-fill-support
branch
from
March 1, 2026 09:36
bb22373 to
0dd86f2
Compare
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.
This PR builds on the previous ones to introduce hatch fill support. This required refactoring the layer state handling, so we can have separate stroke and fill routing, replacing the single
set_layer()method.It also fixes per-path color/stroke_width defaults: paths now inherit from their layer instead of defaulting to
BLACK/1.0, which caused layer colors to be overridden (e.g. crescent strokes appearing black instead of the layer's CMY color inquadri_circle).Removed API
set_layer(layer_id)stroke_layer(Some(layer_id))color(c)override_color(c)for per-path overrides, orlayer(id).color(c)for layer defaultsstroke_width(w)override_stroke_width(w)for per-path overrides, orlayer(id).pen_width(w)for layer defaultsNew API
layer(id) -> LayerHandlestroke_layer(Option<LayerID>)Nonedisables)fill_layer(Option<LayerID>)Nonedisables)stroke_only(layer)fill_only(layer)stroke_and_fill(layer)override_color(c)override_stroke_width(w)clear_overrides()push_style()/pop_style()with_style(closure)New traits:
IntoBezPaths/IntoBezPathsToleranceThe
Draw::add_pathsignature now acceptsIntoBezPathsTolerance(plural) instead ofIntoBezPathTolerance. This preserves structural boundaries when converting multi-geometry types (e.g.geo::MultiPolygonyields oneBezPathper polygon), which is critical for correct per-shape hatching. Single-geometry types get a blanket impl wrapping the result in a one-elementVec, so existing code is unaffected.New example
fill_demo— demonstrates stroke/fill layer routing with a grid of shapes (circle, square, L-shape, polygon with holes) across three fill modes (none, horizontal, angled).Default behavior change
Paths now default to
None/Nonemetadata (inheriting color and stroke width from their layer viaresolve()). Previously,Sketch::new()set explicitBLACK/1.0on every path, which silently overrode layer settings.Migration guide
Setting color/pen width for a layer (most common case):
Switching colors mid-drawing (per-path overrides):
Fill (hatching):
This is part 6 of 6 in a stack made with GitButler:
IntoBezPathstrait #191PathandFlattenedPath#186.buffer()toPathandFlattenedPath#184