From fd8ceb96419fc490e19eca37b1d4137c3c58d918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 20 May 2011 08:47:13 +0100 Subject: [PATCH] Implement PointText#clone(), untested. --- src/text/PointText.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/text/PointText.js b/src/text/PointText.js index 20fc0560..2eaa315a 100644 --- a/src/text/PointText.js +++ b/src/text/PointText.js @@ -26,8 +26,13 @@ var PointText = this.PointText = TextItem.extend({ }, clone: function() { - // TODO: Implement! - return this.base(); + var copy = this.base(); + copy.content = this.content; + // Change _point without causing notification + copy._point.set(this._point.x, this._point.y, true); + // Use Matrix#initialize to easily copy over values. + copy.matrix.initialize(this.matrix); + return copy; }, getPoint: function() {