diff options
Diffstat (limited to 'js/tools')
-rwxr-xr-x | js/tools/ShapeTool.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js index b2948fe7..74e692b6 100755 --- a/js/tools/ShapeTool.js +++ b/js/tools/ShapeTool.js | |||
@@ -69,6 +69,7 @@ exports.ShapeTool = Montage.create(DrawingTool, { | |||
69 | drawData.planeMat, drawData.midPt, canvas, true); | 69 | drawData.planeMat, drawData.midPt, canvas, true); |
70 | 70 | ||
71 | canvas.elementModel.isShape = true; | 71 | canvas.elementModel.isShape = true; |
72 | this.application.ninja.elementMediator.addElements(canvas, elementModel.data); | ||
72 | } else { | 73 | } else { |
73 | canvas = this._targetedElement; | 74 | canvas = this._targetedElement; |
74 | if (!canvas.getAttribute( "data-RDGE-id" )) | 75 | if (!canvas.getAttribute( "data-RDGE-id" )) |
@@ -77,8 +78,8 @@ exports.ShapeTool = Montage.create(DrawingTool, { | |||
77 | if(!canvas.elementModel.shapeModel) { | 78 | if(!canvas.elementModel.shapeModel) { |
78 | canvas.elementModel.shapeModel = Montage.create(ShapeModel); | 79 | canvas.elementModel.shapeModel = Montage.create(ShapeModel); |
79 | } | 80 | } |
81 | this.application.ninja.elementMediator.addElements(canvas, canvas.elementModel.data); | ||
80 | } | 82 | } |
81 | this.application.ninja.elementMediator.addElements(canvas, canvas.elementModel.data); | ||
82 | } | 83 | } |
83 | 84 | ||
84 | this.endDraw(event); | 85 | this.endDraw(event); |
@@ -213,7 +214,20 @@ exports.ShapeTool = Montage.create(DrawingTool, { | |||
213 | _useExistingCanvas: { | 214 | _useExistingCanvas: { |
214 | value: function() | 215 | value: function() |
215 | { | 216 | { |
216 | return (this._targetedElement && !ShapesController.isElementAShape(this._targetedElement)); | 217 | var target; |
218 | if (this._targetedElement && (this._targetedElement.nodeName === "CANVAS") && !ShapesController.isElementAShape(this._targetedElement)) | ||
219 | target = this._targetedElement; | ||
220 | else | ||
221 | { | ||
222 | var container = this.application.ninja.currentSelectedContainer; | ||
223 | if (container && (container.nodeName === "CANVAS")) | ||
224 | { | ||
225 | target = container; | ||
226 | this._targetedElement = target; | ||
227 | } | ||
228 | } | ||
229 | |||
230 | return target; | ||
217 | } | 231 | } |
218 | } | 232 | } |
219 | 233 | ||