svg-layout-designer-react/src/Components/Canvas/README.md
2022-10-02 21:31:29 +02:00

757 B

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.