Skip to content
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

Update use of getBoundingRect in Guides Example #4631

Merged
merged 2 commits into from
Jan 18, 2018

Conversation

jrking4
Copy link
Contributor

@jrking4 jrking4 commented Jan 18, 2018

Aligning Guidelines Example broken. Update to use getBoundingRect() function

Aligning Guidelines Example broken. Update to use getBoundingRect() function
@asturur
Copy link
Member

asturur commented Jan 18, 2018

thanks!

do guidelines work correctly? i do not check them since long

@jrking4
Copy link
Contributor Author

jrking4 commented Jan 18, 2018

Yes they work well in 2.0. Was just throwing a cant find getBoundingRectHeight() function error. So I updated the functions.

objectHeight = canvasObjects[i].getBoundingRectHeight() / viewportTransform[3],
objectWidth = canvasObjects[i].getBoundingRectWidth() / viewportTransform[0];
objectHeight = canvasObjects[i].getBoundingRect().height / viewportTransform[3],
objectWidth = canvasObjects[i].getBoundingRect().width / viewportTransform[0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use the same logic here, call boundingRect once, and then read width/height.

@asturur asturur merged commit f5ee274 into fabricjs:master Jan 18, 2018
thiagocunha pushed a commit to thiagocunha/fabric.js that referenced this pull request Nov 18, 2019
* Update use of getBoundingRect in Guides Example

Aligning Guidelines Example broken. Update to use getBoundingRect() function

* Ensure getBoundingRect is called only once
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants