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
chore(TS): finalize interactivity #8404
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.
READY
src/controls/control.class.ts
Outdated
fabricObject: FabricObject, | ||
currentControl: Control | ||
) { | ||
positionHandler(dim: Point, finalMatrix: TMat2D, fabricObject: FabricObject) { |
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.
see prev comment
* @todo evaluate simplification of code switching to circle interaction area at runtime | ||
* @private | ||
*/ | ||
_setCornerCoords(): void { |
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.
refactored into _calcCornerCoords()
in a revertable commit 5afe4c6
reasons:
- cleaner/readable code
- better typed
- perf (one less iteration, kept in a contained method since I saw you wrote it might be removed)
- since it is private, considered not breaking
* @todo evaluate simplification of code switching to circle interaction area at runtime | ||
* @private | ||
*/ | ||
private _calcCornerCoords(control: Control, position: Point) { |
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.
see prev comment
|
||
type TOCoord = IPoint & { | ||
type TOCoord = Point & { |
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 am pretty sure we use it as a Point in fabric
ready |
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.
updated
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.
@asturur this is waiting too long
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.
updated from master
); | ||
this.forEachControl((control, key) => { | ||
const position = control.positionHandler(dim, finalMatrix, this, control); | ||
coords[key] = Object.assign( |
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.
using assign since I think we use it as Point as well
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 will clarify this with a comment. so it doesn't get swapped with a spread operator
Motivation
Description
Finalize migrating interactivity and controls since we did it in parallel
#8400 #8401
Changes
_setCornerCoords
=>_calcCornerCoords
__corner
type is not 0 anymore, string or undefinedGist
In Action