aboutsummaryrefslogtreecommitdiff
path: root/js/tools
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools')
-rwxr-xr-xjs/tools/LineTool.js6
-rwxr-xr-xjs/tools/OvalTool.js12
-rwxr-xr-xjs/tools/RectTool.js12
3 files changed, 25 insertions, 5 deletions
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js
index 413c0302..f9f2f817 100755
--- a/js/tools/LineTool.js
+++ b/js/tools/LineTool.js
@@ -244,7 +244,11 @@ exports.LineTool = Montage.create(ShapeTool, {
244 { 244 {
245 strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); 245 strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM));
246 } 246 }
247 strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; 247 if (strokeMaterial && this.options.stroke.color && (strokeMaterial.gradientType === this.options.stroke.color.gradientMode)) {
248 strokeColor = {gradientMode:strokeMaterial.gradientType, color:this.options.stroke.color.stops};
249 } else {
250 strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor;
251 }
248 } 252 }
249 253
250 var world = this.getGLWorld(canvas, this.options.use3D); 254 var world = this.getGLWorld(canvas, this.options.use3D);
diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js
index e798d1a7..f1e33205 100755
--- a/js/tools/OvalTool.js
+++ b/js/tools/OvalTool.js
@@ -54,14 +54,22 @@ exports.OvalTool = Montage.create(ShapeTool, {
54 { 54 {
55 strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); 55 strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM));
56 } 56 }
57 strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; 57 if (strokeMaterial && this.options.stroke.color && (strokeMaterial.gradientType === this.options.stroke.color.gradientMode)) {
58 strokeColor = {gradientMode:strokeMaterial.gradientType, color:this.options.stroke.color.stops};
59 } else {
60 strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor;
61 }
58 62
59 fillM = this.options.fillMaterial; 63 fillM = this.options.fillMaterial;
60 if(fillM) 64 if(fillM)
61 { 65 {
62 fillMaterial = Object.create(MaterialsModel.getMaterial(fillM)); 66 fillMaterial = Object.create(MaterialsModel.getMaterial(fillM));
63 } 67 }
64 fillColor = ShapesController.getMaterialColor(fillM) || fillColor; 68 if (fillMaterial && this.options.fill.color && (fillMaterial.gradientType === this.options.fill.color.gradientMode)) {
69 fillColor = {gradientMode:fillMaterial.gradientType, color:this.options.fill.color.stops};
70 } else {
71 fillColor = ShapesController.getMaterialColor(fillM) || fillColor;
72 }
65 } 73 }
66 74
67 var world = this.getGLWorld(canvas, this.options.use3D); 75 var world = this.getGLWorld(canvas, this.options.use3D);
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);