2

I'm trying to convert svg to canvas using the canvg js lib.

The original svg contains a rect which has a fill attribute of url to a svg pattern. When I convert the svg to canvas using canvg:

canvg(document.getElementById('canvas'), svg);

The image of the rect fill changes its proportions (The width and the height change).

This shows the svg before and after the conversion.

Does anyone have an idea for solving this issue?

Rivka
  • 171
  • 1
  • 6

1 Answers1

0

http://jsfiddle.net/L3hondLn/230/

I'm changed

<pattern id="img1" width="20" height="20">

to

<pattern id="img1" width="200" height="200">

And it's work.

z1m.in
  • 1,661
  • 13
  • 19
  • 1
    Thanks, but in my app http://jsfiddle.net/L3hondLn/231/ I have many circles, and changing the pattern size doesn't help, since they are different from each other. – Rivka Oct 22 '15 at 11:41
  • 1
    I want the canvas to look exactly as the svg. can you try to edit the second fiddle? – Rivka Oct 22 '15 at 11:51