Skip to content

fix: marquee drags show marching ants, and the elliptical one an ellipse - #76

Merged
IAmJSD merged 1 commit into
mainfrom
t3code/use-zaggy-marquee-outline
Aug 29, 2026
Merged

fix: marquee drags show marching ants, and the elliptical one an ellipse#76
IAmJSD merged 1 commit into
mainfrom
t3code/use-zaggy-marquee-outline

Conversation

@IAmJSD

@IAmJSD IAmJSD commented Aug 29, 2026

Copy link
Copy Markdown
Member

Dragging a marquee drew a solid blue rectangle instead of the marching ants the rest of the app uses for selections — and the elliptical marquee drew that rectangle even though it commits an ellipse.

  • Overlay::AntsRect is documented as "dashed marching ants", but the canvas painted it through the same match arm as Overlay::Rect, i.e. a solid 0x44AAFF outline. It gets its own arm now, tracing the four corners through push_ants (closed, so the dashes carry round the last corner). Overlay::Rect keeps the solid outline, which is what layer bounds during a move, artboards and the transform box want.
  • The elliptical marquee emitted AntsRect of the rect it was dragged out of. It now emits an AntsPolygon of the inscribed ellipse — same centre and radii as Selection::select_ellipse, segment count scaled from the rect size and clamped to 24..256 — so the preview matches the outline that appears on mouse-up.

The same blue box was on the crop tool, the slice tool and the patch/retouch drag, which all emit AntsRect; they get ants now too.

Verified in the app (headless X, fixture PNG): the rectangular drag shows ants with no blue box, and the elliptical drag shows an ellipse that lands exactly on the committed selection outline.

🤖 Generated with Claude Code

`Overlay::AntsRect` promises dashed marching ants, but the canvas
painted it through the same arm as `Overlay::Rect` -- a solid blue
outline. Give it its own arm that traces the four corners through
`push_ants`, closing the loop so the dashes carry round the last
corner. `Overlay::Rect` keeps the solid outline, which is what layer
bounds and artboards want.

The elliptical marquee also reported its drag as the rect it was
dragged out of rather than the shape it commits, so it now emits a
polygon of the inscribed ellipse -- same centre and radii as
`Selection::select_ellipse`, so the preview and the committed outline
agree.

The blue box was on the crop, slice and patch drags too; they get ants
now as well.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@IAmJSD
IAmJSD merged commit 83adf0a into main Aug 29, 2026
3 checks passed
@IAmJSD
IAmJSD deleted the t3code/use-zaggy-marquee-outline branch August 29, 2026 23:28
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.

1 participant