aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels')
-rwxr-xr-xjs/panels/Materials/materials-popup.reel/materials-popup.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/js/panels/Materials/materials-popup.reel/materials-popup.js b/js/panels/Materials/materials-popup.reel/materials-popup.js
index 3ef2e4ef..5b9790b8 100755
--- a/js/panels/Materials/materials-popup.reel/materials-popup.js
+++ b/js/panels/Materials/materials-popup.reel/materials-popup.js
@@ -19,6 +19,7 @@ exports.MaterialsPopup = Montage.create(Component, {
19 }, 19 },
20 20
21 _useSelection: { value: false, enumerable: true }, 21 _useSelection: { value: false, enumerable: true },
22 _whichMaterial: { value: "fill", enumerable: true },
22 23
23 captureAction: { 24 captureAction: {
24 value:function(event) { 25 value:function(event) {
@@ -140,6 +141,20 @@ exports.MaterialsPopup = Montage.create(Component, {
140 if (this._useSelection) 141 if (this._useSelection)
141 { 142 {
142 console.log( "apply to selection" ); 143 console.log( "apply to selection" );
144
145 var selection = this.application.ninja.selectedElements;
146 if (selection && (selection.length > 0))
147 {
148 var canvas = selection[0];
149 var obj;
150 if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj;
151 if (obj)
152 {
153 var world = obj.getWorld();
154 if (world)
155 world.restartRenderLoop();
156 }
157 }
143 } 158 }
144 } 159 }
145 } 160 }
@@ -241,6 +256,7 @@ exports.MaterialsPopup = Montage.create(Component, {
241 { 256 {
242 var canvas = selection[0]; 257 var canvas = selection[0];
243 var obj; 258 var obj;
259 this._whichMaterial = whichMaterial;
244 if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj; 260 if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj;
245 if (obj) 261 if (obj)
246 material = (whichMaterial === 'stroke') ? obj.getStrokeMaterial() : obj.getFillMaterial(); 262 material = (whichMaterial === 'stroke') ? obj.getStrokeMaterial() : obj.getFillMaterial();