From f91e64235eb03c889ff4f5577c3e3480cd0d787f Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 13 Apr 2012 00:30:19 -0700 Subject: removing _undo array and _targets array and use object instead of matching arrays to set properties Signed-off-by: Valerio Virgillito --- js/tools/TranslateObject3DTool.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'js/tools/TranslateObject3DTool.js') diff --git a/js/tools/TranslateObject3DTool.js b/js/tools/TranslateObject3DTool.js index 8edf1fee..74df6c14 100755 --- a/js/tools/TranslateObject3DTool.js +++ b/js/tools/TranslateObject3DTool.js @@ -65,10 +65,8 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, { } } - if(this._targets) - { - var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, - new WebKitPoint(event.pageX, event.pageY)); + if(this.application.ninja.selectedElements.length) { + var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(event.pageX, event.pageY)); // do the snap before setting up the avoid list to allow // a snap on the mouse down @@ -96,11 +94,10 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, { } // we don't want to snap to selected objects during the drag - var len = this._targets.length; - for(var i=0; i