reactjs / react-art

React Bridge to the ART Drawing Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to get paths from illustrator working

faceyspacey opened this issue · comments

The paths generated in illustrator look close enough to what's used in the examples. Illustrator seems to generate SVG paths with hyphens though:

M382.79,279.74l-29,18a1.48,1.48,0,0,1-2.27-.95V282.1l8.7,6h0a1.12,1.12,0,0,0,.75.29,1.14,1.14,0,0,0,1.14-1.14,1.12,1.12,0,0,0-.05-0.33h0a1.11,1.11,0,0,0-.12-0.27L358,277.78l11.74-9.61,13,8.08a2,2,0,0,1,0,3.49h0Z

Here's what is working from the examples:

var RED_DOT_PATH = "M12.5,17 C16.0898511,17 19,14.0898511 19,10.5 C19,6.91014895 16.0898511,4 12.5,4 C8.91014895,4 6,6.91014895 6,10.5 C6,14.0898511 8.91014895,17 12.5,17 Z M12.5,17";

How do I generate (or convert) to something like that using Illustrator and exporting SVGs?

I think those paths from Illustrator should work. The hyphens are just minus signs. That is,

M382.79,279.74l-29,18

means "move to (382.79, 279.74), then draw a line to the point 29 units left and 18 units down".