-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
fix(): fix modify polygon points with zero sized polygons ( particular case of axis oriented lines ) #9575
Conversation
Build Stats
|
…js into ISSUE-9556-polycontrols
src/controls/polyControl.ts
Outdated
const mouseLocalPosition = sendPointToPlane( | ||
new Point(x, y), | ||
undefined, | ||
poly.calcTransformMatrix() |
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.
@ShaMan123 i do remember that x,y are always in the scene coordinates, but i m not sure that this is true also for when we run an action inside an interactive group. Do you remember if that was changed to accomodate interactive groups?
If those are in parent coordinates i have to change this with calcOwnTransform()
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.
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.
yeah we talked about this, but i wanted to be sure. So i ll use calcOwnMatrix
); | ||
const diff = newAnchorPointInParentPlane.subtract(anchorPointInParentPlane); | ||
poly.left -= diff.x; | ||
poly.top -= diff.y; |
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.
@ShaMan123 this approach with diffing the position of the anchor point in a reference plance, before and after the action works. Now also skew works fine.
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.
nice!
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.
I made the test case larger and included all variation of combination of settings of polygons ( 4 ) all with skewX/skewY/angle/scale and it works fine now. |
Test cases for me are fundamental, not having a ready test case sometimes stops me from even trying to address a bug |
I agree but we should stick to playwright and use what you did in the vanilla app |
Description
Since the polygon points are by design ignoring padding, we do not need to use the standard getLocalPoint and then deal with calculations that involve width/height directly.
We can use a plain matrix that should take care of placing the new point correctly.
This PR fixes the bug mentioned in #9556 and also fixes the displacement of the polygon when skew is involved
closes #9556
In Action