From 4dc89306c43e86cdac254c81fb9bb3a92eb4a8b9 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 5 Apr 2012 12:12:36 -0700 Subject: Removing fill, stroke, fillMaterial and strokeMaterial from the shapeModel cache because they can easily get out of sync with the actual colors and materials. Instead, we will always query the object for these values. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/shapes-controller.js | 9 +-------- js/document/html-document.js | 3 --- js/tools/BrushTool.js | 6 ------ js/tools/PenTool.js | 6 ------ 4 files changed, 1 insertion(+), 23 deletions(-) diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index b97d04b0..d1bc1fb7 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -386,14 +386,7 @@ exports.ShapesController = Montage.create(CanvasController, { value: function(el, isFill) { if(isFill) { - if(el.elementModel.shapeModel.GLGeomObj.getFillColor) - { - return this.application.ninja.colorController.colorModel.webGlToColor(el.elementModel.shapeModel.GLGeomObj.getFillColor()); - } - else - { - return null; - } + return this.application.ninja.colorController.colorModel.webGlToColor(el.elementModel.shapeModel.GLGeomObj.getFillColor()); } else { diff --git a/js/document/html-document.js b/js/document/html-document.js index 6324d5ed..2531465d 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -300,7 +300,6 @@ exports.HTMLDocument = Montage.create(TextDocument, { { shapeModel.GLGeomObj = root; shapeModel.strokeSize = root._strokeWidth; - shapeModel.stroke = root._strokeColor; shapeModel.strokeStyle = "solid"; //shapeModel.strokeStyleIndex switch (root.geomType()) @@ -308,7 +307,6 @@ exports.HTMLDocument = Montage.create(TextDocument, { case root.GEOM_TYPE_RECTANGLE: elementModel.selection = "Rectangle"; elementModel.pi = "RectanglePi"; - shapeModel.fill = root._fillColor; shapeModel.tlRadius = root._tlRadius; shapeModel.trRadius = root._trRadius; shapeModel.blRadius = root._blRadius; @@ -318,7 +316,6 @@ exports.HTMLDocument = Montage.create(TextDocument, { case root.GEOM_TYPE_CIRCLE: elementModel.selection = "Oval"; elementModel.pi = "OvalPi"; - shapeModel.fill = root._fillColor; shapeModel.innerRadius = root._innerRadius; break; diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js index d71cc743..1365896a 100644 --- a/js/tools/BrushTool.js +++ b/js/tools/BrushTool.js @@ -334,12 +334,6 @@ exports.BrushTool = Montage.create(ShapeTool, { newCanvas.elementModel.selection = "BrushStroke"; newCanvas.elementModel.pi = "BrushStrokePi"; newCanvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; - var strokeColor = this._selectedBrushStroke.getStrokeColor(); - newCanvas.elementModel.shapeModel.stroke = strokeColor; - if(strokeColor) { - newCanvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke; - } - newCanvas.elementModel.shapeModel.strokeMaterial = this._selectedBrushStroke.getStrokeMaterial(); newCanvas.elementModel.shapeModel.GLGeomObj = brushStroke; newCanvas.elementModel.shapeModel.useWebGl = this.options.use3D; diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index aa14ea75..7f6f190a 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js @@ -610,12 +610,6 @@ exports.PenTool = Montage.create(ShapeTool, { newCanvas.elementModel.selection = "Subpath"; newCanvas.elementModel.pi = "SubpathPi"; newCanvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; - var strokeColor = subpath.getStrokeColor(); - newCanvas.elementModel.shapeModel.stroke = strokeColor; - if(strokeColor) { - newCanvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke; - } - newCanvas.elementModel.shapeModel.strokeMaterial = subpath.getStrokeMaterial(); newCanvas.elementModel.shapeModel.GLGeomObj = subpath; newCanvas.elementModel.shapeModel.useWebGl = this.options.use3D; -- cgit v1.2.3