aboutsummaryrefslogtreecommitdiff
path: root/js/tools/drawing-tool-base.js
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/tools/drawing-tool-base.js
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/tools/drawing-tool-base.js')
-rwxr-xr-xjs/tools/drawing-tool-base.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/js/tools/drawing-tool-base.js b/js/tools/drawing-tool-base.js
index cd895102..8d87605c 100755
--- a/js/tools/drawing-tool-base.js
+++ b/js/tools/drawing-tool-base.js
@@ -205,11 +205,11 @@ exports.DrawingToolBase = Montage.create(Montage, {
205 thePlane[3] = -vecUtils.vecDot(3, thePlane, s0); 205 thePlane[3] = -vecUtils.vecDot(3, thePlane, s0);
206 } else { 206 } else {
207 var vec = vecUtils.vecSubtract(3, s1, s0 ); 207 var vec = vecUtils.vecSubtract(3, s1, s0 );
208 var yAxis = Vector.create([0,1,0]); 208 var yAxis = [0,1,0];
209 var tmp = vecUtils.vecCross( 3, vec, yAxis ); 209 var tmp = vecUtils.vecCross( 3, vec, yAxis );
210 var mag = vecUtils.vecMag(3, tmp); 210 var mag = vecUtils.vecMag(3, tmp);
211 if (MathUtils.fpSign(mag) === 0) { 211 if (MathUtils.fpSign(mag) === 0) {
212 thePlane = Vector.create( [0,0,1] ); 212 thePlane = [0,0,1];
213 thePlane[3] = -vecUtils.vecDot(3, thePlane, s0); 213 thePlane[3] = -vecUtils.vecDot(3, thePlane, s0);
214 } else { 214 } else {
215 var xAxis = vecUtils.vecCross( 3, yAxis, tmp ); 215 var xAxis = vecUtils.vecCross( 3, yAxis, tmp );
@@ -336,12 +336,12 @@ exports.DrawingToolBase = Montage.create(Montage, {
336 else 336 else
337 { 337 {
338 var vec = vecUtils.vecSubtract(3, s1, s0 ); 338 var vec = vecUtils.vecSubtract(3, s1, s0 );
339 var yAxis = Vector.create([0,1,0]); 339 var yAxis = [0,1,0];
340 var tmp = vecUtils.vecCross( 3, vec, yAxis ); 340 var tmp = vecUtils.vecCross( 3, vec, yAxis );
341 var mag = vecUtils.vecMag(3, tmp); 341 var mag = vecUtils.vecMag(3, tmp);
342 if (MathUtils.fpSign(mag) === 0) 342 if (MathUtils.fpSign(mag) === 0)
343 { 343 {
344 thePlane = Vector.create( [0,0,1] ); 344 thePlane = [0,0,1];
345 thePlane[3] = -vecUtils.vecDot(3, thePlane, s0); 345 thePlane[3] = -vecUtils.vecDot(3, thePlane, s0);
346 } 346 }
347 else 347 else
@@ -379,7 +379,7 @@ exports.DrawingToolBase = Montage.create(Montage, {
379 379
380 } 380 }
381 381
382 var localPt = Vector.create([p0[0], p0[1], 0.0, 1.0]); 382 var localPt = [p0[0], p0[1], 0.0, 1.0];
383 s0 = viewUtils.postViewToStageWorld( MathUtils.transformPoint(localPt,planeMat), elt ); 383 s0 = viewUtils.postViewToStageWorld( MathUtils.transformPoint(localPt,planeMat), elt );
384 s0 = vecUtils.vecAdd(3, viewUtils.viewToScreen( MathUtils.transformPoint(s0, stageMat) ), offset ); 384 s0 = vecUtils.vecAdd(3, viewUtils.viewToScreen( MathUtils.transformPoint(s0, stageMat) ), offset );
385 385
@@ -513,8 +513,8 @@ exports.DrawingToolBase = Montage.create(Montage, {
513 var z = p0[2]; 513 var z = p0[2];
514 514
515 // fill in the other 2 points on the plane to complete the 4 points 515 // fill in the other 2 points on the plane to complete the 4 points
516 var p1 = Vector.create( [p0[0], p2[1], z] ), 516 var p1 = [p0[0], p2[1], z],
517 p3 = Vector.create( [p2[0], p0[1], z] ); 517 p3 = [p2[0], p0[1], z];
518 518
519 // convert back to 3D space 519 // convert back to 3D space
520 s0 = MathUtils.transformPoint( p0, planeMat ); 520 s0 = MathUtils.transformPoint( p0, planeMat );
@@ -633,8 +633,8 @@ exports.DrawingToolBase = Montage.create(Montage, {
633 var pt0 = ptArr[0], pt2 = ptArr[1]; 633 var pt0 = ptArr[0], pt2 = ptArr[1];
634 z = pt0[2]; 634 z = pt0[2];
635 pt0[2] = z; pt2[2] = z; 635 pt0[2] = z; pt2[2] = z;
636 var pt1 = Vector.create( [pt0[0], pt2[1], z] ), 636 var pt1 = [pt0[0], pt2[1], z],
637 pt3 = Vector.create( [pt2[0], pt0[1], z] ); 637 pt3 = [pt2[0], pt0[1], z];
638 638
639 // 639 //
640 ptArr = [pt0, pt1, pt2, pt3]; 640 ptArr = [pt0, pt1, pt2, pt3];