1
0
Fork 0

Revert "Use new canvas Path rect/SVG support."

Don't use the built-in SVG/rect parser, since this bypasses creating
coordinate / command properties which some Canvas users rely upon.

This reverts commit 57a2d21ddf.
This commit is contained in:
James Turner 2017-01-23 17:51:39 +00:00
parent 30c6428f7f
commit 51e2ddc8ba
2 changed files with 16 additions and 23 deletions

View file

@ -778,12 +778,6 @@ var Path = {
me._last_coord = size(coords) - 1;
return me;
},
setDataSVG: func(svgPath)
{
me.reset();
me._node.setValues({'svg': svgPath});
return me;
},
# Add a path segment
addSegment: func(cmd, coords...)
{

View file

@ -502,15 +502,13 @@ var parsesvg = func(group, path, options = nil)
else if( name == "path" or name == "rect" )
{
pushElement('path', attr['id']);
var p = stack[-1];
if( name == "rect" )
{
p.set('rect/left', evalCSSNum(attr['x']));
p.set('rect/top', evalCSSNum(attr['y']));
p.set('rect/width', evalCSSNum(attr['width']));
p.set('rect/height', evalCSSNum(attr['height']));
var width = evalCSSNum(attr['width']);
var height = evalCSSNum(attr['height']);
var x = evalCSSNum(attr['x']);
var y = evalCSSNum(attr['y']);
var rx = attr['rx'];
var ry = attr['ry'];
@ -519,13 +517,14 @@ var parsesvg = func(group, path, options = nil)
else if( rx == nil )
rx = ry;
if( rx != nil ) {
p.set('border-radius[0]', rx);
p.set('border-radius[1]', ry);
}
} else {
p.setDataSVG(attr['d']);
var cfg = {};
if( rx != nil )
cfg["border-radius"] = [evalCSSNum(rx), evalCSSNum(ry)];
stack[-1].rect(x, y, width, height, cfg);
}
else
parsePath(attr['d']);
var fillOpacity = style['fill-opacity'];
if( fillOpacity != nil)