-
-
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
BREAKING refactor(Geometry): rm line coords #9373
Conversation
Build Stats
|
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.
oCoords
=>controlCoords
aCoords
=>ownCoords
progress
@@ -1375,9 +1375,10 @@ export class FabricObject< | |||
sendObjectToPlane(this, this.getViewportTransform()); | |||
} | |||
|
|||
// skip canvas zoom and calculate with setCoords now. | |||
this.setCoords(); |
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 think there is aredundant call to setCoords in this method
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.
calcOCoords
=>protected calcControlCoords
calcACoords
=>protected calcCornerCoords
- rm
_getCoords
,_containsCenterOfCanvas
,calcLineCoords
- rm
absolute, calculate
for all geometry methods - rm
scaleToWidth
,scaleToHeight
because it is not supported under group and expections are unclear regarding usage + it is a fairly simple method to write
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.
good to go
@@ -218,7 +214,7 @@ | |||
assert.equal(object.containsPoint(point5), false); | |||
}); | |||
|
|||
QUnit.test('containsPoint with padding', function(assert) { | |||
QUnit.test.skip('containsPoint with padding', function(assert) { |
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.
we should discuss this.
It is not a problem respecting padding in containsPoint
I think it should be an option though.
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.
moved all the getCoords tests to src/shapes/Object/Object.spec.ts
restore restore restore Update Intersection.ts fix Create Intersection.spec.ts isPointInPolygon Update Intersection.ts Update Intersection.ts Update Intersection.ts Update Intersection.ts update CHANGELOG.md Update CHANGELOG.md
Update Intersection.ts Update Intersection.ts Update Intersection.ts Update Intersection.ts
5bb3bcb
to
4293b84
Compare
Update Object.spec.ts
4293b84
to
baac40c
Compare
baac40c
to
29d4cbf
Compare
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.
u
Update resize_filter.js
29d4cbf
to
4d91730
Compare
i would like to approach this differently. |
Nope |
i would like to remove the absolute parameter in the codebase without any rename first. |
i made a different branch where i tackle the entirity of the absolute arguments in the functions ( at lesat all the one i found ), but i didn't rename anything and i still didn't test it properly. But that is how i would like to tackle the removal of a layer of coordinates that we shouldn't have. |
Motivation
#8767 #9372
It it something we are talking about for a long time and now it is possible.
Description
First merge #9372 (removes the need for
lineCoords
)Removes
lineCoords
from geometry and theabsolute
concept/arg as well as thecalculate
arg.Meaning that in this PR all calculation are done in the scene plane, point args are expected to be in that plane.
This is incorrect because of stroke uniform, padding etc. but is a big step forward. I made this PR incremental and minimal as possible.
This should be considered part of the group rewrite because it make Geometry 100% safe to use with groups as opposed to before there were a number of valunrabilities (
_getCoords
returning own coords regardless of group,containsPoint
doing something still unclear to me etc.)Also if I am not mistaken,
lineCoords
were wrong when under group because they applied the viewportTransform before the group transform, it should have been vice versa.Changes
oCoords
=>controlCoords
aCoords
=>ownCoords
calcOCoords
=>protected calcControlCoords
calcACoords
=>protected calcCornerCoords
_getCoords
,_containsCenterOfCanvas
,calcLineCoords
absolute, calculate
for all geometry methodsscaleToWidth
,scaleToHeight
because it is not supported under group and expections are unclear regarding usage + it is a fairly simple method to writeGist
In Action