aboutsummaryrefslogtreecommitdiffstats
path: root/src/shape.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2012-12-17 19:39:52 +0100
committerwout <wout@impinc.co.uk>2012-12-17 19:39:52 +0100
commit8dfec33b4fa79b89d89a07e3ae92c5d5c5f8ce73 (patch)
tree7caa493057b543ac40008770fdb4df566995c4e7 /src/shape.js
parent6a013f19d6fa84e538d31bca5f1466c5f3479630 (diff)
downloadsvg.js-8dfec33b4fa79b89d89a07e3ae92c5d5c5f8ce73.tar.gz
svg.js-8dfec33b4fa79b89d89a07e3ae92c5d5c5f8ce73.zip
Code slimming
Diffstat (limited to 'src/shape.js')
-rw-r--r--src/shape.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/shape.js b/src/shape.js
index a57b9f2..1a32a00 100644
--- a/src/shape.js
+++ b/src/shape.js
@@ -10,26 +10,26 @@ SVG.Shape.prototype = new SVG.Element();
SVG.Utils.merge(SVG.Shape, {
// set fill color and opacity
- fill: function(fill) {
- if (fill.color != null)
- this.attr('fill', fill.color);
+ fill: function(f) {
+ if (f.color != null)
+ this.attr('fill', f.color);
- if (fill.opacity != null)
- this.attr('fill-opacity', fill.opacity);
+ if (f.opacity != null)
+ this.attr('fill-opacity', f.opacity);
return this;
},
// set stroke color and opacity
- stroke: function(stroke) {
- if (stroke.color != null)
- this.attr('stroke', stroke.color);
+ stroke: function(s) {
+ if (s.color)
+ this.attr('stroke', s.color);
- if (stroke.width != null)
- this.attr('stroke-width', stroke.width);
+ if (s.width != null)
+ this.attr('stroke-width', s.width);
- if (stroke.opacity != null)
- this.attr('stroke-opacity', stroke.opacity);
+ if (s.opacity != null)
+ this.attr('stroke-opacity', s.opacity);
if (this.attrs['fill-opacity'] == null)
this.fill({ opacity: 0 });