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

using object.toDataURL() in zoomed canvas returns controls position misplaced #5472

Closed
rikkarv opened this issue Jan 10, 2019 · 4 comments · Fixed by #5481
Closed

using object.toDataURL() in zoomed canvas returns controls position misplaced #5472

rikkarv opened this issue Jan 10, 2019 · 4 comments · Fixed by #5481
Labels

Comments

@rikkarv
Copy link

rikkarv commented Jan 10, 2019

Version

2.4.6

Test Case

http://jsfiddle.net/rg9mhvuj/

Information about environment

Browser: Chrome

Steps to reproduce

Set zoom input to 2 and click "rectangle.toDataURL" button

Expected Behavior

On mouse over rectangle and clicking in it should set rectangle as active object

Actual Behavior

The controls of the rectangle are located as the canvas wasn't zoomed.
screenshot

Comments

This situation can be solved by calling "object.setCoords()" after "object.toDataURL()".
However i leave to you the decision if it is a bug or if it should be used .setCoords() (maybe add this example to https://github.com/fabricjs/fabric.js/wiki/When-to-call-setCoords)

@asturur
Copy link
Member

asturur commented Jan 12, 2019

seems a bug to me. Need to read better the fiddle, i m from phone.

@asturur
Copy link
Member

asturur commented Jan 13, 2019

ok this is a bug. have you any idea if it happened before 2.5.0?

@rikkarv
Copy link
Author

rikkarv commented Jan 14, 2019

      ok this is a bug. have you any idea if it happened before 2.5.0?

I've tried with previous versions and it happened.
I' ve tested now with 2.6 and it's fixed. Thank you very much @asturur

@asturur
Copy link
Member

asturur commented Jan 14, 2019

depending on what are you doing with the toDataUrl, take care there is a toCanvasElement also now! maybe is usefull if you are redisplaying that dataUrl sonewhere else

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants