diff options
author | Valerio Virgillito | 2012-07-09 12:15:26 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-07-09 12:15:26 -0700 |
commit | 1839f24e8dcbad38d1381bbcd65c17a9caa45987 (patch) | |
tree | 516a29ca99d4aae0d5228223fff438c1a3c4e0d3 /js/lib/geom/line.js | |
parent | aedd14b18695d031f695d27dfbd94df5614495bb (diff) | |
parent | febfdb18042d1c73ac58ee4e35c5f176428dee00 (diff) | |
download | ninja-1839f24e8dcbad38d1381bbcd65c17a9caa45987.tar.gz |
Merge pull request #346 from mqg734/MaterialsUI
UI support for preview, edit, duplicate and delete of WebGL Materials.
Diffstat (limited to 'js/lib/geom/line.js')
-rwxr-xr-x | js/lib/geom/line.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/js/lib/geom/line.js b/js/lib/geom/line.js index a44026eb..16c40623 100755 --- a/js/lib/geom/line.js +++ b/js/lib/geom/line.js | |||
@@ -87,8 +87,17 @@ exports.Line = Object.create(GeomObj, { | |||
87 | this._materialSpecular = [0.4, 0.4, 0.4, 1.0]; | 87 | this._materialSpecular = [0.4, 0.4, 0.4, 1.0]; |
88 | 88 | ||
89 | if(strokeMaterial) { | 89 | if(strokeMaterial) { |
90 | this._strokeMaterial = strokeMaterial; | 90 | this._strokeMaterial = strokeMaterial.dup(); |
91 | if (strokeColor && this._strokeMaterial.hasProperty( "color" )) this._strokeMaterial.setProperty( "color", this._strokeColor ); | 91 | } else { |
92 | this._strokeMaterial = MaterialsModel.getMaterial( MaterialsModel.getDefaultMaterialName() ).dup(); | ||
93 | } | ||
94 | |||
95 | if(strokeColor) { | ||
96 | if(this._strokeMaterial.hasProperty("color")) { | ||
97 | this._strokeMaterial.setProperty( "color", this._strokeColor ); | ||
98 | } else if (this._strokeMaterial && (this._strokeMaterial.gradientType === this._strokeColor.gradientMode)) { | ||
99 | this._strokeMaterial.setGradientData(this._strokeColor.color); | ||
100 | } | ||
92 | } | 101 | } |
93 | } | 102 | } |
94 | }, | 103 | }, |