aboutsummaryrefslogtreecommitdiff
path: root/js/tools
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-02-29 11:58:28 -0800
committerNivesh Rajbhandari2012-02-29 11:58:28 -0800
commita89e30ab834a48be32b6122e0c8ac1e0c3ed43e8 (patch)
treeca0b67572b59ef24adc53c8b17b6efac6a5c7870 /js/tools
parenteb27ed35bf282262843de13b00af89a2bceac53f (diff)
downloadninja-a89e30ab834a48be32b6122e0c8ac1e0c3ed43e8.tar.gz
Fix for performance issue when moving shapes. We don't need to call render except if the geometry and materials change.
This is more easy to see with shapes like the brush tool. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
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 = [];