-
-
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
fabric.Group initialize does not pass options to fabric.Object superclass #926
Comments
I don't recall at a moment but if you could update and test things out that would be great! |
Ok, I'll have a look when I have a bit of time.
|
Are there any updates on this? I am creating a custom element extending a group and seem to be having lots of group related issues (such as the group moving, but the contents staying put). |
I think this never went in, right? |
Hm, you're right; looks like it didn't. I'll merge PR now if you send it ;) |
Looks like a good offer :) |
fabric.Group.prototype.initialize
callsthis.callSuper('initialize')
instead ofthis.callSuper('initialize', options)
, effectively preventing any proper initialization of the object done byfabric.Object.prototype.initialize
. Instead, it merely (and blindly) adds all options properties to the prototype withextend(this, options)
. Is this an intentional behavior for some reason?I am especially thinking about all properties that need a proper initialization (e.g.
'gradient'
and'shadow'
) rather than simply being added to the Group prototype. More generally, any property that needs a special initialization which is implemented infabric.Object
should be initialized the same way forfabric.Group
.I suppose calling
this.callSuper('initialize', options)
and removingextend(this, options)
would fix this problem (see an an examplefabric.Image
).The same applies to
fabric.Group.prototype._set
which overridesfabric.Object.prototype._set
. To properly initialize all properties defined infabric.Object
,this.callSuper('_set', key, value)
should be called instead ofthis[key] = value;
.The text was updated successfully, but these errors were encountered: