-
-
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
allow for deep state check and save #3262
Conversation
I have updated to 1.6.5 (and now 1.6.6) and we have an object that extends Line and then includes a shadow. When the shadow is added this new deep state clone stuff fails in a stack overflow and breaks everything for us. If I change the deep = true to deep = false, it works. Is there some way for us to configure this outside of fabric? Is there something that would cause this endless loop? |
+1 to previous |
did not get this notice. Giving a look to this. sorry i released 1.6.7 just 2 days ago. |
I have a question, are you using stateful = true? |
i use stateful:false in my app |
this.canvas.forEachObject(function(obj) {
if (!obj.id) {
var _obj2 = obj.toObject(['x1', 'y1', 'x2', 'y2', 'objID', 'selectable']),
_obj;
if (obj.type === 'path') {
_obj = new fabric.Path.fromObject(_obj2, function(foo) {
_tmpCanvas.add(foo);
}
);
} else {
_obj =
new fabric [fabric.util.string.camelize(fabric.util.string.capitalize(obj.type))].fromObject(_obj2);
_tmpCanvas.add(_obj);
}
}
}); that code. If some of objects have shadow -> extend function gooing to maximum stack call |
SaveState and hasStateChanged work on a simple equality and reference storage.
So storing a fill color is ok, storying an array of values ( transformMatrix, textDecoration ) is not.
This Pr enable for deeper checks, Fixes a bug in wich additional state properties where not check during hasStateChanged and extend the merge ( and clone ) util with deep option.