-
-
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
fabric.Text.scaleToWidth seemingly not working as intended in 1.7.6 #3719
Comments
would you post a fiddle that just fails on jsfiddle.net? one failing is enough, i do not need to see the working version with 1.7.3 |
Hi, here is jsfiddle link: |
Found the bug: When is time to use getBoundingRect if setCoords is not called manually, it uses the cached coordinates that are wrong. Now there are 2 or 3 ways to fix this, i have to choose which one is best. Thanks for spotting this bug. |
Oh, for now, just call text.setCoords BEFORE calling scaleToWidth |
I have the following code where I want to scale a text object to a certain max width if it is too long. It works in fabric 1.7.3 but fails in fabric 1.7.6, where the text simply disappear.
I then tried to fiddle with my own code when using 1.7.6 and found that performing a relative scale works for my need:
Why is this the case? The behavior in 1.7.6 seems rather strange. Could this be a bug?
The text was updated successfully, but these errors were encountered: