From 8dfec33b4fa79b89d89a07e3ae92c5d5c5f8ce73 Mon Sep 17 00:00:00 2001 From: wout Date: Mon, 17 Dec 2012 19:39:52 +0100 Subject: Code slimming --- src/shape.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/shape.js') 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 }); -- cgit v1.2.3