mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-22 07:19:57 -05:00
Clean up and shorten code.
This commit is contained in:
parent
86609103fc
commit
92eb89fc43
1 changed files with 7 additions and 6 deletions
|
@ -239,8 +239,11 @@ new function() {
|
||||||
origin = getPoint(svg, 'x1', 'y1');
|
origin = getPoint(svg, 'x1', 'y1');
|
||||||
destination = getPoint(svg, 'x2', 'y2');
|
destination = getPoint(svg, 'x2', 'y2');
|
||||||
}
|
}
|
||||||
var gradientColor = new GradientColor(gradient, origin, destination, highlight);
|
// We don't return the GradientColor, since we only need a reference to
|
||||||
applyAttributes(gradientColor, svg);
|
// it in definitions, which is created in applyAttributes()
|
||||||
|
applyAttributes(
|
||||||
|
new GradientColor(gradient, origin, destination, highlight), svg);
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var definitions = {};
|
var definitions = {};
|
||||||
|
@ -268,9 +271,7 @@ new function() {
|
||||||
|
|
||||||
// http://www.w3.org/TR/SVG/struct.html#SymbolElement
|
// http://www.w3.org/TR/SVG/struct.html#SymbolElement
|
||||||
symbol: function(svg, type) {
|
symbol: function(svg, type) {
|
||||||
var item = importGroup(svg, type);
|
return new Symbol(applyAttributes(importGroup(svg, type), svg));
|
||||||
item = applyAttributes(item, svg);
|
|
||||||
return new Symbol(item);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// http://www.w3.org/TR/SVG/struct.html#DefsElement
|
// http://www.w3.org/TR/SVG/struct.html#DefsElement
|
||||||
|
@ -332,7 +333,7 @@ new function() {
|
||||||
// lengthAdjust:
|
// lengthAdjust:
|
||||||
var text = new PointText(getPoint(svg, 'x', 'y', false, 0)
|
var text = new PointText(getPoint(svg, 'x', 'y', false, 0)
|
||||||
.add(getPoint(svg, 'dx', 'dy', false, 0)));
|
.add(getPoint(svg, 'dx', 'dy', false, 0)));
|
||||||
text.content = svg.textContent || '';
|
text.setContent(svg.textContent || '');
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue