From 131df0fe988949360086937570128c46e3f46f87 Mon Sep 17 00:00:00 2001 From: dotnetCarpenter Date: Tue, 11 Apr 2017 16:25:48 +0200 Subject: [PATCH] fixed bbox not declared in SVG.Box.transform --- CHANGELOG.md | 2 ++ src/boxes.js | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2876973..b66c8e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,8 @@ The document follows the conventions described in [“Keep a CHANGELOG”](http: ### Fixed - `clear()` does not remove the parser in svg documents anymore +- `len` not declared in FX module, making it a global variable +- `bbox` not declared in SVG.Box.transform ## [2.5.1](https://github.com/svgdotjs/svg.js/releases/tag/2.5.1) - 2017-03-27 diff --git a/src/boxes.js b/src/boxes.js index dd6003b..0a7759f 100644 --- a/src/boxes.js +++ b/src/boxes.js @@ -8,11 +8,10 @@ SVG.Box = SVG.invent({ this.y = y this.width = width this.height = height - } // add center, right, bottom... - fullBox(this) + fullBox(this) } , extend: { // Merge rect box with another, return a new instance @@ -29,7 +28,7 @@ SVG.Box = SVG.invent({ } , transform: function(m) { - var xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, p + var xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, p, bbox var pts = [ new SVG.Point(this.x, this.y), @@ -78,7 +77,7 @@ SVG.BBox = SVG.invent({ topParent = topParent.parentNode } if (topParent != document) throw new Exception('Element not in the dom') - } else { + } else { // the element is NOT in the dom, throw error if(!document.documentElement.contains(element.node)) throw new Exception('Element not in the dom') } -- 2.39.5