aboutsummaryrefslogtreecommitdiff
path: root/js/lib/geom/rectangle.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/geom/rectangle.js')
-rwxr-xr-xjs/lib/geom/rectangle.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/js/lib/geom/rectangle.js b/js/lib/geom/rectangle.js
index 81a8556d..3e4c469a 100755
--- a/js/lib/geom/rectangle.js
+++ b/js/lib/geom/rectangle.js
@@ -77,15 +77,28 @@ exports.Rectangle = Object.create(GeomObj, {
77 } else { 77 } else {
78 this._strokeMaterial = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ).dup(); 78 this._strokeMaterial = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ).dup();
79 } 79 }
80 if (strokeColor && this._strokeMaterial.hasProperty( "color" )) this._strokeMaterial.setProperty( "color", this._strokeColor );
81 80
81 if(strokeColor) {
82 if(this._strokeMaterial.hasProperty("color")) {
83 this._strokeMaterial.setProperty( "color", this._strokeColor );
84 } else if (this._strokeMaterial && (this._strokeMaterial.gradientType === this._strokeColor.gradientMode)) {
85 this._strokeMaterial.setGradientData(this._strokeColor.color);
86 }
87 }
82 88
83 if(fillMaterial) { 89 if(fillMaterial) {
84 this._fillMaterial = fillMaterial.dup(); 90 this._fillMaterial = fillMaterial.dup();
85 } else { 91 } else {
86 this._fillMaterial = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ).dup(); 92 this._fillMaterial = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ).dup();
87 } 93 }
88 if (fillColor && this._fillMaterial.hasProperty( "color" )) this._fillMaterial.setProperty( "color", this._fillColor ); 94
95 if(fillColor) {
96 if(this._fillMaterial.hasProperty("color")) {
97 this._fillMaterial.setProperty( "color", this._fillColor );
98 } else if (this._fillMaterial && (this._fillMaterial.gradientType === this._fillColor.gradientMode)) {
99 this._fillMaterial.setGradientData(this._fillColor.color);
100 }
101 }
89 } 102 }
90 }, 103 },
91 104