diff options
Diffstat (limited to 'js/tools')
-rw-r--r-- | js/tools/BrushTool.js | 2 | ||||
-rwxr-xr-x | js/tools/LineTool.js | 2 | ||||
-rwxr-xr-x | js/tools/OvalTool.js | 2 | ||||
-rwxr-xr-x | js/tools/PanTool.js | 8 | ||||
-rwxr-xr-x | js/tools/PenTool.js | 44 | ||||
-rwxr-xr-x | js/tools/Rotate3DToolBase.js | 14 | ||||
-rwxr-xr-x | js/tools/TextTool.js | 2 | ||||
-rwxr-xr-x | js/tools/ToolBase.js | 6 | ||||
-rwxr-xr-x | js/tools/Translate3DToolBase.js | 10 | ||||
-rwxr-xr-x | js/tools/TranslateObject3DTool.js | 4 | ||||
-rwxr-xr-x | js/tools/drawing-tool-base.js | 10 | ||||
-rwxr-xr-x | js/tools/drawing-tool.js | 8 | ||||
-rwxr-xr-x | js/tools/modifier-tool-base.js | 22 |
13 files changed, 67 insertions, 67 deletions
diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js index d8a2fde0..8bfec186 100644 --- a/js/tools/BrushTool.js +++ b/js/tools/BrushTool.js | |||
@@ -281,7 +281,7 @@ exports.BrushTool = Montage.create(ShapeTool, { | |||
281 | if (this.options.useCalligraphic){ | 281 | if (this.options.useCalligraphic){ |
282 | useCalligraphic = this.options.useCalligraphic; | 282 | useCalligraphic = this.options.useCalligraphic; |
283 | } | 283 | } |
284 | 284 | ||
285 | var ctx = this.application.ninja.stage.drawingContext;//stageManagerModule.stageManager.drawingContext; | 285 | var ctx = this.application.ninja.stage.drawingContext;//stageManagerModule.stageManager.drawingContext; |
286 | if (ctx === null) | 286 | if (ctx === null) |
287 | throw ("null drawing context in Brushtool::ShowCurrentBrushStrokeOnStage"); | 287 | throw ("null drawing context in Brushtool::ShowCurrentBrushStrokeOnStage"); |
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js index b0681af7..2dbaf593 100755 --- a/js/tools/LineTool.js +++ b/js/tools/LineTool.js | |||
@@ -173,7 +173,7 @@ exports.LineTool = Montage.create(ShapeTool, { | |||
173 | slope, | 173 | slope, |
174 | dx, | 174 | dx, |
175 | dy; | 175 | dy; |
176 | 176 | ||
177 | if (hitRec0 && hitRec1) { | 177 | if (hitRec0 && hitRec1) { |
178 | var p0 = hitRec0.getLocalPoint(), | 178 | var p0 = hitRec0.getLocalPoint(), |
179 | p1 = hitRec1.getLocalPoint(); | 179 | p1 = hitRec1.getLocalPoint(); |
diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js index e6451a75..4c78973d 100755 --- a/js/tools/OvalTool.js +++ b/js/tools/OvalTool.js | |||
@@ -52,7 +52,7 @@ exports.OvalTool = Montage.create(ShapeTool, { | |||
52 | { | 52 | { |
53 | return; | 53 | return; |
54 | } | 54 | } |
55 | 55 | ||
56 | var left = Math.round(midPt[0] - 0.5*w); | 56 | var left = Math.round(midPt[0] - 0.5*w); |
57 | var top = Math.round(midPt[1] - 0.5*h); | 57 | var top = Math.round(midPt[1] - 0.5*h); |
58 | 58 | ||
diff --git a/js/tools/PanTool.js b/js/tools/PanTool.js index 11345ad9..28e4c04d 100755 --- a/js/tools/PanTool.js +++ b/js/tools/PanTool.js | |||
@@ -102,7 +102,7 @@ exports.PanTool = Montage.create(toolBase, | |||
102 | { | 102 | { |
103 | // do one final mouse move to update the scrollbars | 103 | // do one final mouse move to update the scrollbars |
104 | this.mouseUp( event ); | 104 | this.mouseUp( event ); |
105 | 105 | ||
106 | this.application.ninja.stage.clearDrawingCanvas(); | 106 | this.application.ninja.stage.clearDrawingCanvas(); |
107 | this._hasDraw = false; | 107 | this._hasDraw = false; |
108 | this._isDrawing = false; | 108 | this._isDrawing = false; |
@@ -174,7 +174,7 @@ exports.PanTool = Montage.create(toolBase, | |||
174 | this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft += delta; | 174 | this.application.ninja.currentDocument.model.views.design.document.body.scrollLeft += delta; |
175 | 175 | ||
176 | delta *= zoom; | 176 | delta *= zoom; |
177 | 177 | ||
178 | var uc = this.application.ninja.currentDocument.model.documentRoot; | 178 | var uc = this.application.ninja.currentDocument.model.documentRoot; |
179 | var ucMat = viewUtils.getMatrixFromElement(uc); | 179 | var ucMat = viewUtils.getMatrixFromElement(uc); |
180 | var offset = viewUtils.getElementOffset( uc ); | 180 | var offset = viewUtils.getElementOffset( uc ); |
@@ -231,7 +231,7 @@ exports.PanTool = Montage.create(toolBase, | |||
231 | this.doMouseDown( point ); | 231 | this.doMouseDown( point ); |
232 | } | 232 | } |
233 | }, | 233 | }, |
234 | 234 | ||
235 | 235 | ||
236 | doMouseDown: | 236 | doMouseDown: |
237 | { | 237 | { |
@@ -378,7 +378,7 @@ exports.PanTool = Montage.create(toolBase, | |||
378 | 378 | ||
379 | var wPt = MathUtils.transformAndDivideHomogeneousPoint( gPt, this._globalToUCWorld ); | 379 | var wPt = MathUtils.transformAndDivideHomogeneousPoint( gPt, this._globalToUCWorld ); |
380 | var delta = vecUtils.vecSubtract( 3, wPt, this._worldPt ); | 380 | var delta = vecUtils.vecSubtract( 3, wPt, this._worldPt ); |
381 | 381 | ||
382 | if (!this._altKeyDown) | 382 | if (!this._altKeyDown) |
383 | delta[2] = 0; | 383 | delta[2] = 0; |
384 | 384 | ||
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index c22e3bc0..7e07680d 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js | |||
@@ -148,7 +148,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
148 | var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(x,y)); | 148 | var point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(x,y)); |
149 | var pos; | 149 | var pos; |
150 | if (getStageWorld){ | 150 | if (getStageWorld){ |
151 | pos = (snapManager.snap(point.x, point.y, false)).calculateStageWorldPoint(); | 151 | pos = (snapManager.snap(point.x, point.y, false)).calculateStageWorldPoint(); |
152 | } else { | 152 | } else { |
153 | pos = (snapManager.snap(point.x, point.y, false)).getScreenPoint(); | 153 | pos = (snapManager.snap(point.x, point.y, false)).getScreenPoint(); |
154 | } | 154 | } |
@@ -306,7 +306,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
306 | //todo NOTE: this will work on Webkit only...IE has different codes (left: 1, middle: 4, right: 2) | 306 | //todo NOTE: this will work on Webkit only...IE has different codes (left: 1, middle: 4, right: 2) |
307 | return; | 307 | return; |
308 | } | 308 | } |
309 | 309 | ||
310 | //set the drawing flags (see the drawing-tool.js base class) | 310 | //set the drawing flags (see the drawing-tool.js base class) |
311 | if (this._canDraw) { | 311 | if (this._canDraw) { |
312 | this._isDrawing = true; | 312 | this._isDrawing = true; |
@@ -423,7 +423,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
423 | console.log("WARNING picked anchor point with incorrect mode"); | 423 | console.log("WARNING picked anchor point with incorrect mode"); |
424 | break; | 424 | break; |
425 | } | 425 | } |
426 | 426 | ||
427 | } else { | 427 | } else { |
428 | this._selectedSubpath.addAnchor(new AnchorPoint()); | 428 | this._selectedSubpath.addAnchor(new AnchorPoint()); |
429 | var newAnchor = this._selectedSubpath.getAnchor(this._selectedSubpath.getSelectedAnchorIndex()); | 429 | var newAnchor = this._selectedSubpath.getAnchor(this._selectedSubpath.getSelectedAnchorIndex()); |
@@ -568,7 +568,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
568 | //NOTE: this will work on Webkit only...IE has different codes (left: 1, middle: 4, right: 2) | 568 | //NOTE: this will work on Webkit only...IE has different codes (left: 1, middle: 4, right: 2) |
569 | return; | 569 | return; |
570 | } | 570 | } |
571 | 571 | ||
572 | //set the cursor to be the default cursor (depending on whether the selected subpath has any points yet) | 572 | //set the cursor to be the default cursor (depending on whether the selected subpath has any points yet) |
573 | if (this._subtool===this.SUBTOOL_NONE){ | 573 | if (this._subtool===this.SUBTOOL_NONE){ |
574 | if ((this._selectedSubpath && this._selectedSubpath.getNumAnchors()>0 && !this._selectedSubpath.getIsClosed()) | 574 | if ((this._selectedSubpath && this._selectedSubpath.getNumAnchors()>0 && !this._selectedSubpath.getIsClosed()) |
@@ -618,7 +618,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
618 | var selAnchor = this._selectedSubpath.getAnchor(this._selectedSubpath.getSelectedAnchorIndex()); | 618 | var selAnchor = this._selectedSubpath.getAnchor(this._selectedSubpath.getSelectedAnchorIndex()); |
619 | var selAnchorPos = selAnchor.getAllPos(); | 619 | var selAnchorPos = selAnchor.getAllPos(); |
620 | var localTranslation = VecUtils.vecSubtract(3, localMousePos, selAnchorPos[1]); | 620 | var localTranslation = VecUtils.vecSubtract(3, localMousePos, selAnchorPos[1]); |
621 | 621 | ||
622 | if (this._editMode & this.EDIT_ANCHOR) { | 622 | if (this._editMode & this.EDIT_ANCHOR) { |
623 | selAnchor.translateAll(localTranslation[0], localTranslation[1], localTranslation[2]); | 623 | selAnchor.translateAll(localTranslation[0], localTranslation[1], localTranslation[2]); |
624 | } | 624 | } |
@@ -691,7 +691,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
691 | } //if path is not closed | 691 | } //if path is not closed |
692 | } else if (this._subtool === this.SUBTOOL_PENMINUS && selAnchorAndParamAndCode[2] & this._selectedSubpath.SEL_ANCHOR){ | 692 | } else if (this._subtool === this.SUBTOOL_PENMINUS && selAnchorAndParamAndCode[2] & this._selectedSubpath.SEL_ANCHOR){ |
693 | cursor = "url('images/cursors/penCursors/Pen_minus.png') 5 1, default"; | 693 | cursor = "url('images/cursors/penCursors/Pen_minus.png') 5 1, default"; |
694 | } | 694 | } |
695 | this.application.ninja.stage.drawingCanvas.style.cursor = cursor; | 695 | this.application.ninja.stage.drawingCanvas.style.cursor = cursor; |
696 | } else if (selAnchorAndParamAndCode[2] & this._selectedSubpath.SEL_PATH) { | 696 | } else if (selAnchorAndParamAndCode[2] & this._selectedSubpath.SEL_PATH) { |
697 | //change the cursor only if we're not in pen-minus subtool | 697 | //change the cursor only if we're not in pen-minus subtool |
@@ -825,7 +825,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
825 | //TODO this will not work if there are multiple shapes in the same canvas | 825 | //TODO this will not work if there are multiple shapes in the same canvas |
826 | canvas.elementModel.shapeModel.GLGeomObj = subpath; | 826 | canvas.elementModel.shapeModel.GLGeomObj = subpath; |
827 | 827 | ||
828 | if(canvas.elementModel.isShape) | 828 | if(canvas.elementModel.isShape) |
829 | { | 829 | { |
830 | this._doesSelectionChangeNeedHandling = false; //this will ignore the selection change event triggered by the canvas | 830 | this._doesSelectionChangeNeedHandling = false; //this will ignore the selection change event triggered by the canvas |
831 | this.application.ninja.selectionController.selectElement(canvas); | 831 | this.application.ninja.selectionController.selectElement(canvas); |
@@ -841,7 +841,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
841 | // Check if the selected anchor point of the selected subpath should be snapped to another anchor point | 841 | // Check if the selected anchor point of the selected subpath should be snapped to another anchor point |
842 | // (also sets open subpaths closed if appropriate) | 842 | // (also sets open subpaths closed if appropriate) |
843 | // IF the selected subpath does not have a canvas | 843 | // IF the selected subpath does not have a canvas |
844 | // | 844 | // |
845 | // Draw the selected subpath anchors and the selected subpath itself in the stage's context | 845 | // Draw the selected subpath anchors and the selected subpath itself in the stage's context |
846 | // ********************************************************************************************************** | 846 | // ********************************************************************************************************** |
847 | HandleLeftButtonUp: { | 847 | HandleLeftButtonUp: { |
@@ -851,7 +851,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
851 | if (this._subtool===this.SUBTOOL_PENMINUS){ | 851 | if (this._subtool===this.SUBTOOL_PENMINUS){ |
852 | return; | 852 | return; |
853 | } | 853 | } |
854 | 854 | ||
855 | // ******************** snapping *********************** | 855 | // ******************** snapping *********************** |
856 | // if there was a snapTarget and a selected anchor, move the anchor to the snap target | 856 | // if there was a snapTarget and a selected anchor, move the anchor to the snap target |
857 | if (this._snapTargetIndex !== -1 && this._selectedSubpath && this._selectedSubpath.getSelectedAnchorIndex() !== -1) { | 857 | if (this._snapTargetIndex !== -1 && this._selectedSubpath && this._selectedSubpath.getSelectedAnchorIndex() !== -1) { |
@@ -903,7 +903,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
903 | //if (this._selectedSubpath && this._selectedSubpath.getIsClosed() && this._entryEditMode !== this.ENTRY_SELECT_PATH){ | 903 | //if (this._selectedSubpath && this._selectedSubpath.getIsClosed() && this._entryEditMode !== this.ENTRY_SELECT_PATH){ |
904 | // this._selectedSubpath = null; | 904 | // this._selectedSubpath = null; |
905 | //} | 905 | //} |
906 | 906 | ||
907 | if (this._selectedSubpath){ | 907 | if (this._selectedSubpath){ |
908 | this.DrawSubpathAnchors(this._selectedSubpath);//render the subpath anchors on canvas | 908 | this.DrawSubpathAnchors(this._selectedSubpath);//render the subpath anchors on canvas |
909 | }else{ | 909 | }else{ |
@@ -937,7 +937,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
937 | return;//nothing to do | 937 | return;//nothing to do |
938 | } | 938 | } |
939 | this._selectedSubpath.makeDirty(); | 939 | this._selectedSubpath.makeDirty(); |
940 | 940 | ||
941 | var bboxMin=null, bboxMax=null; | 941 | var bboxMin=null, bboxMax=null; |
942 | if (this._selectedSubpathCanvas) { |