diff options
Diffstat (limited to 'dist/svg.js')
-rw-r--r-- | dist/svg.js | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/dist/svg.js b/dist/svg.js index 84b8892..0753468 100644 --- a/dist/svg.js +++ b/dist/svg.js @@ -1,4 +1,4 @@ -/* svg.js v0.32-3-gd93be6c - svg regex default color array number viewbox bbox rbox element parent container fx event defs group arrange mask clip gradient doc shape use rect ellipse line poly path plotable image text textpath nested sugar set memory loader - svgjs.com/license */ +/* svg.js v0.32-4-gbd58094 - svg regex default color array number viewbox bbox rbox element parent container fx event defs group arrange mask clip gradient doc shape use rect ellipse line poly path plotable image text textpath nested sugar set memory loader - svgjs.com/license */ ;(function() { this.SVG = function(element) { @@ -685,6 +685,27 @@ this.cy = this.y + this.height / 2 } + + // + SVG.extend(SVG.RBox, { + // merge rect box with another, return a new instance + merge: function(box) { + var b = new SVG.RBox() + + /* merge box */ + b.x = Math.min(this.x, box.x) + b.y = Math.min(this.y, box.y) + b.width = Math.max(this.x + this.width, box.x + box.width) - b.x + b.height = Math.max(this.y + this.height, box.y + box.height) - b.y + + /* add the center */ + b.cx = b.x + b.width / 2 + b.cy = b.y + b.height / 2 + + return b + } + + }) SVG.Element = function(node) { /* make stroke value accessible dynamically */ |