dawi
dawi

Reputation: 628

Scaling an imported svg from inkscape

I've imported an SVG file, created with inkscape.

I use http://github.com/wout/raphael-svg-import.

Some elements does not appear at the good place. It seems that all element I have copy/paste in my svg (which have a transform matrix are the problems)

It gets more frustrating when I try to scale the set with .attr('tranform', 's0.5')

-> All the sub elements scale but the position are even worse.

Upvotes: 0

Views: 342

Answers (1)

Kevin Nielsen
Kevin Nielsen

Reputation: 4433

I cannot speak to any issues generated by the import itself, but I can point out that the scale transform you're apply is relative -- so it will scale each element relative to that element's pre-transform location. In this case, you want to use an absolute transform for the coordinate origin:

set.attr( 'transform', 'S0.5,0.5,0,0' );

Upvotes: 1

Related Questions