aboutsummaryrefslogtreecommitdiff
path: root/js/tools
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-29 12:12:11 -0800
committerValerio Virgillito2012-02-29 12:12:11 -0800
commit2b9f63089534356607ad7e0ddde6f22e42d04f80 (patch)
tree49b07dfb52252ac986c567ad5c3a7c39ebcc86e2 /js/tools
parent98d491f7e57ff5a9b091e332d7d1e81061e39efa (diff)
parenta89e30ab834a48be32b6122e0c8ac1e0c3ed43e8 (diff)
downloadninja-2b9f63089534356607ad7e0ddde6f22e42d04f80.tar.gz
Merge pull request #88 from mqg734/ToolFixes
Fix for performance issue when moving shapes.
Diffstat (limited to 'js/tools')
-rwxr-xr-xjs/tools/SelectionTool.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js
index 83d52d52..caa9e8d6 100755
--- a/js/tools/SelectionTool.js
+++ b/js/tools/SelectionTool.js
@@ -312,12 +312,26 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
312 } 312 }
313 if(addToUndoStack) 313 if(addToUndoStack)
314 { 314 {
315 ElementsMediator.setProperties(this.application.ninja.selectedElements, 315 // if we have a delta, that means the transform handles were used and
316 // we should update the width and height too. Otherwise, just update left and top.
317 if(this._delta)
318 {
319 ElementsMediator.setProperties(this.application.ninja.selectedElements,
316 { "left": newLeft, "top": newTop, "width": newWidth, "height": newHeight }, 320 { "left": newLeft, "top": newTop, "width": newWidth, "height": newHeight },
317 "Change", 321 "Change",
318 "selectionTool", 322 "selectionTool",
319 { "left" : previousLeft, "top" : previousTop, "width": previousWidth, "height": previousHeight} 323 { "left" : previousLeft, "top" : previousTop, "width": previousWidth, "height": previousHeight}
320 ); 324 );
325 }
326 else
327 {
328 ElementsMediator.setProperties(this.application.ninja.selectedElements,
329 { "left": newLeft, "top": newTop },
330 "Change",
331 "selectionTool",
332 { "left" : previousLeft, "top" : previousTop }
333 );
334 }
321 } 335 }
322 // Save previous value for undo/redo 336 // Save previous value for undo/redo
323 this._undoArray = []; 337 this._undoArray = [];