aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-18 00:41:31 -0700
committerValerio Virgillito2012-05-18 00:41:31 -0700
commit084bb924bc3c3a6ad1e2e21099399bba4d473fed (patch)
treedea3f338962945f4a695ca8926d0f3bf75676557
parent7a94696e19b14e15261df516e2ba75e693b1313d (diff)
downloadninja-084bb924bc3c3a6ad1e2e21099399bba4d473fed.tar.gz
fixing some snapping bugs
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
-rwxr-xr-xjs/helper-classes/3D/snap-manager.js7
-rwxr-xr-xjs/ninja.reel/ninja.js15
-rwxr-xr-xjs/stage/stage-deps.js5
3 files changed, 23 insertions, 4 deletions
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js
index 7194524e..e22ac3ad 100755
--- a/js/helper-classes/3D/snap-manager.js
+++ b/js/helper-classes/3D/snap-manager.js
@@ -456,6 +456,13 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
456 } 456 }
457 }, 457 },
458 458
459 reload2DCache: {
460 value: function() {
461 this.clear2DCache();
462 this.load2DCache(workingPlane);
463 }
464 },
465
459 clear2DCache : { 466 clear2DCache : {
460 value : function() { 467 value : function() {
461 // clear the 2D cache flags in the objects 468 // clear the 2D cache flags in the objects
diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js
index ba87e2d5..067a005f 100755
--- a/js/ninja.reel/ninja.js
+++ b/js/ninja.reel/ninja.js
@@ -134,10 +134,21 @@ exports.Ninja = Montage.create(Component, {
134 value: [] 134 value: []
135 }, 135 },
136 136
137 currentSelectedContainer: { 137 _currentSelectedContainer: {
138 value: null 138 value: null
139 }, 139 },
140 140
141 currentSelectedContainer: {
142 get: function() {
143 return this._currentSelectedContainer;
144 },
145 set: function(value) {
146 if(value !== this._currentSelectedContainer) {
147 this._currentSelectedContainer = value;
148 }
149 }
150 },
151
141 templateDidLoad: { 152 templateDidLoad: {
142 value: function() { 153 value: function() {
143 this.ninjaVersion = window.ninjaVersion.ninja.version; 154 this.ninjaVersion = window.ninjaVersion.ninja.version;
@@ -285,7 +296,7 @@ exports.Ninja = Montage.create(Component, {
285 this.currentDocument = this.documentController.activeDocument; 296 this.currentDocument = this.documentController.activeDocument;
286 297
287 if(this.currentDocument.documentRoot) { 298 if(this.currentDocument.documentRoot) {
288 this.application.ninja.currentSelectedContainer = this.currentDocument.documentRoot; 299 this._currentSelectedContainer = this.selectionController._currentSelectedContainer = this.currentDocument.documentRoot;
289 } 300 }
290 } 301 }
291 }, 302 },
diff --git a/js/stage/stage-deps.js b/js/stage/stage-deps.js
index 84f04249..0d53696b 100755
--- a/js/stage/stage-deps.js
+++ b/js/stage/stage-deps.js
@@ -105,7 +105,7 @@ exports.StageDeps = Montage.create(Component, {
105 105
106 workingPlane = [0,0,1,0]; 106 workingPlane = [0,0,1,0];
107 107
108 snapManager._isCacheInvalid = true; 108 snapManager.reload2DCache();
109 snapManager.setupDragPlaneFromPlane (workingPlane); 109 snapManager.setupDragPlaneFromPlane (workingPlane);
110 110
111 drawUtils.initializeFromDocument(); 111 drawUtils.initializeFromDocument();
@@ -116,8 +116,9 @@ exports.StageDeps = Montage.create(Component, {
116 value: function(){ 116 value: function(){
117 workingPlane = [0,0,1,0]; 117 workingPlane = [0,0,1,0];
118 118
119 snapManager._isCacheInvalid = true;
120 snapManager.setupDragPlaneFromPlane (workingPlane); 119 snapManager.setupDragPlaneFromPlane (workingPlane);
120 snapManager.reload2DCache();
121
121 122
122 drawUtils.initializeFromDocument(); 123 drawUtils.initializeFromDocument();
123 } 124 }