aboutsummaryrefslogtreecommitdiff
path: root/js/tools/RectTool.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools/RectTool.js')
-rwxr-xr-xjs/tools/RectTool.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js
index 6f0e65c7..0dfafe57 100755
--- a/js/tools/RectTool.js
+++ b/js/tools/RectTool.js
@@ -74,14 +74,22 @@ exports.RectTool = Montage.create(ShapeTool, {
74 { 74 {
75 strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); 75 strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM));
76 } 76 }
77 strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; 77 if (strokeMaterial && this.options.stroke.color && (strokeMaterial.gradientType === this.options.stroke.color.gradientMode)) {
78 strokeColor = {gradientMode:strokeMaterial.gradientType, color:this.options.stroke.color.stops};
79 } else {
80 strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor;
81 }
78 82
79 fillM = this.options.fillMaterial; 83 fillM = this.options.fillMaterial;
80 if(fillM) 84 if(fillM)
81 { 85 {
82 fillMaterial = Object.create(MaterialsModel.getMaterial(fillM)); 86 fillMaterial = Object.create(MaterialsModel.getMaterial(fillM));
83 } 87 }
84 fillColor = ShapesController.getMaterialColor(fillM) || fillColor; 88 if (fillMaterial && this.options.fill.color && (fillMaterial.gradientType === this.options.fill.color.gradientMode)) {
89 fillColor = {gradientMode:fillMaterial.gradientType, color:this.options.fill.color.stops};
90 } else {
91 fillColor = ShapesController.getMaterialColor(fillM) || fillColor;
92 }
85 } 93 }
86 94
87 var world = this.getGLWorld(canvas, this.options.use3D); 95 var world = this.getGLWorld(canvas, this.options.use3D);