From 5b4f6b1618cf571a6bce5a631f976a008e04a64e Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 29 Mar 2012 15:52:08 -0700 Subject: Updated shapes to always check for its stroke and fill colors and materials instead of relying on the shapeModel cache because it can get out of sync. Signed-off-by: Nivesh Rajbhandari --- js/tools/LineTool.js | 7 ------- js/tools/OvalTool.js | 13 ------------- js/tools/RectTool.js | 13 ------------- 3 files changed, 33 deletions(-) (limited to 'js/tools') diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js index a61f8f79..dd5a7c72 100755 --- a/js/tools/LineTool.js +++ b/js/tools/LineTool.js @@ -234,13 +234,6 @@ exports.LineTool = Montage.create(ShapeTool, { canvas.elementModel.selection = "Line"; canvas.elementModel.pi = "LinePi"; canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; - canvas.elementModel.shapeModel.stroke = strokeColor; - if(strokeColor) - { - canvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke; - } - - canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; canvas.elementModel.shapeModel.strokeStyle = strokeStyle; diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js index a10e0bb5..0ad74aa4 100755 --- a/js/tools/OvalTool.js +++ b/js/tools/OvalTool.js @@ -78,22 +78,9 @@ exports.OvalTool = Montage.create(ShapeTool, { canvas.elementModel.selection = "Oval"; canvas.elementModel.pi = "OvalPi"; canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; - canvas.elementModel.shapeModel.stroke = strokeColor; - canvas.elementModel.shapeModel.fill = fillColor; - if(strokeColor) - { - canvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke; - } - if(fillColor) - { - canvas.elementModel.shapeModel.background = this.application.ninja.colorController.colorToolbar.fill; - } canvas.elementModel.shapeModel.innerRadius = this.options.innerRadius.value + " " + this.options.innerRadius.units; - canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; - canvas.elementModel.shapeModel.fillMaterial = fillMaterial; - canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; canvas.elementModel.shapeModel.strokeStyle = strokeStyle; diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js index 957afea9..c56e4424 100755 --- a/js/tools/RectTool.js +++ b/js/tools/RectTool.js @@ -98,25 +98,12 @@ exports.RectTool = Montage.create(ShapeTool, { canvas.elementModel.selection = "Rectangle"; canvas.elementModel.pi = "RectanglePi"; canvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; - canvas.elementModel.shapeModel.stroke = strokeColor; - canvas.elementModel.shapeModel.fill = fillColor; - if(strokeColor) - { - canvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke; - } - if(fillColor) - { - canvas.elementModel.shapeModel.background = this.application.ninja.colorController.colorToolbar.fill; - } canvas.elementModel.shapeModel.tlRadius = this.options.TLRadiusControl.value + " " + this.options.TLRadiusControl.units; canvas.elementModel.shapeModel.trRadius = this.options.TRRadiusControl.value + " " + this.options.TRRadiusControl.units; canvas.elementModel.shapeModel.blRadius = this.options.BLRadiusControl.value + " " + this.options.BLRadiusControl.units; canvas.elementModel.shapeModel.brRadius = this.options.BRRadiusControl.value + " " + this.options.BRRadiusControl.units; - canvas.elementModel.shapeModel.strokeMaterial = strokeMaterial; - canvas.elementModel.shapeModel.fillMaterial = fillMaterial; - canvas.elementModel.shapeModel.strokeStyleIndex = strokeStyleIndex; canvas.elementModel.shapeModel.strokeStyle = strokeStyle; -- cgit v1.2.3