Closed CatchABus closed 2 months ago
It seems that if I draw something on canvas using a timeout, the previous drawing will be erased. Seems to occur on android and ios (devices only)
Samples to test:
This works
export function onContextReady(args) { var canvas = args.object; var ctx = canvas.getContext("2d"); ctx.rect(50, 20, 200, 120); ctx.stroke(); ctx.fillStyle = "red"; ctx.fillRect(0, 0, 150, 100); }
This is with timeout. It will erase first shape and draw red rectangle alone
export function onContextReady(args) { var canvas = args.object; var ctx = canvas.getContext("2d"); ctx.rect(50, 20, 200, 120); ctx.stroke(); ctx.fillStyle = "red"; setTimeout(() => ctx.fillRect(0, 0, 150, 100), 2000); }
Fixed in https://github.com/NativeScript/canvas/commit/9a5723f7f7b6aa555e8a3f020ffc8bfc5753ad50
It seems that if I draw something on canvas using a timeout, the previous drawing will be erased. Seems to occur on android and ios (devices only)
Samples to test:
This works
This is with timeout. It will erase first shape and draw red rectangle alone