diff options
Diffstat (limited to 'js/lib/geom/rectangle.js')
-rwxr-xr-x | js/lib/geom/rectangle.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/js/lib/geom/rectangle.js b/js/lib/geom/rectangle.js index 0d302d50..6a6ede4d 100755 --- a/js/lib/geom/rectangle.js +++ b/js/lib/geom/rectangle.js | |||
@@ -101,15 +101,28 @@ exports.Rectangle = Object.create(GeomObj, { | |||
101 | } else { | 101 | } else { |
102 | this._strokeMaterial = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ).dup(); | 102 | this._strokeMaterial = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ).dup(); |
103 | } | 103 | } |
104 | if (strokeColor && this._strokeMaterial.hasProperty( "color" )) this._strokeMaterial.setProperty( "color", this._strokeColor ); | ||
105 | 104 | ||
105 | if(strokeColor) { | ||
106 | if(this._strokeMaterial.hasProperty("color")) { | ||
107 | this._strokeMaterial.setProperty( "color", this._strokeColor ); | ||
108 | } else if (this._strokeMaterial && (this._strokeMaterial.gradientType === this._strokeColor.gradientMode)) { | ||
109 | this._strokeMaterial.setGradientData(this._strokeColor.color); | ||
110 | } | ||
111 | } | ||
106 | 112 | ||
107 | if(fillMaterial) { | 113 | if(fillMaterial) { |
108 | this._fillMaterial = fillMaterial.dup(); | 114 | this._fillMaterial = fillMaterial.dup(); |
109 | } else { | 115 | } else { |
110 | this._fillMaterial = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ).dup(); | 116 | this._fillMaterial = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ).dup(); |
111 | } | 117 | } |
112 | if (fillColor && this._fillMaterial.hasProperty( "color" )) this._fillMaterial.setProperty( "color", this._fillColor ); | 118 | |
119 | if(fillColor) { | ||
120 | if(this._fillMaterial.hasProperty("color")) { | ||
121 | this._fillMaterial.setProperty( "color", this._fillColor ); | ||
122 | } else if (this._fillMaterial && (this._fillMaterial.gradientType === this._fillColor.gradientMode)) { | ||
123 | this._fillMaterial.setGradientData(this._fillColor.color); | ||
124 | } | ||
125 | } | ||
113 | } | 126 | } |
114 | }, | 127 | }, |
115 | 128 | ||