Skip to content

Use specified style in ink2canvas

What does the merge request do?

Suggested in #189 by @doom-goober

Fix three issues in the HTML canvas:

  • The specified style is now used for all elements, which makes it correctly interpret CSS styles
  • The width/height of the canvas is computed using viewbox_width
  • Comments are skipped, they previously led to a crash

Note that there is still performance to be gained with the first bullet point, see #446 (closed).

The new unit test covers all three points.

Summary for release notes

The HTML5 canvas export now works better with non-Inkscape SVG documents.

Checklist

  • Add unit tests (if applicable)
  • Changes to inkex/ are well documented
  • Clean merge request history
Edited by Jonathan Neuhauser

Merge request reports