aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/stage/stage.reel/stage.js4
-rwxr-xr-xjs/tools/ShapeTool.js34
2 files changed, 3 insertions, 35 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js
index 7ac64976..7c2fa903 100755
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -894,7 +894,9 @@ exports.Stage = Montage.create(Component, {
894 point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(position.pageX - docView.iframe.contentWindow.pageXOffset + this.documentOffsetLeft, position.pageY - docView.iframe.contentWindow.pageYOffset + this.documentOffsetTop)); 894 point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(position.pageX - docView.iframe.contentWindow.pageXOffset + this.documentOffsetLeft, position.pageY - docView.iframe.contentWindow.pageYOffset + this.documentOffsetTop));
895 element = this.currentDocument.model.views.design.getElementFromPoint(point.x - this.userContentLeft,point.y - this.userContentTop); 895 element = this.currentDocument.model.views.design.getElementFromPoint(point.x - this.userContentLeft,point.y - this.userContentTop);
896 896
897// if(!element) debugger; 897 if(!element) {
898 return this.currentDocument.model.domContainer;
899 }
898 // workaround Chrome 3d bug 900 // workaround Chrome 3d bug
899 if(this.application.ninja.toolsData.selectedToolInstance._canSnap && this.currentDocument.inExclusion(element) !== -1) { 901 if(this.application.ninja.toolsData.selectedToolInstance._canSnap && this.currentDocument.inExclusion(element) !== -1) {
900 point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(position.pageX, position.pageY)); 902 point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(position.pageX, position.pageY));
diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js
index 26ed9c6f..ecc0dca3 100755
--- a/js/tools/ShapeTool.js
+++ b/js/tools/ShapeTool.js
@@ -70,7 +70,6 @@ exports.ShapeTool = Montage.create(DrawingTool, {
70 this.doDraw(event); 70 this.doDraw(event);
71 } else { 71 } else {
72 this.doSnap(event); 72 this.doSnap(event);
73 this._showFeedbackOnMouseMove(event);
74 } 73 }
75 74
76 this.drawLastSnap(); // Required cleanup for both Draw/Feedbacks 75 this.drawLastSnap(); // Required cleanup for both Draw/Feedbacks
@@ -159,39 +158,6 @@ exports.ShapeTool = Montage.create(DrawingTool, {
159 } 158 }
160 }, 159 },
161 160
162 /** Show a border when mousing
163 * over existing canvas elements to signal to the user that
164 * the drawing operation will act on the targeted canvas.
165 **/
166 _showFeedbackOnMouseMove: {
167 value: function (event) {
168 // TODO - This call is causing the canvas to redraw 3 times per mouse move
169 var targetedObject = this.application.ninja.stage.getElement(event, true);
170
171 if (targetedObject) {
172 if((targetedObject.nodeName === "CANVAS") && !ShapesController.isElementAShape(targetedObject))
173 {
174 if (targetedObject !== this._targetedElement) {
175 if(this._targetedElement)
176 {
177 this._targetedElement.classList.remove("active-element-outline");
178 }
179 this._targetedElement = targetedObject;
180 this._targetedElement.classList.add("active-element-outline");
181 }
182 }
183 else if (this._targetedElement) {
184 this._targetedElement.classList.remove("active-element-outline");
185 this._targetedElement = null;
186 }
187 }
188 else if (this._targetedElement) {
189 this._targetedElement.classList.remove("elem-red-outline");
190 this._targetedElement = null;
191 }
192 }
193 },
194
195 RenderShape: 161 RenderShape:
196 { 162 {
197 value: function (w, h, planeMat, midPt) 163 value: function (w, h, planeMat, midPt)