From 86c99607a393b43aeb50979e97ab69853293847f Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Tue, 2 Aug 2016 18:44:48 +0200 Subject: fixed #514 and #516 - removed `SVG.Text.clone()` which is inherited by `SVG.Element.clone()` - make element visible when call bbox on a clone --- src/boxes.js | 2 +- src/text.js | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/boxes.js b/src/boxes.js index 1e9d0eb..989a69e 100644 --- a/src/boxes.js +++ b/src/boxes.js @@ -15,7 +15,7 @@ SVG.BBox = SVG.invent({ box = element.node.getBBox() } catch(e) { if(element instanceof SVG.Shape){ - var clone = element.clone(SVG.parser.draw) + var clone = element.clone(SVG.parser.draw).show() box = clone.bbox() clone.remove() }else{ diff --git a/src/text.js b/src/text.js index 6dd4dee..7438cff 100644 --- a/src/text.js +++ b/src/text.js @@ -16,17 +16,8 @@ SVG.Text = SVG.invent({ // Add class methods , extend: { - clone: function(){ - // clone element and assign new id - var clone = assignNewId(this.node.cloneNode(true)) - - // insert the clone after myself - this.after(clone) - - return clone - } // Move over x-axis - , x: function(x) { + x: function(x) { // act as getter if (x == null) return this.attr('x') -- cgit v1.2.3