diff options
Diffstat (limited to 'js/tools')
-rw-r--r-- | js/tools/BrushTool.js | 3 | ||||
-rwxr-xr-x | js/tools/EyedropperTool.js | 2 | ||||
-rwxr-xr-x | js/tools/FillTool.js | 2 | ||||
-rwxr-xr-x | js/tools/InkBottleTool.js | 24 | ||||
-rwxr-xr-x | js/tools/ShapeTool.js | 2 | ||||
-rwxr-xr-x | js/tools/ToolBase.js | 16 | ||||
-rwxr-xr-x | js/tools/TranslateObject3DTool.js | 2 | ||||
-rwxr-xr-x | js/tools/modifier-tool-base.js | 2 |
8 files changed, 32 insertions, 21 deletions
diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js index 4e13bd43..ded56ecc 100644 --- a/js/tools/BrushTool.js +++ b/js/tools/BrushTool.js | |||
@@ -417,6 +417,9 @@ exports.BrushTool = Montage.create(ShapeTool, { | |||
417 | // TODO - update the shape's info only. shapeModel will likely need an array of shapes. | 417 | // TODO - update the shape's info only. shapeModel will likely need an array of shapes. |
418 | } | 418 | } |
419 | 419 | ||
420 | //now send the event that will add this canvas to the timeline | ||
421 | NJevent("elementAdded", newCanvas); | ||
422 | |||
420 | //if(newCanvas.elementModel.isShape) | 423 | //if(newCanvas.elementModel.isShape) |
421 | if (true) | 424 | if (true) |
422 | { | 425 | { |
diff --git a/js/tools/EyedropperTool.js b/js/tools/EyedropperTool.js index d627f03b..346975b2 100755 --- a/js/tools/EyedropperTool.js +++ b/js/tools/EyedropperTool.js | |||
@@ -104,7 +104,7 @@ exports.EyedropperTool = Montage.create(toolBase, { | |||
104 | value : function (event) { | 104 | value : function (event) { |
105 | var c, | 105 | var c, |
106 | color, | 106 | color, |
107 | obj = this.application.ninja.stage.GetElement(event); | 107 | obj = this.application.ninja.stage.getElement(event); |
108 | if (obj) | 108 | if (obj) |
109 | { | 109 | { |
110 | if(this.application.ninja.currentDocument.inExclusion(obj) !== -1) | 110 | if(this.application.ninja.currentDocument.inExclusion(obj) !== -1) |
diff --git a/js/tools/FillTool.js b/js/tools/FillTool.js index 746f20cf..87a093ff 100755 --- a/js/tools/FillTool.js +++ b/js/tools/FillTool.js | |||
@@ -22,7 +22,7 @@ exports.FillTool = Montage.create(ModifierToolBase, { | |||
22 | HandleMouseMove: { | 22 | HandleMouseMove: { |
23 | value : function (event) | 23 | value : function (event) |
24 | { | 24 | { |
25 | var obj = this.application.ninja.stage.GetSelectableElement(event); | 25 | var obj = this.application.ninja.stage.getElement(event, true); |
26 | var cursor = "url('images/cursors/fill.png') 14 14, default"; | 26 | var cursor = "url('images/cursors/fill.png') 14 14, default"; |
27 | var canColor = true; | 27 | var canColor = true; |
28 | if (obj) | 28 | if (obj) |
diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js index 95c2e71d..fd17f4d6 100755 --- a/js/tools/InkBottleTool.js +++ b/js/tools/InkBottleTool.js | |||
@@ -16,7 +16,7 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, { | |||
16 | HandleMouseMove: { | 16 | HandleMouseMove: { |
17 | value : function (event) | 17 | value : function (event) |
18 | { | 18 | { |
19 | var obj = this.application.ninja.stage.GetSelectableElement(event); | 19 | var obj = this.application.ninja.stage.getElement(event, true); |
20 | var cursor = "url('images/cursors/ink.png') 6 11, default"; | 20 | var cursor = "url('images/cursors/ink.png') 6 11, default"; |
21 | var canColor = true; | 21 | var canColor = true; |
22 | if (obj) | 22 | if (obj) |
@@ -84,14 +84,22 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, { | |||
84 | }; | 84 | }; |
85 | } | 85 | } |
86 | 86 | ||
87 | colorInfo.borderInfo = { borderStyle:this.options._borderStyle.value, | 87 | if(this.options.useBorderWidth.checked || this.options.useBorderStyle.checked) { |
88 | borderWidth:this.options._borderWidth.value, | 88 | colorInfo.borderInfo = {}; |
89 | borderUnits:this.options._borderWidth.units | 89 | if(this.options.useBorderWidth.checked) { |
90 | }; | 90 | colorInfo.borderInfo.borderWidth = this.options._borderWidth.value; |
91 | colorInfo.borderInfo.borderUnits = this.options._borderWidth.units; | ||
92 | } | ||
93 | if(this.options.useBorderStyle.checked) { | ||
94 | colorInfo.borderInfo.borderStyle = this.options._borderStyle.value; | ||
95 | } | ||
96 | } | ||
91 | 97 | ||
92 | colorInfo.strokeInfo = { strokeSize:this.options._strokeSize.value, | 98 | if(this.options.useStrokeSize.checked) { |
93 | strokeUnits:this.options._strokeSize.units | 99 | colorInfo.strokeInfo = {}; |
94 | }; | 100 | colorInfo.strokeInfo.strokeSize = this.options._strokeSize.value; |
101 | colorInfo.strokeInfo.strokeUnits = this.options._strokeSize.units; | ||
102 | } | ||
95 | 103 | ||
96 | ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, false, "Change", "inkBottleTool"); | 104 | ElementsMediator.setColor(this.application.ninja.selectedElements, colorInfo, false, "Change", "inkBottleTool"); |
97 | } | 105 | } |
diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js index f3b5e92d..21a5a025 100755 --- a/js/tools/ShapeTool.js +++ b/js/tools/ShapeTool.js | |||
@@ -138,7 +138,7 @@ exports.ShapeTool = Montage.create(DrawingTool, { | |||
138 | _showFeedbackOnMouseMove: { | 138 | _showFeedbackOnMouseMove: { |
139 | value: function (event) { | 139 | value: function (event) { |
140 | // TODO - This call is causing the canvas to redraw 3 times per mouse move | 140 | // TODO - This call is causing the canvas to redraw 3 times per mouse move |
141 | var targetedObject = this.application.ninja.stage.GetSelectableElement(event); | 141 | var targetedObject = this.application.ninja.stage.getElement(event, true); |
142 | 142 | ||
143 | if (targetedObject) { | 143 | if (targetedObject) { |
144 | if((targetedObject.nodeName === "CANVAS") && !ShapesController.isElementAShape(targetedObject)) | 144 | if((targetedObject.nodeName === "CANVAS") && !ShapesController.isElementAShape(targetedObject)) |
diff --git a/js/tools/ToolBase.js b/js/tools/ToolBase.js index 678d03ac..f43b1b58 100755 --- a/js/tools/ToolBase.js +++ b/js/tools/ToolBase.js | |||
@@ -89,9 +89,9 @@ exports.toolBase = Montage.create(Component, { | |||
89 | 89 | ||
90 | if(this._canOperateOnStage) { | 90 | if(this._canOperateOnStage) { |
91 | if(event.shiftKey) { | 91 | if(event.shiftKey) { |
92 | this.application.ninja.selectionController.shiftSelectElement(this.application.ninja.stage.GetElement(event)); | 92 | this.application.ninja.selectionController.shiftSelectElement(this.application.ninja.stage.getElement(event)); |
93 | } else { | 93 | } else { |
94 | this.application.ninja.selectionController.selectElement(this.application.ninja.stage.GetElement(event)); | 94 | this.application.ninja.selectionController.selectElement(this.application.ninja.stage.getElement(event)); |
95 | } | 95 | } |
96 | } | 96 | } |
97 | 97 | ||
@@ -109,13 +109,13 @@ exports.toolBase = Montage.create(Component, { | |||
109 | value:function(event){ | 109 | value:function(event){ |
110 | var upperBoundary ,previousZoomValue; | 110 | var upperBoundary ,previousZoomValue; |
111 | 111 | ||
112 | previousZoomValue = this.application.Ninja._documentBarRef.zoomFactor ; | 112 | previousZoomValue = this.application.ninja.documentBar.zoomFactor; |
113 | upperBoundary = previousZoomValue *1.2 ; | 113 | upperBoundary = previousZoomValue *1.2 ; |
114 | 114 | ||
115 | if(upperBoundary > 2000) | 115 | if(upperBoundary > 2000) |
116 | this.application.Ninja._documentBarRef.zoomFactor = 2000; | 116 | this.application.ninja.documentBar.zoomFactor = 2000; |
117 | else | 117 | else |
118 | this.application.Ninja._documentBarRef.zoomFactor*= 1.2; | 118 | this.application.ninja.documentBar.zoomFactor*= 1.2; |
119 | 119 | ||
120 | } | 120 | } |
121 | }, | 121 | }, |
@@ -124,13 +124,13 @@ exports.toolBase = Montage.create(Component, { | |||
124 | value:function(){ | 124 | value:function(){ |
125 | var lowerBoundary ,previousZoomValue; | 125 | var lowerBoundary ,previousZoomValue; |
126 | 126 | ||
127 | previousZoomValue = this.application.Ninja._documentBarRef.zoomFactor ; | 127 | previousZoomValue = this.application.ninja.documentBar.zoomFactor ; |
128 | lowerBoundary = previousZoomValue/1.2 ; | 128 | lowerBoundary = previousZoomValue/1.2 ; |
129 | 129 | ||
130 | if(lowerBoundary < 25) | 130 | if(lowerBoundary < 25) |
131 | this.application.Ninja._documentBarRef.zoomFactor = 25; | 131 | this.application.ninja.documentBar.zoomFactor = 25; |
132 | else | 132 | else |
133 | this.application.Ninja._documentBarRef.zoomFactor/= 1.2; | 133 | this.application.ninja.documentBar.zoomFactor/= 1.2; |
134 | } | 134 | } |
135 | }, | 135 | }, |
136 | 136 | ||
diff --git a/js/tools/TranslateObject3DTool.js b/js/tools/TranslateObject3DTool.js index 72a55322..b4f55bd9 100755 --- a/js/tools/TranslateObject3DTool.js +++ b/js/tools/TranslateObject3DTool.js | |||
@@ -83,7 +83,7 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, { | |||
83 | // Check that hitRec's element matches element that browser says we clicked on | 83 | // Check that hitRec's element matches element that browser says we clicked on |
84 | // TODO - This is still not working when using a handle that is on top of an | 84 | // TODO - This is still not working when using a handle that is on top of an |
85 | // element that is not currently selected | 85 | // element that is not currently selected |
86 | var elt = this.application.ninja.stage.GetSelectableElement(event); | 86 | var elt = this.application.ninja.stage.getElement(event, true); |
87 | if(elt && (elt !== hitRec.getElement())) | 87 | if(elt && (elt !== hitRec.getElement())) |
88 | { | 88 | { |
89 | hitRec = snapManager.findHitRecordForElement(elt); | 89 | hitRec = snapManager.findHitRecordForElement(elt); |
diff --git a/js/tools/modifier-tool-base.js b/js/tools/modifier-tool-base.js index 2e006c35..d023206a 100755 --- a/js/tools/modifier-tool-base.js +++ b/js/tools/modifier-tool-base.js | |||
@@ -134,7 +134,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { | |||
134 | var hitRec = snapManager.snap(point.x, point.y, do3DSnap); | 134 | var hitRec = snapManager.snap(point.x, point.y, do3DSnap); |
135 | 135 | ||
136 | // TODO - Check that hitRec's element matches element that browser says we clicked on | 136 | // TODO - Check that hitRec's element matches element that browser says we clicked on |
137 | var elt = this.application.ninja.stage.GetSelectableElement(event); | 137 | var elt = this.application.ninja.stage.getElement(event, true); |
138 | if(elt !== hitRec.getElement()) | 138 | if(elt !== hitRec.getElement()) |
139 | { | 139 | { |
140 | hitRec = snapManager.findHitRecordForElement(elt); | 140 | hitRec = snapManager.findHitRecordForElement(elt); |