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/OvalTool.js | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'js/tools/OvalTool.js') 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; -- cgit v1.2.3 From eae317815e15a7ffc2dd1bd1e39b208eaa02fd2b Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 30 Mar 2012 13:53:47 -0700 Subject: Update PI and Color Panel to reflect default LinearGradient and RadialGradient materials' colors. Signed-off-by: Nivesh Rajbhandari --- js/tools/OvalTool.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/tools/OvalTool.js') diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js index 0ad74aa4..c09c9bc7 100755 --- a/js/tools/OvalTool.js +++ b/js/tools/OvalTool.js @@ -53,12 +53,14 @@ exports.OvalTool = Montage.create(ShapeTool, { { strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); } + strokeColor = this._getMaterialColor(strokeM) || strokeColor; var fillM = this.options.fillMaterial; if(fillM) { fillMaterial = Object.create(MaterialsModel.getMaterial(fillM)); } + fillColor = this._getMaterialColor(fillM) || fillColor; } var world = this.getGLWorld(canvas, this.options.use3D); -- cgit v1.2.3 From 5377e963c4413640cd3c04e0406384df04144568 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 2 Apr 2012 14:52:14 -0700 Subject: Switching to Linear/RadialGradient materials will set the corresponding color. Also, dispatching an addElement event when toggling shape from WebGL/canvas2d so timeline can draw correctly. Signed-off-by: Nivesh Rajbhandari --- js/tools/OvalTool.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/tools/OvalTool.js') diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js index c09c9bc7..e8e88d1d 100755 --- a/js/tools/OvalTool.js +++ b/js/tools/OvalTool.js @@ -53,14 +53,14 @@ exports.OvalTool = Montage.create(ShapeTool, { { strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); } - strokeColor = this._getMaterialColor(strokeM) || strokeColor; + strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; var fillM = this.options.fillMaterial; if(fillM) { fillMaterial = Object.create(MaterialsModel.getMaterial(fillM)); } - fillColor = this._getMaterialColor(fillM) || fillColor; + fillColor = ShapesController.getMaterialColor(fillM) || fillColor; } var world = this.getGLWorld(canvas, this.options.use3D); -- cgit v1.2.3