From 92ae17bc800cf82cdbd1482ef1af1a5fd7bd632a Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Mon, 6 Feb 2012 16:35:12 -0800 Subject: Force layout canvas and SelectionController to update their info when a 2d canvas is replaced by a 3d canvas (and vice-versa). Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/shapes-controller.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'js/controllers/elements/shapes-controller.js') diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index ed45710d..3f1ccc3d 100644 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -59,7 +59,11 @@ exports.ShapesController = Montage.create(CanvasController, { break; case "useWebGl": var canvas = njModule.NJUtils.makeNJElement("canvas", "Canvas", "shape", el.className, true); + canvas.width = el.width; + canvas.height = el.height; this.application.ninja.elementMediator.replaceElement(el, canvas); + NJevent("elementDeleted", el); + this.application.ninja.selectionController.selectElement(canvas); el = canvas; this.toggleWebGlMode(el, value); el.elementModel.shapeModel.GLGeomObj.buildBuffers(); -- cgit v1.2.3