aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xjs/controllers/elements/shapes-controller.js11
-rwxr-xr-xjs/data/tools-data.js6
-rwxr-xr-xjs/mediators/keyboard-mediator.js7
-rwxr-xr-xjs/tools/Rotate3DToolBase.js11
-rwxr-xr-xjs/tools/SelectionTool.js19
-rwxr-xr-xjs/tools/Translate3DToolBase.js1
6 files changed, 42 insertions, 13 deletions
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index e0bff70c..749a1dd9 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -19,43 +19,51 @@ exports.ShapesController = Montage.create(CanvasController, {
19 this.setShapeProperty(el, "strokeSize", value); 19 this.setShapeProperty(el, "strokeSize", value);
20 el.elementModel.shapeModel.GLGeomObj.setStrokeWidth(val); 20 el.elementModel.shapeModel.GLGeomObj.setStrokeWidth(val);
21 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 21 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
22 el.elementModel.shapeModel.GLWorld.render();
22 break; 23 break;
23 case "innerRadius": 24 case "innerRadius":
24 this.setShapeProperty(el, "innerRadius", value); 25 this.setShapeProperty(el, "innerRadius", value);
25 el.elementModel.shapeModel.GLGeomObj.setInnerRadius(val/100); 26 el.elementModel.shapeModel.GLGeomObj.setInnerRadius(val/100);
26 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 27 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
28 el.elementModel.shapeModel.GLWorld.render();
27 break; 29 break;
28 case "tlRadius": 30 case "tlRadius":
29 this.setShapeProperty(el, "tlRadius", value); 31 this.setShapeProperty(el, "tlRadius", value);
30 el.elementModel.shapeModel.GLGeomObj.setTLRadius(val); 32 el.elementModel.shapeModel.GLGeomObj.setTLRadius(val);
31 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 33 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
34 el.elementModel.shapeModel.GLWorld.render();
32 break; 35 break;
33 case "trRadius": 36 case "trRadius":
34 this.setShapeProperty(el, "trRadius", value); 37 this.setShapeProperty(el, "trRadius", value);
35 el.elementModel.shapeModel.GLGeomObj.setTRRadius(val); 38 el.elementModel.shapeModel.GLGeomObj.setTRRadius(val);
36 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 39 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
40 el.elementModel.shapeModel.GLWorld.render();
37 break; 41 break;
38 case "blRadius": 42 case "blRadius":
39 this.setShapeProperty(el, "blRadius", value); 43 this.setShapeProperty(el, "blRadius", value);
40 el.elementModel.shapeModel.GLGeomObj.setBLRadius(val); 44 el.elementModel.shapeModel.GLGeomObj.setBLRadius(val);
41 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 45 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
46 el.elementModel.shapeModel.GLWorld.render();
42 break; 47 break;
43 case "brRadius": 48 case "brRadius":
44 this.setShapeProperty(el, "brRadius", value); 49 this.setShapeProperty(el, "brRadius", value);
45 el.elementModel.shapeModel.GLGeomObj.setBRRadius(val); 50 el.elementModel.shapeModel.GLGeomObj.setBRRadius(val);
46 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 51 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
52 el.elementModel.shapeModel.GLWorld.render();
47 break; 53 break;
48 case "width": 54 case "width":
49 el.elementModel.shapeModel.GLGeomObj.setWidth(val); 55 el.elementModel.shapeModel.GLGeomObj.setWidth(val);
50 CanvasController.setProperty(el, p, value); 56 CanvasController.setProperty(el, p, value);
51 el.elementModel.shapeModel.GLWorld.setViewportFromCanvas(el); 57 el.elementModel.shapeModel.GLWorld.setViewportFromCanvas(el);
52 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 58 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
59 el.elementModel.shapeModel.GLWorld.render();
53 break; 60 break;
54 case "height": 61 case "height":
55 el.elementModel.shapeModel.GLGeomObj.setHeight(val); 62 el.elementModel.shapeModel.GLGeomObj.setHeight(val);
56 CanvasController.setProperty(el, p, value); 63 CanvasController.setProperty(el, p, value);
57 el.elementModel.shapeModel.GLWorld.setViewportFromCanvas(el); 64 el.elementModel.shapeModel.GLWorld.setViewportFromCanvas(el);
58 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 65 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
66 el.elementModel.shapeModel.GLWorld.render();
59 break; 67 break;
60 case "useWebGl": 68 case "useWebGl":
61 var canvas = njModule.NJUtils.makeNJElement("canvas", "Canvas", "shape", el.className, true); 69 var canvas = njModule.NJUtils.makeNJElement("canvas", "Canvas", "shape", el.className, true);
@@ -76,6 +84,7 @@ exports.ShapesController = Montage.create(CanvasController, {
76 el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(sm); 84 el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(sm);
77 el.elementModel.shapeModel.strokeMaterial = sm; 85 el.elementModel.shapeModel.strokeMaterial = sm;
78 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 86 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
87 el.elementModel.shapeModel.GLWorld.render();
79 } 88 }
80 break; 89 break;
81 case "fillMaterial": 90 case "fillMaterial":
@@ -85,12 +94,12 @@ exports.ShapesController = Montage.create(CanvasController, {
85 el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm); 94 el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm);
86 el.elementModel.shapeModel.fillMaterial = fm; 95 el.elementModel.shapeModel.fillMaterial = fm;
87 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 96 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
97 el.elementModel.shapeModel.GLWorld.render();
88 } 98 }
89 break; 99 break;
90 default: 100 default:
91 CanvasController.setProperty(el, p, value); 101 CanvasController.setProperty(el, p, value);
92 } 102 }
93 el.elementModel.shapeModel.GLWorld.render();
94 } 103 }
95 }, 104 },
96 105
diff --git a/js/data/tools-data.js b/js/data/tools-data.js
index cf48757d..a3a30b57 100755
--- a/js/data/tools-data.js
+++ b/js/data/tools-data.js
@@ -37,7 +37,7 @@ exports.ToolsData = Montage.create(Montage, {
37 "properties": "rotate3DProperties", 37 "properties": "rotate3DProperties",
38 "spriteSheet": true, 38 "spriteSheet": true,
39 "action": "Rotate3DTool", 39 "action": "Rotate3DTool",
40 "toolTip": "3D Rotate Object Tool (W)", 40 "toolTip": "3D Object Rotate Tool (W)",
41 "cursor": "auto", 41 "cursor": "auto",
42 "lastInGroup": false, 42 "lastInGroup": false,
43 "container": false, 43 "container": false,
@@ -48,7 +48,7 @@ exports.ToolsData = Montage.create(Montage, {
48 "properties": "translate3DProperties", 48 "properties": "translate3DProperties",
49 "spriteSheet": true, 49 "spriteSheet": true,
50 "action": "Translate3DTool", 50 "action": "Translate3DTool",
51 "toolTip": "3D Translate Object Tool (G)", 51 "toolTip": "3D Object Translate Tool (G)",
52 "cursor": "auto", 52 "cursor": "auto",
53 "lastInGroup": true, 53 "lastInGroup": true,
54 "container": false, 54 "container": false,
@@ -195,7 +195,7 @@ exports.ToolsData = Montage.create(Montage, {
195 "properties": "rotateStageProperties", 195 "properties": "rotateStageProperties",
196 "spriteSheet": true, 196 "spriteSheet": true,
197 "action": "RotateStageTool3D", 197 "action": "RotateStageTool3D",
198 "toolTip": "3D Rotate Stage Tool", 198 "toolTip": "3D Stage Rotate Tool (M)",
199 "cursor": "auto", 199 "cursor": "auto",
200 "lastInGroup": false, 200 "lastInGroup": false,
201 "container": false, 201 "container": false,
diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js
index 443a18ac..43098cba 100755
--- a/js/mediators/keyboard-mediator.js
+++ b/js/mediators/keyboard-mediator.js
@@ -162,6 +162,13 @@ exports.KeyboardMediator = Montage.create(Component, {
162 return; 162 return;
163 } 163 }
164 164
165 // Rotate Stage Tool is M
166 if(evt.keyCode === Keyboard.M ) {
167 evt.preventDefault();
168 this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[13]});
169 return;
170 }
171
165 // Hand tool 172 // Hand tool
166 if(evt.keyCode === Keyboard.H ) { 173 if(evt.keyCode === Keyboard.H ) {
167 evt.preventDefault(); 174 evt.preventDefault();
diff --git a/js/tools/Rotate3DToolBase.js b/js/tools/Rotate3DToolBase.js
index aa91b2f4..b04e8b0a 100755
--- a/js/tools/Rotate3DToolBase.js
+++ b/js/tools/Rotate3DToolBase.js
@@ -447,16 +447,13 @@ exports.Rotate3DToolBase = Montage.create(ModifierToolBase, {
447 iMat; 447 iMat;
448 for(var i = 0; i < len; i++) 448 for(var i = 0; i < len; i++)
449 { 449 {
450 // Reset to the identity matrix but retain the rotation values 450 // Reset to the identity matrix
451 item = this._targets[i]; 451 item = this._targets[i];
452 elt = item.elt;
453
454 // Reset to the identity matrix but retain the translation values
455 iMat = Matrix.I(4); 452 iMat = Matrix.I(4);
456 mat = item.mat; 453 mat = item.mat;
457 iMat[12] = mat[12]; 454// iMat[12] = mat[12];
458 iMat[13] = mat[13]; 455// iMat[13] = mat[13];
459 iMat[14] = mat[14]; 456// iMat[14] = mat[14];
460 457
461 dist = this._undoArray[i].dist; 458 dist = this._undoArray[i].dist;
462 459
diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js
index 37029e8c..caa9e8d6 100755
--- a/js/tools/SelectionTool.js
+++ b/js/tools/SelectionTool.js
@@ -305,16 +305,33 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
305 newHeight.push(_h + "px"); 305 newHeight.push(_h + "px");
306 306
307 viewUtils.setMatrixForElement(elt, previousMat); 307 viewUtils.setMatrixForElement(elt, previousMat);
308
309 this._targets[i].mat = previousMat;
310 this._targets[i].matInv = glmat4.inverse(previousMat, []);
308 } 311 }
309 } 312 }
310 if(addToUndoStack) 313 if(addToUndoStack)
311 { 314 {
312 ElementsMediator.setProperties(this.application.ninja.selectedElements, 315 // if we have a delta, that means the transform handles were used and
316 // we should update the width and height too. Otherwise, just update left and top.
317 if(this._delta)
318 {
319 ElementsMediator.setProperties(this.application.ninja.selectedElements,
313 { "left": newLeft, "top": newTop, "width": newWidth, "height": newHeight }, 320 { "left": newLeft, "top": newTop, "width": newWidth, "height": newHeight },
314