-
-
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
preserveObjectStacking: true - causes error in creating group from ActiveSelection #5160
Comments
i ll look into it, looks a bug. OFF TOPIC: it allows you to change the DPI of image generated by canvas, quickly in the browsers. |
this is the minimal amount of code to reproduce the bug in kitchensink. |
i do not see any difference with preserveObjectStacking false |
Ok the usual JS mutability problem that took 2 hours of my life. this needs to change once for all. |
Thanks for the reference to https://www.npmjs.com/package/changedpi @asturur looks interesting! I don't work with that company anymore, but might still have a use for it. 👍 |
Version
2.3.4
Test Case
https://jsfiddle.net/nateevans/jayc67sk/ (click the "Add & Group" button)
Steps to reproduce
preserveObjectStacking: true
Expected Behavior
A new group should be created with the selected objects and it should be actively selected.
Actual Behavior
Uncaught RangeError: Maximum call stack size exceeded
occursIt seems the uncaught error is result of recursive calls to
_set
here:fabric.js/src/shapes/active_selection.class.js
Line 105 in 068c815
Possible fix may lay in this area??
fabric.js/src/canvas.class.js
Line 359 in c541a27
The code in the fiddle works as expected with
preserveObjectStacking: false
, and the error does not occur when you do not pass the canvas object to the new ActiveSelection. But when you do not pass the canvas, the group is not created properly.I may be using the API incorrectly, not sure. But seems if the code works with
preserveObjectStacking: false
, it is probably not intended to error whenpreserveObjectStacking: true
The text was updated successfully, but these errors were encountered: