nativescript-community / ui-canvas

Implement Canvas into your NativeScript apps.
https://nativescript-community.github.io/ui-canvas/
Apache License 2.0
31 stars 9 forks source link

Crash occurs when utilizing paint.setShadowLayer in the onDraw method. #11

Closed itzaks closed 4 years ago

itzaks commented 4 years ago

Hi!

Thanks for a great plug-in. There is an error occurring with the setShadowLayer method on android.

Getting: Calling js method onDraw failed System.err: RangeError: Maximum call stack size exceeded.

It is also occurring if using the template variant, and utilizing the shadow-attribute as in some test code I found in the repo.

<CanvasView row="0">
  <Shapes>
    <Rectangle shadow="3 3 black" strokeColor="red"  strokeWidth="6" left="10" top="10" width="20" height="20" />
  </Shapes>
</CanvasView>

TNS version is 6.3.2.

Tried this on the latest nativescript-canvas version nativescript-canvas@2.1.23.

Cheers

itzaks commented 4 years ago

Apparently this was introduced in the later versions. Rolling back to nativescript-canvas@2.1.11 fixes the problem.

farfromrefug commented 4 years ago

@itzaks it seems to be working here. Can you share a project which shows the error?

itzaks commented 4 years ago

Strange. It now seems to work fine here as well. I guess it must have been something else. Thanks for your time!