selecting assets now has no margin#9
Conversation
PR SummaryMedium Risk Overview Open/unfilled shapes keep using the existing margin-based hit testing, so thin strokes remain easier to click. Written by Cursor Bugbot for commit a07286e. This will update automatically on new commits. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Threshold uses 1 instead of 0 for filled shapes
- Changed distance <= 1 back to distance <= 0 to match the 'no margin bleed' comment and ensure filled shapes are only hittable when the cursor is actually inside their bounds.
Or push these changes by commenting:
@cursor push 39c5e9b13a
Preview (39c5e9b13a)
diff --git a/packages/editor/src/lib/editor/Editor.ts b/packages/editor/src/lib/editor/Editor.ts
--- a/packages/editor/src/lib/editor/Editor.ts
+++ b/packages/editor/src/lib/editor/Editor.ts
@@ -5402,7 +5402,7 @@
// Are we close to the shape's edge?
if (distance <= outerMargin || (hitInside && distance <= 0 && distance > -innerMargin)) {
if (geometry.isFilled || (isGroup && geometry.children[0].isFilled)) {
- if (distance <= 1) {
+ if (distance <= 0) {
return inMarginClosestToEdgeHit || shape
}
// Point is outside the filled shape but within margin — skip (no margin bleed)| // starting from the TOP-MOST shape in z-index order, so any | ||
| // other hits would be occluded by the shape. | ||
| return inMarginClosestToEdgeHit || shape | ||
| if (distance <= 1) { |
There was a problem hiding this comment.
Threshold uses 1 instead of 0 for filled shapes
Medium Severity
The PR description states filled shapes hit only when distance <= 0 (cursor actually inside bounds), but the code checks distance <= 1. For closed geometries, positive distance means outside the shape, so distance <= 1 still allows hits up to 1 unit outside the shape boundary — contradicting the stated "no margin bleed" goal in the accompanying comment. The condition likely needs to be distance <= 0.



Filled shapes (assets, frames, anything with isFilled: true) now only hit when the cursor is actually inside their bounds (distance <= 0), not within the invisible 8px/zoom margin outside.
Unfilled shapes (lines, arrows, hollow outlines) keep the margin so they're still easy to click.