From 4648e2eda9aa8c8f9b0aed4d12fef8b1d00f1769 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 19 Jul 2012 16:26:03 -0700 Subject: IKNINJA-1780 - [Shape] Error when opening document that contains a shape with gradient color or no color. Signed-off-by: Nivesh Rajbhandari --- js/lib/geom/geom-obj.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'js/lib/geom/geom-obj.js') diff --git a/js/lib/geom/geom-obj.js b/js/lib/geom/geom-obj.js index 3cd3a89b..dd60cdec 100755 --- a/js/lib/geom/geom-obj.js +++ b/js/lib/geom/geom-obj.js @@ -205,6 +205,26 @@ exports.GeomObj = Object.create(Object.prototype, { /////////////////////////////////////////////////////////////////////// // Methods /////////////////////////////////////////////////////////////////////// + initColors: { + value: function() { + if(this._strokeColor && this._strokeMaterial) { + if(this._strokeMaterial.hasProperty("color")) { + this._strokeMaterial.setProperty( "color", this._strokeColor ); + } else if (this._strokeMaterial && (this._strokeMaterial.gradientType === this._strokeColor.gradientMode)) { + this._strokeMaterial.setGradientData(this._strokeColor.color); + } + } + + if(this._fillColor && this._fillMaterial) { + if(this._fillMaterial.hasProperty("color")) { + this._fillMaterial.setProperty( "color", this._fillColor ); + } else if (this._fillMaterial && (this._fillMaterial.gradientType === this._fillColor.gradientMode)) { + this._fillMaterial.setGradientData(this._fillColor.color); + } + } + } + }, + setMaterialColor: { value: function(c, type) { var i = 0, -- cgit v1.2.3