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

object disappears after canvas.setWidth/setHeight with some magic numbers #3821

Closed
Yaojian opened this issue Apr 3, 2017 · 7 comments
Closed

Comments

@Yaojian
Copy link

Yaojian commented Apr 3, 2017

Test Case

https://jsfiddle.net/Yaojian/2wrfba13/

Problem

The rect disappears after canvas.setWidth/setHeight greater than some magic number, for example, set width greater than 10001 or set height greater than 6710.

Is there a limitation of the size of canvas ?

Version

fabricjs version: 1.7.9

Enviornment (updated on 04/08/2017)

Browser: chrome 57.0.2987.133 (64-bit) or Safari 9.1.3 (11601.7.8)
OS: OS X 10.11.6 on retina MacBook Pro

For FireFox, the limitations is 1251 * 6701, which is much smaller :-(

@ncou
Copy link
Collaborator

ncou commented Apr 4, 2017

Hi,

I can't reproduce this bug, which navigator are you using ?

@asturur
Copy link
Member

asturur commented Apr 4, 2017

Yes there is a size limit.
First of all if you are on macbook with retina you are working on a double size of what you size.

What browser where you using? for me it works.

@Yaojian
Copy link
Author

Yaojian commented Apr 8, 2017

Browser: chrome 57.0.2987.133 (64-bit) or Safari 9.1.3 (11601.7.8)
OS: OS X 10.11.6 on retina MacBook Pro

For FireFox, the limitation is 1251 * 6701, which is much smaller :-(

@Yaojian
Copy link
Author

Yaojian commented Apr 11, 2017

@asturur @ncou could you reproduce the bug? Be aware to increase the value of witdh/height before running the test.

@asturur
Copy link
Member

asturur commented Apr 11, 2017

Sure. Canvas has its own limits.
Currents limits make canvas element crash without notice for the user.

Max supported dimensions on chrome and firefox are around more or less 20.000 per size.

Having 10.000 on a retina screen equals to 20.000

You cannot go much bigger in a browser.

@asturur asturur closed this as completed Apr 11, 2017
@Yaojian
Copy link
Author

Yaojian commented Apr 12, 2017

@asturur thanks for your reply.

What does 20.000 mean ? In chrome, I can get a canvas with 10001 * 6710, which is 67106710.

@asturur
Copy link
Member

asturur commented Apr 14, 2017

20.000 x side is the limit more or less. 10000 with retina scaling is doubled.

please try to set enableRetinaScaling to false and it should work up to 20.000

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

No branches or pull requests

3 participants