You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been recreating the official demo sketches with an existing canvas (my repo) with CanvasForm(ctx) without using CanvasSpace and ran into some issues with methods.
Upon looking at the Canvas.ts source code, I noticed the 3 methods below make use of this.ctx, not this._ctx that are used by all the other methods.
but CanavsForm(ctx) created with an existing context does not have this._space initialized. (Canvas.ts line 478)
I think the quick fix might be just updating this.ctx to this._ctx or add a check inside get ctx() although I am not familiar enough with the library yet to know what other issues might be down the line. When I subclass CanvasForm and overwrite gradient() it worked for me.
Thank you!
The text was updated successfully, but these errors were encountered:
Hi,
I've been recreating the official demo sketches with an existing canvas (my repo) with
CanvasForm(ctx)
without usingCanvasSpace
and ran into some issues with methods.Upon looking at the
Canvas.ts
source code, I noticed the 3 methods below make use ofthis.ctx
, notthis._ctx
that are used by all the other methods.form.composite()
form.gradient()
form.clip()
this.ctx
comes from Canvas.ts line:499:but
CanavsForm(ctx)
created with an existing context does not havethis._space
initialized. (Canvas.ts line 478)I think the quick fix might be just updating
this.ctx
tothis._ctx
or add a check insideget ctx()
although I am not familiar enough with the library yet to know what other issues might be down the line. When I subclassCanvasForm
and overwritegradient()
it worked for me.Thank you!
The text was updated successfully, but these errors were encountered: