Add readme for canvas

This commit is contained in:
Eric NGUYEN 2022-10-02 21:31:29 +02:00
parent 04d79688cb
commit 50626218ba

View file

@ -0,0 +1,17 @@
# Canvas API
Canvas API is currently experimental and supports neither custom SVG nor SVG export yet.
It is an alternative to the SVG and offers the following pros:
- Hardware acceleration
- Better compatibility with Gecko and WebKit web engine
- More freedom with animations
However, there are cons:
- Animation must be hand made without CSS
- `csstype` cannot be used and must be mapped to its object (i.e `strokeWidth` become `ctx.lineWidth`)
- More complex to learn and to read
As you can see, for the user experience Canvas API may be the best solution while SVG is better for fast development.
Currently, SVG is preferred as it offers more features. However, it is known that Gecko engine is crashing on the SVG rendering when objects are moving.