Skip to content

Implement clipping masks, stroke align, and stroke paint order#2644

Merged
Keavon merged 47 commits intomasterfrom
clipping
Jun 18, 2025
Merged

Implement clipping masks, stroke align, and stroke paint order#2644
Keavon merged 47 commits intomasterfrom
clipping

Conversation

@mTvare6
Copy link
Copy Markdown
Collaborator

@mTvare6 mTvare6 commented May 13, 2025

Closes #1920, closes #2268

@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) May 13, 2025 08:45 Inactive
@mTvare6 mTvare6 marked this pull request as draft May 13, 2025 10:54
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) May 13, 2025 12:41 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) May 16, 2025 00:20 Inactive
@Keavon Keavon changed the title Implement clipping. Implement clipping masks May 16, 2025
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) May 16, 2025 21:52 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) May 16, 2025 22:47 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) May 16, 2025 23:09 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) May 16, 2025 23:54 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) May 19, 2025 14:34 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) May 20, 2025 08:06 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) May 20, 2025 23:35 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) May 21, 2025 11:28 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) May 22, 2025 20:59 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) May 23, 2025 21:06 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) June 9, 2025 06:48 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) June 9, 2025 06:57 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) June 9, 2025 07:26 Inactive
@Keavon Keavon marked this pull request as draft June 9, 2025 07:45
@Keavon
Copy link
Copy Markdown
Member

Keavon commented Jun 9, 2025

A few things about stroke align:

  1. If I just open a new canvas and draw an ellipse, increase its stroke weight so t's more easy to see, and change the stroke align, we end up with it not seeming to work.
  2. And when it's set to Outside, in addition to it not working, it also crops off the edges in a rectangle https://files.keavon.com/-/UnsightlyNovelCub/capture.png
  3. If I instead go to Valley of Spires, it seems to work, although Outside mode makes it no longer have a fill https://files.keavon.com/-/OptimisticScrawnyAnura/capture_11_.mp4

@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) June 10, 2025 00:55 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) June 11, 2025 07:10 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) June 12, 2025 04:49 Inactive
@mTvare6 mTvare6 marked this pull request as ready for review June 12, 2025 04:57
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) June 12, 2025 05:02 Inactive
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) June 13, 2025 01:15 Inactive
@Keavon Keavon changed the title Implement clipping masks Implement clipping masks, stroke alignment, and stroke paint order Jun 15, 2025
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) June 17, 2025 02:56 Inactive
@Keavon Keavon changed the title Implement clipping masks, stroke alignment, and stroke paint order Implement clipping masks, stroke align, and stroke paint order Jun 18, 2025
@github-actions github-actions bot requested a deployment to graphite-dev (Preview) June 18, 2025 05:03 Abandoned
@Keavon Keavon enabled auto-merge (squash) June 18, 2025 05:08
@github-actions github-actions bot temporarily deployed to graphite-dev (Preview) June 18, 2025 05:16 Inactive
@Keavon Keavon merged commit eb72792 into master Jun 18, 2025
5 of 6 checks passed
@Keavon Keavon deleted the clipping branch June 18, 2025 05:36
Keavon added a commit that referenced this pull request Jun 20, 2025
* refactor: opacity + blend_mode -> blend_style

* Add code for clipping

* Add alt-click masking

* Clip to all colors. Fill option

* Fix undo not working. Fix strokes not being white

* Allow clipped to be grouped or raster

* Switch to alpha mode in mask-type

* add plumbing to know if clipped in frontend and add fill slider

* Attempt at document upgrade code

* Fix fill slider

* Add clipped styling and Alt-click layer border

* Use mask attr judiciously by using clip when possible

* Fix breaking documents and upgrade code

* Fix fixes

* No-op toggle if last child of parent and don't show clip UI if last element

* Fix mouse styles by plumbing clippable to frontend

* Fix Clip detection by disallowed groups as clipPath according to SVG spec doesn't allow <g>

* Add opacity to clippers can_use_clip check

* Fix issue with clipping not working nicely with strokes by using masks

* Add vello code

* cleanup

* Add stroke alignment hacks to SVG renderer

* svg: Fix mask bounds in vector data

* vello: Implement mask hacks to support stroke alignment

* Move around alignment and doc upgrade code

* rename Line X -> X

* An attempt at fixing names not updating

* svg: add stroke order with svg

* vello: add stroke order with by calling one before the other explicitly

* fix merge

* fix svg renderer messing up transform det

* Code review; reorder and rename parameters (TODO: fix tools)

* Fixes to previous

* Formatting

* fix bug 3

* some moving around (not fixed)

* fix issue 1

* fix vello

* Final code review

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
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.

Stroke alignment Clipping masks

2 participants