diff options
-rw-r--r-- | js/controllers/elements/shapes-controller.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index b9c033aa..44723a1e 100644 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js | |||
@@ -346,8 +346,10 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
346 | { | 346 | { |
347 | world = new GLWorld(el, true); | 347 | world = new GLWorld(el, true); |
348 | el.elementModel.shapeModel.GLWorld = world; | 348 | el.elementModel.shapeModel.GLWorld = world; |
349 | el.elementModel.shapeModel.GLGeomObj.setWorld(world); | ||
350 | el.elementModel.shapeModel.useWebGl = true; | 349 | el.elementModel.shapeModel.useWebGl = true; |
350 | world.import(worldData); | ||
351 | el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot(); | ||
352 | |||
351 | sm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); | 353 | sm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); |
352 | fm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); | 354 | fm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); |
353 | if(sm && fm) | 355 | if(sm && fm) |
@@ -356,9 +358,7 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
356 | el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm); | 358 | el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm); |
357 | el.elementModel.shapeModel.strokeMaterial = sm; | 359 | el.elementModel.shapeModel.strokeMaterial = sm; |
358 | el.elementModel.shapeModel.fillMaterial = fm; | 360 | el.elementModel.shapeModel.fillMaterial = fm; |
359 | el.elementModel.shapeModel.GLGeomObj.buildBuffers(); | ||
360 | } | 361 | } |
361 | world.import(worldData); | ||
362 | } | 362 | } |
363 | 363 | ||
364 | } | 364 | } |
@@ -378,13 +378,13 @@ exports.ShapesController = Montage.create(CanvasController, { | |||
378 | world = new GLWorld(el, false); | 378 | world = new GLWorld(el, false); |
379 | el.elementModel.shapeModel.GLWorld = world; | 379 | el.elementModel.shapeModel.GLWorld = world; |
380 | el.elementModel.shapeModel.useWebGl = false; | 380 | el.elementModel.shapeModel.useWebGl = false; |
381 | world.import(worldData); | ||
382 | el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot(); | ||
381 | el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(null); | 383 | el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(null); |
382 | el.elementModel.shapeModel.GLGeomObj.setFillMaterial(null); | 384 | el.elementModel.shapeModel.GLGeomObj.setFillMaterial(null); |
383 | el.elementModel.shapeModel.strokeMaterial = null; | 385 | el.elementModel.shapeModel.strokeMaterial = null; |
384 | el.elementModel.shapeModel.fillMaterial = null; | 386 | el.elementModel.shapeModel.fillMaterial = null; |
385 | world.import(worldData); | ||
386 | } | 387 | } |
387 | |||
388 | } | 388 | } |
389 | } | 389 | } |
390 | 390 | ||