samizdatco / skia-canvas

A GPU-accelerated 2D graphics environment for Node.js
MIT License
1.7k stars 66 forks source link

`ctx.clip() + ctx.translate()` doesn't behave like browser counterpart #79

Closed MarosPistej closed 2 years ago

MarosPistej commented 2 years ago

About

When using combination of ctx.clip() & ctx.translate() result is not as expected in comparison to browser canvas, looks like translate is applied to previous (first) clip path, to my knowledge it's by design that in browser translate doesn't affect previously created clip path

Example

Created jsfiddle with browser canvas for reference & example code

how it should look browser Canvas: image

skia-canvas: image