aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
authorJonathan Duran2012-03-06 11:38:39 -0800
committerJonathan Duran2012-03-06 11:38:39 -0800
commit342fb451bd251358068a0dcb10e9dc218b79a176 (patch)
treeaa0195d581c3934fb6dc09981506b3c070002806 /js/stage
parent2815adfd7c19b3dff89dc3e1bda9af8d30dca8d6 (diff)
downloadninja-342fb451bd251358068a0dcb10e9dc218b79a176.tar.gz
Squashed commit of the following:
commit 1cd89d4d06e3a8f2c221628b19cf26a2c69f5d3f Author: Jose Antonio Marquez <kgq387@motorola.com> Date: Tue Mar 6 11:24:25 2012 -0800 Fixing WebGL not available bug commit 84332ab81c1b445195f1d9be8bbeae0725c8e758 Author: Valerio Virgillito <valerio@motorola.com> Date: Tue Mar 6 10:58:25 2012 -0800 Squashed commit of preload-fix into Master - Requiring all the previously pre-loaded files - RDGE, Codemirror and gl-matrix are not included via a script tag. Signed-off-by: Valerio Virgillito <valerio@motorola.com> commit 13f52cf0c74f53a919fa864f86669e8155f82961 Merge: dced508 abc04f3 Author: Valerio Virgillito <valerio@motorola.com> Date: Fri Mar 2 15:46:11 2012 -0800 Merge pull request #93 from imix23ways/Timeline Timeline: Critical bug fixes commit dced508bb19a7bcd467ff1b86b5df5bbec4be794 Merge: 0aeb400 cc772ef Author: Valerio Virgillito <valerio@motorola.com> Date: Fri Mar 2 15:45:35 2012 -0800 Merge pull request #92 from mqg734/WebGLFixes Selection Tool Fixes for elements flying off into space when they overlap commit 0aeb400070762cf01d83cf9f9ee25a5595098b7f Merge: ff0a956 aabb48a Author: Valerio Virgillito <valerio@motorola.com> Date: Fri Mar 2 14:05:21 2012 -0800 Merge pull request #94 from ericguzman/PresetsPanel Presets Panel - Fix single-click activation, and transition cut-off bug. commit cc772ef3333ed419d269a2bda7aea5b0150a7bd9 Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Fri Mar 2 11:34:58 2012 -0800 Fixing flying off into space bug for translate tool too. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> commit abc04f3d50311ed1c21067344bc7e448686f8c5c Author: Jonathan Duran <jduran@motorola.com> Date: Fri Mar 2 11:26:25 2012 -0800 Timeline Fix timing function Signed-off-by: Jonathan Duran <jduran@motorola.com> commit aabb48a1c8d34bc968f4c6b0ffee4e31c1d5d286 Author: Eric Guzman <ericg@motorola.com> Date: Fri Mar 2 11:22:44 2012 -0800 Presets Panel - Fix single-click activation, and transition cut-off bug. Use double-click as the activation event for transition presets. Also fixed the bug when applying a style preset before the transition preset, which disabled transitions after the first one. commit f3207f39ea9d8c1c34246217a23d3a689671903d Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Fri Mar 2 11:21:29 2012 -0800 Don't draw transform handles if the stage is the target element. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> commit 5425be91e7125c22955b4459a62412ff574e49a8 Author: Jonathan Duran <jduran@motorola.com> Date: Fri Mar 2 11:11:48 2012 -0800 Timeline: Fix for animation iteration count Add default webkit css properties to allow animations with integer iteration counts. Signed-off-by: Jonathan Duran <jduran@motorola.com> commit 1760bac1da9218315ad1bacdcf3a157495a049e8 Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Fri Mar 2 10:48:41 2012 -0800 Fix for jumping issue when moving items that have any 3d on them. We can't translate 3d moves into 2d space due to perspective, so we must update the matrix3d values instead of the top-left values if items have 3d. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> commit 2c04935f0ccb1cb7c98371fc10b43155f2d956c4 Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Thu Mar 1 22:20:06 2012 -0800 Fix for elements flying off into space when moving elements that overlap. This was happening because our hit record's element and the browser's element from point did not match. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> commit 50058746779f714ed9b0287f49e56c9f0d35593e Merge: 500426d ff0a956 Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Thu Mar 1 21:49:44 2012 -0800 Merge branch 'refs/heads/ninja-internal' into WebGLFixes commit 500426dea0ca95a6b45be8ea8d132cfdb4d2c940 Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Thu Mar 1 10:11:39 2012 -0800 Fixed logic error when resizing with the top-left transform handles. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> commit 7980d9bde2b43aa5a494ddf6f1db5c4959a57b91 Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Thu Mar 1 10:04:15 2012 -0800 Re-fixing IKNinja-940 - Can't select objects when in side/top view. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> commit f04cc0146d8f7573628678613a99c270116768e4 Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Wed Feb 29 16:45:40 2012 -0800 Last-used material (instead of FlatMaterial) is applied to shape when turning on use WebGL checkbox in the PI. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/stage')
-rwxr-xr-xjs/stage/stage-deps.js4
-rwxr-xr-xjs/stage/tool-handle.js60
2 files changed, 32 insertions, 32 deletions
diff --git a/js/stage/stage-deps.js b/js/stage/stage-deps.js
index 16f2c652..a71b77be 100755
--- a/js/stage/stage-deps.js
+++ b/js/stage/stage-deps.js
@@ -125,7 +125,7 @@ exports.StageDeps = Montage.create(Component, {
125 handleOpenDocument: { 125 handleOpenDocument: {
126 value: function() { 126 value: function() {
127 127
128 workingPlane = Vector.create( [0,0,1,0] ); 128 workingPlane = [0,0,1,0];
129 129
130 snapManager.setCurrentStage(this.currentStage); 130 snapManager.setCurrentStage(this.currentStage);
131 131
@@ -151,7 +151,7 @@ exports.StageDeps = Montage.create(Component, {
151 reinitializeForSwitchDocument: { 151 reinitializeForSwitchDocument: {
152 value: function() { 152 value: function() {
153 153
154 workingPlane = Vector.create( [0,0,1,0] ); 154 workingPlane = [0,0,1,0];
155 155
156 snapManager.setCurrentStage(this.currentStage); 156 snapManager.setCurrentStage(this.currentStage);
157 157
diff --git a/js/stage/tool-handle.js b/js/stage/tool-handle.js
index 03513de7..f16d8324 100755
--- a/js/stage/tool-handle.js
+++ b/js/stage/tool-handle.js
@@ -204,19 +204,19 @@ exports.RotateHandle = Montage.create(ToolHandle, {
204 switch(this._axis) 204 switch(this._axis)
205 { 205 {
206 case "x": 206 case "x":
207 this._vec = Vector.create([1, 0, 0]); 207 this._vec = [1, 0, 0];
208 this._vec2 = Vector.create([0, 1, 0]); 208 this._vec2 = [0, 1, 0];
209 this._vec3 = Vector.create([0, 0, 1]); 209 this._vec3 = [0, 0, 1];
210 break; 210 break;
211 case "y": 211 case "y":
212 this._vec = Vector.create([0, 1, 0]); 212 this._vec = [0, 1, 0];
213 this._vec2 = Vector.create([1, 0, 0]); 213 this._vec2 = [1, 0, 0];
214 this._vec3 = Vector.create([0, 0, 1]); 214 this._vec3 = [0, 0, 1];
215 break; 215 break;
216 case "z": 216 case "z":
217 this._vec = Vector.create([0, 0, 1]); 217 this._vec = [0, 0, 1];
218 this._vec2 = Vector.create([1, 0, 0]); 218 this._vec2 = [1, 0, 0];
219 this._vec3 = Vector.create([0, 1, 0]); 219 this._vec3 = [0, 1, 0];
220 break; 220 break;
221 } 221 }
222 222
@@ -254,7 +254,7 @@ exports.RotateHandle = Montage.create(ToolHandle, {
254 this._planeEq2 = MathUtils.transformVector(this._vec2, transMat); 254 this._planeEq2 = MathUtils.transformVector(this._vec2, transMat);
255 this._planeEq3 = MathUtils.transformVector(this._vec3, transMat); 255 this._planeEq3 = MathUtils.transformVector(this._vec3, transMat);
256 256
257 var viewVec = Vector.create([0, 0, 1]); 257 var viewVec = [0, 0, 1];
258 258
259 var angle2 = MathUtils.getAngleBetweenVectors(this._planeEq2, viewVec); 259 var angle2 = MathUtils.getAngleBetweenVectors(this._planeEq2, viewVec);
260 var angle3 = MathUtils.getAngleBetweenVectors(this._planeEq3, viewVec); 260 var angle3 = MathUtils.getAngleBetweenVectors(this._planeEq3, viewVec);
@@ -279,7 +279,7 @@ exports.RotateHandle = Montage.create(ToolHandle, {
279 279
280 context.beginPath(); 280 context.beginPath();
281 281
282 var pt = Vector.create( [this._radius, 0.0, 0.0] ); 282 var pt = [this._radius, 0.0, 0.0];
283 var pts; 283 var pts;
284 284
285 for (var i=0; i<this._nTriangles; i++) 285 for (var i=0; i<this._nTriangles; i++)
@@ -297,7 +297,7 @@ exports.RotateHandle = Montage.create(ToolHandle, {
297 // Draw the transform handle 297 // Draw the transform handle
298 context.beginPath(); 298 context.beginPath();
299 299
300 pt = Vector.create( [this._transformCenterRadius, 0.0, 0.0] ); 300 pt = [this._transformCenterRadius, 0.0, 0.0];
301 301
302 for (var i=0; i<this._nTriangles; i++) 302 for (var i=0; i<this._nTriangles; i++)
303 { 303 {
@@ -317,8 +317,8 @@ exports.RotateHandle = Montage.create(ToolHandle, {
317 317
318 collidesWithPoint: { 318 collidesWithPoint: {
319 value:function (x, y) { 319 value:function (x, y) {
320 var globalPt = Vector.create( [x, y, 0] ); 320 var globalPt = [x, y, 0];
321 var vec = Vector.create( [0,0,1] ); 321 var vec = [0,0,1];
322 322
323 // if angle between view direction and the handle's plane is within 5 degrees, use line test instead 323 // if angle between view direction and the handle's plane is within 5 degrees, use line test instead
324 var angle = MathUtils.getAngleBetweenVectors(vec, this._planeEq); 324 var angle = MathUtils.getAngleBetweenVectors(vec, this._planeEq);
@@ -339,7 +339,7 @@ exports.RotateHandle = Montage.create(ToolHandle, {
339 var t = MathUtils.parameterizePointOnLine2D( this._origin, this._dirVec, nearPt ); 339 var t = MathUtils.parameterizePointOnLine2D( this._origin, this._dirVec, nearPt );
340 if(angle !== 0) 340 if(angle !== 0)
341 { 341 {
342 var theta = MathUtils.getAngleBetweenVectors(this._dirVec, Vector.create([50, 0, 0])); 342 var theta = MathUtils.getAngleBetweenVectors(this._dirVec, [50, 0, 0]);
343 t = t * Math.cos(theta); 343 t = t * Math.cos(theta);
344 } 344 }
345 345
@@ -364,7 +364,7 @@ exports.RotateHandle = Montage.create(ToolHandle, {
364 var theta = Math.atan2(localPt[1], localPt[0]); 364 var theta = Math.atan2(localPt[1], localPt[0]);
365 var xC = this._transformCenterRadius*Math.cos(theta); 365 var xC = this._transformCenterRadius*Math.cos(theta);
366 var yC = this._transformCenterRadius*Math.sin(theta); 366 var yC = this._transformCenterRadius*Math.sin(theta);
367 var ptOnCircle = Vector.create([xC, yC, 0]); 367 var ptOnCircle = [xC, yC, 0];
368 368
369 var dist = vecUtils.vecDist( 2, localPt, ptOnCircle ); 369 var dist = vecUtils.vecDist( 2, localPt, ptOnCircle );
370 370
@@ -375,7 +375,7 @@ exports.RotateHandle = Montage.create(ToolHandle, {
375 375
376 xC = this._radius*Math.cos(theta); 376 xC = this._radius*Math.cos(theta);
377 yC = this._radius*Math.sin(theta); 377 yC = this._radius*Math.sin(theta);
378 ptOnCircle = Vector.create([xC, yC, 0]); 378 ptOnCircle = [xC, yC, 0];
379 379
380 dist = vecUtils.vecDist( 2, localPt, ptOnCircle ); 380 dist = vecUtils.vecDist( 2, localPt, ptOnCircle );
381 381
@@ -395,7 +395,7 @@ exports.RotateHandle = Montage.create(ToolHandle, {
395 var theta = Math.atan2(localPt[1], localPt[0]); 395 var theta = Math.atan2(localPt[1], localPt[0]);
396 var xC = this._radius*Math.cos(theta); 396 var xC = this._radius*Math.cos(theta);
397 var yC = this._radius*Math.sin(theta); 397 var yC = this._radius*Math.sin(theta);
398 var pt = Vector.create([xC, yC, 0]); 398 var pt = [xC, yC, 0];
399 399
400 var context = this.application.ninja.stage.drawingContext; 400 var context = this.application.ninja.stage.drawingContext;
401 context.save(); 401 context.save();
@@ -548,19 +548,19 @@ exports.TranslateHandle = Montage.create(ToolHandle, {
548 switch(this._axis) 548 switch(this._axis)
549 { 549 {
550 case "x": 550 case "x":
551 this._vec = Vector.create([1, 0, 0]); 551 this._vec = [1, 0, 0];
552 this._vec2 = Vector.create([0, 1, 0]); 552 this._vec2 = [0, 1, 0];
553 this._vec3 = Vector.create([0, 0, 1]); 553 this._vec3 = [0, 0, 1];
554 break; 554 break;
555 case "y": 555 case "y":
556 this._vec = Vector.create([0, -1, 0]); 556 this._vec = [0, -1, 0];
557 this._vec2 = Vector.create([1, 0, 0]); 557 this._vec2 = [1, 0, 0];
558 this._vec3 = Vector.create([0, 0, 1]); 558 this._vec3 = [0, 0, 1];
559 break; 559 break;
560 case "z": 560 case "z":
561 this._vec = Vector.create([0, 0, 1]); 561 this._vec = [0, 0, 1];
562 this._vec2 = Vector.create([1, 0, 0]); 562 this._vec2 = [1, 0, 0];
563 this._vec3 = Vector.create([0, 1, 0]); 563 this._vec3 = [0, 1, 0];
564 break; 564 break;
565 } 565 }
566 } 566 }
@@ -592,7 +592,7 @@ exports.TranslateHandle = Montage.create(ToolHandle, {
592 this._planeEq2 = MathUtils.transformVector(this._vec2, transMat); 592 this._planeEq2 = MathUtils.transformVector(this._vec2, transMat);
593 this._planeEq3 = MathUtils.transformVector(this._vec3, transMat); 593 this._planeEq3 = MathUtils.transformVector(this._vec3, transMat);
594 594
595 var viewVec = Vector.create([0, 0, 1]); 595 var viewVec = [0, 0, 1];
596 596
597 var angle2 = MathUtils.getAngleBetweenVectors(this._planeEq2, viewVec); 597 var angle2 = MathUtils.getAngleBetweenVectors(this._planeEq2, viewVec);
598 var angle3 = MathUtils.getAngleBetweenVectors(this._planeEq3, viewVec); 598 var angle3 = MathUtils.getAngleBetweenVectors(this._planeEq3, viewVec);
@@ -615,7 +615,7 @@ exports.TranslateHandle = Montage.create(ToolHandle, {
615 615
616 context.beginPath(); 616 context.beginPath();
617 617
618 var pt = Vector.create([0.0, 0.0, 0.0]); 618 var pt = [0.0, 0.0, 0.0];
619 var pts = MathUtils.transformPoint(pt, this._matW); 619 var pts = MathUtils.transformPoint(pt, this._matW);
620 620
621 context.moveTo(pts[0], pts[1]); 621 context.moveTo(pts[0], pts[1]);
@@ -697,7 +697,7 @@ exports.TranslateHandle = Montage.create(ToolHandle, {
697 { 697 {
698 value:function (x, y) 698 value:function (x, y)
699 { 699 {
700 var globalPt = Vector.create( [x, y, this._origin[2]] ); 700 var globalPt = [x, y, this._origin[2]];
701 701
702 // test for a hit on the origin 702 // test for a hit on the origin
703 var dist = vecUtils.vecDist( 2, globalPt, this._origin ); 703 var dist = vecUtils.vecDist( 2, globalPt, this._origin );