- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 3.6k
refactor(polyline): introduces resizingOffset #8452
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
Conversation
| If I understand correctly @asturur means we are going to take a closer look at width/height in general. So this effort might be redundant. Hopefully we will discuss it in the upcoming days. | 
| This pull request 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. | 
| This pull request 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. | 
| we will look at this in the context of #8767 | 
| @luizzappa would want to try to do polys in #8767 ? | 
| 
 @ShaMan123, working on fabric.js internals is always rewarding (and most of the time fun) :) The only problem is that I don't have a lot of time, so I need a direction of what has to be done and preferably smaller blocks. If the task fits these requirements, you can count on me. Trying to understand everything that is happening in that PR would take some time that I don't have at the moment. | 
| Great | 
| This pull request 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. | 
| closing in favor of #8374 | 
Motivation
The calculation of the poly's BBOX alters the original
heightandwidthvalues of the object's, causing a different behavior from other fabricjs objects and making the return of the_getNonTrasformedDimensionsfunction incorrect.Description
It introduces
resizingOffsetproperty that stores how much we must add to thewidthandheightof the object to find the correct value for the BBOX and does not change the originals values ofwidthandheight.Changes
In addition of the
resizingOffsetproperty, extendtransformMatrixKeygiven that the propertiesstrokeUniform,strokeLineJoin,strokeLineCap,strokeMiterLimitchange thewidth/heightof the BBOX, but the original matrix transform cache does not take into account these changes.This was causing a bug in the controls when changing some property that the cache is not aware of.
As the
strokeMiterLimitmay or may not change the finalwidth/height, I thought it would be better to store theresizingOffsetproperty in the cache key instead of each of the properties individually (storkeLineJoin, StrokeLineCap, strokeUniform, strokeMiterLimit)