From ae878fd63077d4c95f2de9053a6f0951b55239eb Mon Sep 17 00:00:00 2001 From: wout Date: Wed, 20 Feb 2013 19:10:03 +0100 Subject: Created separate classes for SVG.ViewBox anSVG.BBox --- src/pattern.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/pattern.js') diff --git a/src/pattern.js b/src/pattern.js index c12978e..82a2339 100644 --- a/src/pattern.js +++ b/src/pattern.js @@ -1,31 +1,31 @@ -SVG.Pattern = function Pattern(type) { - this.constructor.call(this, SVG.create('pattern')); +SVG.Pattern = function(type) { + this.constructor.call(this, SVG.create('pattern')) /* set unique id */ - this.attr('id', (this.id = 'svgjs_element_' + (SVG.did++))); -}; + this.attr('id', (this.id = 'svgjs_element_' + (SVG.did++))) +} // Inherit from SVG.Container -SVG.Pattern.prototype = new SVG.Container(); +SVG.Pattern.prototype = new SVG.Container // SVG.extend(SVG.Pattern, { // Return the fill id fill: function() { - return 'url(#' + this.id + ')'; + return 'url(#' + this.id + ')' } -}); +}) // SVG.extend(SVG.Defs, { /* define gradient */ pattern: function(width, height, block) { - var element = this.put(new SVG.Pattern()); + var element = this.put(new SVG.Pattern()) /* invoke passed block */ - block(element); + block(element) return element.attr({ x: 0, @@ -33,7 +33,7 @@ SVG.extend(SVG.Defs, { width: width, height: height, patternUnits: 'userSpaceOnUse' - }); + }) } }); \ No newline at end of file -- cgit v1.2.3