fix(editor): a spotlight resizes by its handles - #52
Merged
Conversation
Collaborator
The handles sit on a layer's bounds, but a spotlight is hit-tested against its opening, so for the default elliptical shape the corner handle lies outside the shape, a press there read as empty canvas, and dragging it started a marquee instead of resizing. The press now asks which handle is under the pointer before it asks which layer is, which also leaves one copy of the tolerance test instead of two.
tobi
force-pushed
the
fix/spotlight-handles
branch
from
August 21, 2026 23:08
61c6476 to
f654381
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.
Drag a spotlight's corner handle and you get a marquee selection instead of a resize.
The handles are drawn on the layer's bounding box, but a spotlight is hit-tested against its opening, so for the default ellipse the corner lands outside the shape, out in the dimmed surround. The press finds no layer, reads as empty canvas, and starts a marquee.
So the press asks which handle is under the pointer before it asks which layer is. That's the cheaper question anyway, since the handle belongs to a layer that's already selected, and it's the only order that works for any layer whose handles can sit outside itself. It also let me collapse two copies of the handle-tolerance test into one.
Draw a spotlight, leave it selected, drag a corner: on
mainthe canvas dims into a marquee, here it resizes.runSpotlightHandleSmoke(exit 96) is deliberately narrow: make handles stop answering for spotlights only and every other handle test still passes.