-
-
Notifications
You must be signed in to change notification settings - Fork 6
develop #228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
develop #228
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -42,9 +42,25 @@ export const execute = ( | |||||||||||||||||||||
| tMatrix[3], tMatrix[4], tMatrix[5] | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| const hit = graphicsHitTestService( | ||||||||||||||||||||||
| hit_context, graphics.buffer, hit_object | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
| let hit = false; | ||||||||||||||||||||||
| if (graphics.buffer.length) { | ||||||||||||||||||||||
| hit = graphicsHitTestService( | ||||||||||||||||||||||
| hit_context, graphics.buffer, hit_object | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
| } else { | ||||||||||||||||||||||
| hit_context.setTransform( | ||||||||||||||||||||||
| tMatrix[0], tMatrix[1], tMatrix[2], | ||||||||||||||||||||||
| tMatrix[3], tMatrix[4], tMatrix[5] | ||||||||||||||||||||||
| ); | ||||||||||||||||||||||
| hit_context.beginPath(); | ||||||||||||||||||||||
|
||||||||||||||||||||||
| hit_context.beginPath(); |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rectangle path should start from (graphics.xMin, graphics.yMin) instead of (0, 0). The current implementation assumes the shape bounds start at the origin, but shapes can have non-zero xMin/yMin values (as tested in test case23 with negative coordinates). The path should be:
hit_context.moveTo(graphics.xMin, graphics.yMin);
hit_context.lineTo(graphics.xMax, graphics.yMin);
hit_context.lineTo(graphics.xMax, graphics.yMax);
hit_context.lineTo(graphics.xMin, graphics.yMax);
hit_context.lineTo(graphics.xMin, graphics.yMin);| hit_context.moveTo(0, 0); | |
| hit_context.lineTo(width, 0); | |
| hit_context.lineTo(width, height); | |
| hit_context.lineTo(0, height); | |
| hit_context.lineTo(0, 0); | |
| hit_context.moveTo(graphics.xMin, graphics.yMin); | |
| hit_context.lineTo(graphics.xMax, graphics.yMin); | |
| hit_context.lineTo(graphics.xMax, graphics.yMax); | |
| hit_context.lineTo(graphics.xMin, graphics.yMax); | |
| hit_context.lineTo(graphics.xMin, graphics.yMin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
setTransformcall is duplicated - it's already called on lines 40-43 before the conditional check. The second call on lines 51-54 is redundant and should be removed.