-
-
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(object_interactivity): draw borders #7932
Conversation
easier to override + better all over
Code Coverage Summary
|
Code Coverage Summary
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
* @param {Object} styleOverride object to override the object style | ||
* @return {fabric.Object} thisArg | ||
* @chainable | ||
* @public override if necessary |
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 could say that this function is here exactly for the scope of overriding. Otherwise someone could argue, why having a method on a class that does not need this
at all.
I would just say override this function in order to draw a different control box. example: rounded corners, different border style.
We should also inform whihc is the state of the context in that situation to give the dev some extra information.
(rotated aligned with object base, centered on the center of the object, scaled to absorb object scale and container scale and zoom )
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 ctx is in the same state as in the object's render method right?
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.
Or maybe not. I am confused
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.
(rotated aligned with object base, centered on the center of the object, scaled to absorb object scale and container scale and zoom )
hard to understand
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 ctx is not in the same state, because when you scale the object the controls do not grow.
i m also wrong the ctx is only centered and rotated, and is not scaled at all.
I m pointing out that override in case of necessity
can be writte on top of any function or none.
Since you made this refactor with a keen eye on having it overridable for some reason, just indicate the reason as an example for future reader
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.
If I recall correctly it is rotated and translated to center. But not scaled or skewed...
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.
Code Coverage Summary
|
Code Coverage Summary
|
READY |
This PR refactors logic to enable easier overriding + maintenance.
_drawBorders
strokeBorders
for easier overridingBREAKING d257c99:
drawBordersInGroup
drawBroders
signature