-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
refactor() BREAKING Remove calculate option from geometry methods #9483
Conversation
Needs rebase when the oher one is merged. |
Build Stats
|
this is reviewable now |
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 would like to rename aCoords, oCoords to something like cornerCoords and controlCoords
I also want to remove |
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.
looks good
Update ObjectGeometry.ts
3ddc262
to
78956a6
Compare
Motivation
All the geometry methods had a calculate optional parameter that was used to get the values without running setCoords.
setCoords is one of the learning step of fabricJS.
When you change a geometry property of an object, you have to call setCoords for the basic standard coordinates to be cached correctly.
FabricJS does that for every user interaction point, but for the code written by developer that is on the developer.
calculate: boolean
defaulted to false and created more harm than good.You could either:
OR
this wasn't true for all the parts of fabricJS that work on the object coordinates, target check for example is one.
This led to situation where you could use calculate true, but then have to call setCoords anyway to get things working correctly.
At this point is easier to learn that if you change object position or size with your code, you have also to call setCoords for things to just works.
Affected methods