From 6c994c4b90023cecf4fd0caafb404b859fe28f54 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Wed, 6 Jun 2012 16:34:41 -0700 Subject: material cleanup and rearchitecture --- .../Materials/materials-popup.reel/materials-popup.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'js/panels/Materials') 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, { }, _useSelection: { value: false, enumerable: true }, + _whichMaterial: { value: "fill", enumerable: true }, captureAction: { value:function(event) { @@ -140,6 +141,20 @@ exports.MaterialsPopup = Montage.create(Component, { if (this._useSelection) { console.log( "apply to selection" ); + + var selection = this.application.ninja.selectedElements; + if (selection && (selection.length > 0)) + { + var canvas = selection[0]; + var obj; + if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj; + if (obj) + { + var world = obj.getWorld(); + if (world) + world.restartRenderLoop(); + } + } } } } @@ -241,6 +256,7 @@ exports.MaterialsPopup = Montage.create(Component, { { var canvas = selection[0]; var obj; + this._whichMaterial = whichMaterial; if (canvas.elementModel && canvas.elementModel.shapeModel) obj = canvas.elementModel.shapeModel.GLGeomObj; if (obj) material = (whichMaterial === 'stroke') ? obj.getStrokeMaterial() : obj.getFillMaterial(); -- cgit v1.2.3