diff options
author | wout <wout@impinc.co.uk> | 2013-02-20 19:10:03 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-02-20 19:10:03 +0100 |
commit | ae878fd63077d4c95f2de9053a6f0951b55239eb (patch) | |
tree | 5dba7bd42a8b5702faeb6cc12d2b4d4099841e51 /src/pattern.js | |
parent | 5020240e4029a61a9620f21d7be4d9764e7723d1 (diff) | |
download | svg.js-ae878fd63077d4c95f2de9053a6f0951b55239eb.tar.gz svg.js-ae878fd63077d4c95f2de9053a6f0951b55239eb.zip |
Created separate classes for SVG.ViewBox anSVG.BBox0.6
Diffstat (limited to 'src/pattern.js')
-rw-r--r-- | src/pattern.js | 20 |
1 files changed, 10 insertions, 10 deletions
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 |