public static SvgXML FromSvgParser(SvgParser parser) { var svg = new SvgXML(); svg._paths.Add(parser._scaler.ToPath()); svg._bounds = parser._bounds; return(svg); }
public void Scale(float factor) { for (int i = 0; i < _paths.Count; i++) { var sp = SvgParser.FromPath(_paths[i]); sp._scaler.Scale(factor); _paths[i] = sp._scaler.ToPath(); } _bounds.l *= factor; _bounds.t *= factor; _bounds.w *= factor; _bounds.h *= factor; }
public static SvgParser FromPath(string svgpath) { var sp = new SvgParser(); sp.Parse(svgpath); #if OSX var box = sp._cgpath.BoundingBox; sp._bounds.l = box.Left; sp._bounds.t = box.Top; sp._bounds.w = box.Width; sp._bounds.h = box.Height; #endif return(sp); }