aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-04-05 12:12:36 -0700
committerNivesh Rajbhandari2012-04-05 12:12:36 -0700
commit4dc89306c43e86cdac254c81fb9bb3a92eb4a8b9 (patch)
tree9fc9a25696ddaeb1781865ec535b6c65ac985e89 /js
parent1e2e0a8d04e55c0ecfb0b1b674792b69fb091415 (diff)
downloadninja-4dc89306c43e86cdac254c81fb9bb3a92eb4a8b9.tar.gz
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 <mqg734@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/elements/shapes-controller.js9
-rwxr-xr-xjs/document/html-document.js3
-rw-r--r--js/tools/BrushTool.js6
-rwxr-xr-xjs/tools/PenTool.js6
4 files changed, 1 insertions, 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, {
386 value: function(el, isFill) { 386 value: function(el, isFill) {
387 if(isFill) 387 if(isFill)
388 { 388 {
389 if(el.elementModel.shapeModel.GLGeomObj.getFillColor) 389 return this.application.ninja.colorController.colorModel.webGlToColor(el.elementModel.shapeModel.GLGeomObj.getFillColor());
390 {
391 return this.application.ninja.colorController.colorModel.webGlToColor(el.elementModel.shapeModel.GLGeomObj.getFillColor());
392 }
393 else
394 {
395 return null;
396 }
397 } 390 }
398 else 391 else
399 { 392 {
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, {
300 { 300 {
301 shapeModel.GLGeomObj = root; 301 shapeModel.GLGeomObj = root;
302 shapeModel.strokeSize = root._strokeWidth; 302 shapeModel.strokeSize = root._strokeWidth;
303 shapeModel.stroke = root._strokeColor;
304 shapeModel.strokeStyle = "solid"; 303 shapeModel.strokeStyle = "solid";
305 //shapeModel.strokeStyleIndex 304 //shapeModel.strokeStyleIndex
306 switch (root.geomType()) 305 switch (root.geomType())
@@ -308,7 +307,6 @@ exports.HTMLDocument = Montage.create(TextDocument, {
308 case root.GEOM_TYPE_RECTANGLE: 307 case root.GEOM_TYPE_RECTANGLE:
309 elementModel.selection = "Rectangle"; 308 elementModel.selection = "Rectangle";
310 elementModel.pi = "RectanglePi"; 309 elementModel.pi = "RectanglePi";
311 shapeModel.fill = root._fillColor;
312 shapeModel.tlRadius = root._tlRadius; 310 shapeModel.tlRadius = root._tlRadius;
313 shapeModel.trRadius = root._trRadius; 311 shapeModel.trRadius = root._trRadius;
314 shapeModel.blRadius = root._blRadius; 312 shapeModel.blRadius = root._blRadius;
@@ -318,7 +316,6 @@ exports.HTMLDocument = Montage.create(TextDocument, {
318 case root.GEOM_TYPE_CIRCLE: 316 case root.GEOM_TYPE_CIRCLE:
319 elementModel.selection = "Oval"; 317 elementModel.selection = "Oval";
320 elementModel.pi = "OvalPi"; 318 elementModel.pi = "OvalPi";
321 shapeModel.fill = root._fillColor;
322 shapeModel.innerRadius = root._innerRadius; 319 shapeModel.innerRadius = root._innerRadius;
323 break; 320 break;
324 321
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, {
334 newCanvas.elementModel.selection = "BrushStroke"; 334 newCanvas.elementModel.selection = "BrushStroke";
335 newCanvas.elementModel.pi = "BrushStrokePi"; 335 newCanvas.elementModel.pi = "BrushStrokePi";
336 newCanvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; 336 newCanvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units;
337 var strokeColor = this._selectedBrushStroke.getStrokeColor();
338 newCanvas.elementModel.shapeModel.stroke = strokeColor;
339 if(strokeColor) {
340 newCanvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke;
341 }
342 newCanvas.elementModel.shapeModel.strokeMaterial = this._selectedBrushStroke.getStrokeMaterial();
343 337
344 newCanvas.elementModel.shapeModel.GLGeomObj = brushStroke; 338 newCanvas.elementModel.shapeModel.GLGeomObj = brushStroke;
345 newCanvas.elementModel.shapeModel.useWebGl = this.options.use3D; 339 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, {
610 newCanvas.elementModel.selection = "Subpath"; 610 newCanvas.elementModel.selection = "Subpath";
611 newCanvas.elementModel.pi = "SubpathPi"; 611 newCanvas.elementModel.pi = "SubpathPi";
612 newCanvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units; 612 newCanvas.elementModel.shapeModel.strokeSize = this.options.strokeSize.value + " " + this.options.strokeSize.units;
613 var strokeColor = subpath.getStrokeColor();
614 newCanvas.elementModel.shapeModel.stroke = strokeColor;
615 if(strokeColor) {
616 newCanvas.elementModel.shapeModel.border = this.application.ninja.colorController.colorToolbar.stroke;
617 }
618 newCanvas.elementModel.shapeModel.strokeMaterial = subpath.getStrokeMaterial();
619 613
620 newCanvas.elementModel.shapeModel.GLGeomObj = subpath; 614 newCanvas.elementModel.shapeModel.GLGeomObj = subpath;
621 newCanvas.elementModel.shapeModel.useWebGl = this.options.use3D; 615 newCanvas.elementModel.shapeModel.useWebGl = this.options.use3D;