From d0661d6c587aced68a68e36a5ec4e81f8a2096e8 Mon Sep 17 00:00:00 2001
From: hwc487
Date: Thu, 23 Feb 2012 16:57:55 -0800
Subject: bug fixes for canvas 2d shape drawing.
---
js/helper-classes/RDGE/GLCircle.js | 136 +++++++++++++++++-----------------
js/helper-classes/RDGE/GLLine.js | 57 +++++++-------
js/helper-classes/RDGE/GLRectangle.js | 61 ++++++++-------
js/tools/LineTool.js | 5 +-
4 files changed, 128 insertions(+), 131 deletions(-)
diff --git a/js/helper-classes/RDGE/GLCircle.js b/js/helper-classes/RDGE/GLCircle.js
index 712544c0..656657f6 100755
--- a/js/helper-classes/RDGE/GLCircle.js
+++ b/js/helper-classes/RDGE/GLCircle.js
@@ -398,59 +398,58 @@ function GLCircle()
// set up the fill style
ctx.beginPath();
ctx.lineWidth = 0;
- ctx.fillStyle = "#990000";
if (this._fillColor)
{
var c = "rgba(" + 255*this._fillColor[0] + "," + 255*this._fillColor[1] + "," + 255*this._fillColor[2] + "," + this._fillColor[3] + ")";
ctx.fillStyle = c;
- }
- // draw the fill
- ctx.beginPath();
- var p = MathUtils.transformPoint( bezPts[0], mat );
- ctx.moveTo( p[0], p[1] );
- var index = 1;
- while (index < n)
- {
- p0 = MathUtils.transformPoint( bezPts[index], mat );
- p1 = MathUtils.transformPoint( bezPts[index+1], mat );
+ // draw the fill
+ ctx.beginPath();
+ var p = MathUtils.transformPoint( bezPts[0], mat );
+ ctx.moveTo( p[0], p[1] );
+ var index = 1;
+ while (index < n)
+ {
+ p0 = MathUtils.transformPoint( bezPts[index], mat );
+ p1 = MathUtils.transformPoint( bezPts[index+1], mat );
- x0 = p0[0]; y0 = p0[1];
- x1 = p1[0]; y1 = p1[1];
- ctx.quadraticCurveTo( x0, y0, x1, y1 );
- index += 2;
- }
+ x0 = p0[0]; y0 = p0[1];
+ x1 = p1[0]; y1 = p1[1];
+ ctx.quadraticCurveTo( x0, y0, x1, y1 );
+ index += 2;
+ }
- if ( MathUtils.fpSign(innerRad) > 0)
- {
- xScale = 0.5*innerRad*this._width;
- yScale = 0.5*innerRad*this._height;
- mat[0] = xScale;
- mat[5] = yScale;
-
- // get the bezier points
- var bezPts = MathUtils.circularArcToBezier( Vector.create([0,0,0]), Vector.create([1,0,0]), -2.0*Math.PI );
- if (bezPts)
+ if ( MathUtils.fpSign(innerRad) > 0)
{
- var n = bezPts.length;
- p = MathUtils.transformPoint( bezPts[0], mat );
- ctx.moveTo( p[0], p[1] );
- index = 1;
- while (index < n)
+ xScale = 0.5*innerRad*this._width;
+ yScale = 0.5*innerRad*this._height;
+ mat[0] = xScale;
+ mat[5] = yScale;
+
+ // get the bezier points
+ var bezPts = MathUtils.circularArcToBezier( Vector.create([0,0,0]), Vector.create([1,0,0]), -2.0*Math.PI );
+ if (bezPts)
{
- p0 = MathUtils.transformPoint( bezPts[index], mat );
- p1 = MathUtils.transformPoint( bezPts[index+1], mat );
-
- var x0 = p0[0], y0 = p0[1],
- x1 = p1[0], y1 = p1[1];
- ctx.quadraticCurveTo( x0, y0, x1, y1 );
- index += 2;
+ var n = bezPts.length;
+ p = MathUtils.transformPoint( bezPts[0], mat );
+ ctx.moveTo( p[0], p[1] );
+ index = 1;
+ while (index < n)
+ {
+ p0 = MathUtils.transformPoint( bezPts[index], mat );
+ p1 = MathUtils.transformPoint( bezPts[index+1], mat );
+
+ var x0 = p0[0], y0 = p0[1],
+ x1 = p1[0], y1 = p1[1];
+ ctx.quadraticCurveTo( x0, y0, x1, y1 );
+ index += 2;
+ }
}
}
- }
- // fill the path
- ctx.fill();
+ // fill the path
+ ctx.fill();
+ }
// calculate the stroke matrix
xScale = 0.5*this._width - 0.5*lineWidth;
@@ -461,35 +460,10 @@ function GLCircle()
// set up the stroke style
ctx.beginPath();
ctx.lineWidth = lineWidth;
- ctx.strokeStyle = "#0000ff";
if (this._strokeColor)
{
var c = "rgba(" + 255*this._strokeColor[0] + "," + 255*this._strokeColor[1] + "," + 255*this._strokeColor[2] + "," + this._strokeColor[3] + ")";
ctx.strokeStyle = c;
- }
-
- // draw the stroke
- p = MathUtils.transformPoint( bezPts[0], mat );
- ctx.moveTo( p[0], p[1] );
- index = 1;
- while (index < n)
- {
- var p0 = MathUtils.transformPoint( bezPts[index], mat );
- var p1 = MathUtils.transformPoint( bezPts[index+1], mat );
-
- var x0 = p0[0], y0 = p0[1],
- x1 = p1[0], y1 = p1[1];
- ctx.quadraticCurveTo( x0, y0, x1, y1 );
- index += 2;
- }
-
- if (MathUtils.fpSign(innerRad) > 0)
- {
- // calculate the stroke matrix
- xScale = 0.5*innerRad*this._width - 0.5*lineWidth;
- yScale = 0.5*innerRad*this._height - 0.5*lineWidth;
- mat[0] = xScale;
- mat[5] = yScale;
// draw the stroke
p = MathUtils.transformPoint( bezPts[0], mat );
@@ -505,10 +479,34 @@ function GLCircle()
ctx.quadraticCurveTo( x0, y0, x1, y1 );
index += 2;
}
- }
- // render the stroke
- ctx.stroke();
+ if (MathUtils.fpSign(innerRad) > 0)
+ {
+ // calculate the stroke matrix
+ xScale = 0.5*innerRad*this._width - 0.5*lineWidth;
+ yScale = 0.5*innerRad*this._height - 0.5*lineWidth;
+ mat[0] = xScale;
+ mat[5] = yScale;
+
+ // draw the stroke
+ p = MathUtils.transformPoint( bezPts[0], mat );
+ ctx.moveTo( p[0], p[1] );
+ index = 1;
+ while (index < n)
+ {
+ var p0 = MathUtils.transformPoint( bezPts[index], mat );
+ var p1 = MathUtils.transformPoint( bezPts[index+1], mat );
+
+ var x0 = p0[0], y0 = p0[1],
+ x1 = p1[0], y1 = p1[1];
+ ctx.quadraticCurveTo( x0, y0, x1, y1 );
+ index += 2;
+ }
+ }
+
+ // render the stroke
+ ctx.stroke();
+ }
}
}
diff --git a/js/helper-classes/RDGE/GLLine.js b/js/helper-classes/RDGE/GLLine.js
index f715a43c..5228ac09 100755
--- a/js/helper-classes/RDGE/GLLine.js
+++ b/js/helper-classes/RDGE/GLLine.js
@@ -364,41 +364,40 @@ function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, stro
var lineWidth = this._strokeWidth;
ctx.beginPath();
ctx.lineWidth = lineWidth;
- ctx.strokeStyle = "#0000ff";
if (this._strokeColor)
{
var c = "rgba(" + 255*this._strokeColor[0] + "," + 255*this._strokeColor[1] + "," + 255*this._strokeColor[2] + "," + this._strokeColor[3] + ")";
ctx.strokeStyle = c;
- }
- // get the points
- var p0, p1;
- var w = this._width, h = this._height;
- if(this._slope === "vertical")
- {
- p0 = [0.5*w, 0];
- p1 = [0.5*w, h];
- }
- else if(this._slope === "horizontal")
- {
- p0 = [0, 0.5*h];
- p1 = [w, 0.5*h];
- }
- else if(this._slope > 0)
- {
- p0 = [this._xAdj, this._yAdj];
- p1 = [w - this._xAdj, h - this._yAdj];
- }
- else
- {
- p0 = [this._xAdj, h - this._yAdj];
- p1 = [w - this._xAdj, this._yAdj];
- }
+ // get the points
+ var p0, p1;
+ var w = this._width, h = this._height;
+ if(this._slope === "vertical")
+ {
+ p0 = [0.5*w, 0];
+ p1 = [0.5*w, h];
+ }
+ else if(this._slope === "horizontal")
+ {
+ p0 = [0, 0.5*h];
+ p1 = [w, 0.5*h];
+ }
+ else if(this._slope > 0)
+ {
+ p0 = [this._xAdj, this._yAdj];
+ p1 = [w - this._xAdj, h - this._yAdj];
+ }
+ else
+ {
+ p0 = [this._xAdj, h - this._yAdj];
+ p1 = [w - this._xAdj, this._yAdj];
+ }
- // draw the line
- ctx.moveTo( p0[0], p0[1] );
- ctx.lineTo( p1[0], p1[1] );
- ctx.stroke();
+ // draw the line
+ ctx.moveTo( p0[0], p0[1] );
+ ctx.lineTo( p1[0], p1[1] );
+ ctx.stroke();
+ }
}
diff --git a/js/helper-classes/RDGE/GLRectangle.js b/js/helper-classes/RDGE/GLRectangle.js
index 3c1cb7dc..cf9c123e 100755
--- a/js/helper-classes/RDGE/GLRectangle.js
+++ b/js/helper-classes/RDGE/GLRectangle.js
@@ -402,7 +402,6 @@ function GLRectangle()
// set the fill
ctx.beginPath();
- ctx.fillStyle = "#990000";
if (this._fillColor)
{
var c = "rgba(" + 255*this._fillColor[0] + "," + 255*this._fillColor[1] + "," + 255*this._fillColor[2] + "," + this._fillColor[3] + ")";
@@ -410,7 +409,6 @@ function GLRectangle()
}
// set the stroke
- ctx.strokeStyle = "#0000ff";
if (this._strokeColor)
{
var c = "rgba(" + 255*this._strokeColor[0] + "," + 255*this._strokeColor[1] + "," + 255*this._strokeColor[2] + "," + this._strokeColor[3] + ")";
@@ -420,8 +418,8 @@ function GLRectangle()
ctx.lineWidth = lw;
var inset = Math.ceil( 0.5*lw ) + 0.5;
this.renderPath( inset, ctx );
- ctx.fill();
- ctx.stroke();
+ if (this._fillColor) ctx.fill();
+ if (this._strokeColor) ctx.stroke();
ctx.closePath();
}
@@ -777,15 +775,15 @@ RectangleFill.create = function( rectCtr, width, height, tlRad, blRad, brRad,
}
//refine the mesh for vertex deformations
- if (material)
- {
- if (material.hasVertexDeformation())
- {
- var paramRange = material.getVertexDeformationRange();
- var tolerance = material.getVertexDeformationTolerance();
- nVertices = ShapePrimitive.refineMesh( this.vertices, this.normals, this.uvs, this.indices, nVertices, paramRange, tolerance );
- }
- }
+// if (material)
+// {
+// if (material.hasVertexDeformation())
+// {
+// var paramRange = material.getVertexDeformationRange();
+// var tolerance = material.getVertexDeformationTolerance();
+// nVertices = ShapePrimitive.refineMesh( this.vertices, this.normals, this.uvs, this.indices, nVertices, paramRange, tolerance );
+// }
+// }
// create the RDGE primitive
var prim = ShapePrimitive.create(this.vertices, this.normals, this.uvs, this.indices, g_Engine.getContext().renderer.TRIANGLES, nVertices);
@@ -1051,15 +1049,15 @@ RectangleStroke.create = function( rectCtr, width, height, strokeWidth, tlRad,
}
//refine the mesh for vertex deformations
- if (material)
- {
- if (material.hasVertexDeformation())
- {
- var paramRange = material.getVertexDeformationRange();
- var tolerance = material.getVertexDeformationTolerance();
- //nVertices = ShapePrimitive.refineMesh( this.vertices, this.normals, this.uvs, this.indices, nVertices, paramRange, tolerance );
- }
- }
+// if (material)
+// {
+// if (material.hasVertexDeformation())
+// {
+// var paramRange = material.getVertexDeformationRange();
+// var tolerance = material.getVertexDeformationTolerance();
+// nVertices = ShapePrimitive.refineMesh( this.vertices, this.normals, this.uvs, this.indices, nVertices, paramRange, tolerance );
+// }
+// }
// create the RDGE primitive
var prim = ShapePrimitive.create(this.vertices, this.normals, this.uvs, this.indices, g_Engine.getContext().renderer.TRIANGLES, nVertices);
@@ -1144,19 +1142,18 @@ RectangleGeometry.create = function( ctr, width, height, material )
RectangleGeometry.pushIndices( 0, 3, 2 );
//refine the mesh for vertex deformations
- if (material)
- {
- if (material.hasVertexDeformation())
- {
- var paramRange = material.getVertexDeformationRange();
- var tolerance = material.getVertexDeformationTolerance();
- //nVertices = ShapePrimitive.refineMesh( this.vertices, this.normals, this.uvs, this.indices, nVertices, paramRange, tolerance );
- }
- }
+// if (material)
+// {
+// if (material.hasVertexDeformation())
+// {
+// var paramRange = material.getVertexDeformationRange();
+// var tolerance = material.getVertexDeformationTolerance();
+// nVertices = ShapePrimitive.refineMesh( this.vertices, this.normals, this.uvs, this.indices, nVertices, paramRange, tolerance );
+// }
+// }
// create the RDGE primitive
var prim = ShapePrimitive.create(this.vertices, this.normals, this.uvs, this.indices, g_Engine.getContext().renderer.TRIANGLES, nVertices);
- //var prim = ShapePrimitive.create(this.vertices, this.normals, this.uvs, this.indices, g_Engine.getContext().renderer.LINES, nVertices);
return prim;
}
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js
index 233316a5..0a7c0534 100755
--- a/js/tools/LineTool.js
+++ b/js/tools/LineTool.js
@@ -42,7 +42,10 @@ exports.LineTool = Montage.create(ShapeTool, {
}
this._strokeSize = ShapesController.GetValueInPixels(this.options.strokeSize.value, this.options.strokeSize.units, null);
- this._strokeColor = this.application.ninja.colorController.colorToolbar.stroke.color.css;
+ if (this.application.ninja.colorController.colorToolbar.stroke.color)
+ this._strokeColor = this.application.ninja.colorController.colorToolbar.stroke.color.css;
+ else
+ this._strokeColor = [0,0,0,1];
this.startDraw(event);
}
},
--
cgit v1.2.3
From a5ba66ecefa9c9c17e0f5e1725e2141f7a3540a2 Mon Sep 17 00:00:00 2001
From: Pushkar Joshi
Date: Fri, 24 Feb 2012 12:01:03 -0800
Subject: adding unpacked to the manifest file (to differentiate from the
ninjateam (main) chrome app)
---
manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/manifest.json b/manifest.json
index 3d156d2b..e9abd76f 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,5 +1,5 @@
{
- "name": "Motorola Ninja",
+ "name": "Motorola Ninja Unpacked",
"description": "Motorola Ninja HTML5 Authoring Tool Pre-Alpha",
"version": "0.5.0.1",
"app": {
--
cgit v1.2.3
From 8578322c60adaaf65f37ba96f2a0f7ed9de8e1dc Mon Sep 17 00:00:00 2001
From: hwc487
Date: Mon, 27 Feb 2012 10:28:03 -0800
Subject: Fixed various rendering bugs.
---
js/helper-classes/RDGE/GLCircle.js | 4 ++--
js/helper-classes/RDGE/GLGeomObj.js | 4 ++--
js/helper-classes/RDGE/GLLine.js | 2 +-
js/helper-classes/RDGE/GLRectangle.js | 24 +++++++++++++++---------
js/helper-classes/RDGE/GLWorld.js | 2 +-
5 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/js/helper-classes/RDGE/GLCircle.js b/js/helper-classes/RDGE/GLCircle.js
index 656657f6..15ed6b6d 100755
--- a/js/helper-classes/RDGE/GLCircle.js
+++ b/js/helper-classes/RDGE/GLCircle.js
@@ -47,8 +47,8 @@ function GLCircle()
this._strokeWidth = strokeSize;
this._innerRadius = innerRadius;
- this._strokeColor = strokeColor;
- this._fillColor = fillColor;
+ if (strokeColor) this._strokeColor = strokeColor;
+ if (fillColor) this._fillColor = fillColor;
this._strokeStyle = strokeStyle;
}
diff --git a/js/helper-classes/RDGE/GLGeomObj.js b/js/helper-classes/RDGE/GLGeomObj.js
index 5d7497ad..c1ee01ba 100755
--- a/js/helper-classes/RDGE/GLGeomObj.js
+++ b/js/helper-classes/RDGE/GLGeomObj.js
@@ -38,8 +38,8 @@ function GLGeomObj()
this.m_world = null;
// stroke and fill colors
- this._strokeColor;
- this._fillColor;
+ this._strokeColor = [0,0,0,0];
+ this._fillColor = [0,0,0,0];
// stroke and fill materials
this._fillMaterial;
diff --git a/js/helper-classes/RDGE/GLLine.js b/js/helper-classes/RDGE/GLLine.js
index 5228ac09..5b966896 100755
--- a/js/helper-classes/RDGE/GLLine.js
+++ b/js/helper-classes/RDGE/GLLine.js
@@ -43,7 +43,7 @@ function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, stro
this._slope = slope;
this._strokeWidth = strokeSize;
- this._strokeColor = strokeColor;
+ if (strokeCOlor)this._strokeColor = strokeColor;
this._strokeStyle = strokeStyle;
this._scaleX = (world.getViewportWidth())/(world.getViewportHeight());
diff --git a/js/helper-classes/RDGE/GLRectangle.js b/js/helper-classes/RDGE/GLRectangle.js
index cf9c123e..a801d3c4 100755
--- a/js/helper-classes/RDGE/GLRectangle.js
+++ b/js/helper-classes/RDGE/GLRectangle.js
@@ -400,27 +400,33 @@ function GLRectangle()
var w = world.getViewportWidth(),
h = world.getViewportHeight();
- // set the fill
+ // render the fill
ctx.beginPath();
if (this._fillColor)
{
var c = "rgba(" + 255*this._fillColor[0] + "," + 255*this._fillColor[1] + "," + 255*this._fillColor[2] + "," + this._fillColor[3] + ")";
ctx.fillStyle = c;
+
+ ctx.lineWidth = lw;
+ var inset = Math.ceil( lw ) + 0.5;
+ this.renderPath( inset, ctx );
+ ctx.fill();
+ ctx.closePath();
}
- // set the stroke
+ // render the stroke
+ ctx.beginPath();
if (this._strokeColor)
{
var c = "rgba(" + 255*this._strokeColor[0] + "," + 255*this._strokeColor[1] + "," + 255*this._strokeColor[2] + "," + this._strokeColor[3] + ")";
ctx.strokeStyle = c;
- }
- ctx.lineWidth = lw;
- var inset = Math.ceil( 0.5*lw ) + 0.5;
- this.renderPath( inset, ctx );
- if (this._fillColor) ctx.fill();
- if (this._strokeColor) ctx.stroke();
- ctx.closePath();
+ ctx.lineWidth = lw;
+ var inset = Math.ceil( 0.5*lw ) + 0.5;
+ this.renderPath( inset, ctx );
+ ctx.stroke();
+ ctx.closePath();
+ }
}
this.createStroke = function(ctr, width, height, strokeWidth, tlRad, blRad, brRad, trRad, material)
diff --git a/js/helper-classes/RDGE/GLWorld.js b/js/helper-classes/RDGE/GLWorld.js
index 0addcadc..646faa24 100755
--- a/js/helper-classes/RDGE/GLWorld.js
+++ b/js/helper-classes/RDGE/GLWorld.js
@@ -157,7 +157,7 @@ function GLWorld( canvas, use3D )
// change clear color
//this.renderer.setClearFlags(g_Engine.getContext().DEPTH_BUFFER_BIT);
- this.renderer.setClearColor([1.0, 1.0, 1.0, 0.0]);
+ this.renderer.setClearColor([0.0, 0.0, 0.0, 0.0]);
//this.renderer.NinjaWorld = this;
// create an empty scene graph
--
cgit v1.2.3
From bfa895634324a78652f2a7eecf725d9c6030023f Mon Sep 17 00:00:00 2001
From: hwc487
Date: Mon, 27 Feb 2012 11:58:44 -0800
Subject: Changed the hardcoded publish setting for a PI fix.
---
js/helper-classes/RDGE/GLWorld.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/js/helper-classes/RDGE/GLWorld.js b/js/helper-classes/RDGE/GLWorld.js
index 646faa24..8017207f 100755
--- a/js/helper-classes/RDGE/GLWorld.js
+++ b/js/helper-classes/RDGE/GLWorld.js
@@ -824,7 +824,7 @@ GLWorld.prototype.export = function()
// we need 2 export modes: One for save/restore, one for publish.
// hardcoding for now
- var exportForPublish = true;
+ var exportForPublish = false;
exportStr += "publish: " + exportForPublish + "\n";
if (exportForPublish)
--
cgit v1.2.3
From ec5f81c6c0ccf865505ab82ebf9240c667f05c91 Mon Sep 17 00:00:00 2001
From: Jon Reid
Date: Mon, 27 Feb 2012 12:07:30 -0800
Subject: Timeline: further work on clearTimeline method.
---
.../Timeline/TimelinePanel.reel/TimelinePanel.html | 5 +++--
js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 18 ++++++++++++++----
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html
index 9d0b8210..65d2fa7b 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html
@@ -32,7 +32,8 @@
"timetext" : {"#": "time_text"},
"timebar" : {"#": "time_bar"},
"container_tracks" : {"#" : "container-tracks"},
- "end_hottext" : {"@" : "endHottext"}
+ "end_hottext" : {"@" : "endHottext"},
+ "getme" : {"#" : "getme"}
}
},
@@ -284,7 +285,7 @@
-
Master Layer
+
Master Layer
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 2143dafd..9519730e 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -172,6 +172,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
prepareForDraw:{
value:function () {
this.eventManager.addEventListener( "onOpenDocument", this, false);
+ var that = this;
+ this.getme.addEventListener("click", function() {
+ that.clearTimelinePanel();
+ }, false)
}
},
@@ -246,11 +250,17 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
clearTimelinePanel : {
value: function() {
console.log('clearing timeline...')
- this.arrTracks = null;
- this.arrLayers = null;
+ // update playhead position and time text
+ this.application.ninja.timeline.playhead.style.left = "-2px";
+ this.application.ninja.timeline.playheadmarker.style.left = "0px";
+ this.application.ninja.timeline.updateTimeText(0.00);
+ this.timebar.style.width = "0px";
+
+ this.arrTracks = [];
+ this.arrLayers = [];
this.currentLayerNumber = 0;
- this.currentLayerSelected = null;
- this.currentTrackSelected = null;
+ this.currentLayerSelected = false;
+ this.currentTrackSelected = false;
this.selectedKeyframes = [];
this.selectedTweens = [];
this._captureSelection = false;
--
cgit v1.2.3
From a8bd1585ae83d4d304b9f9f41823bb3dcbff9e01 Mon Sep 17 00:00:00 2001
From: hwc487
Date: Mon, 27 Feb 2012 12:14:29 -0800
Subject: Color fix for line shapes.
---
js/helper-classes/RDGE/GLLine.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/js/helper-classes/RDGE/GLLine.js b/js/helper-classes/RDGE/GLLine.js
index 5b966896..65e6ab1c 100755
--- a/js/helper-classes/RDGE/GLLine.js
+++ b/js/helper-classes/RDGE/GLLine.js
@@ -11,6 +11,10 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
///////////////////////////////////////////////////////////////////////
function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, strokeColor, strokeMaterial, strokeStyle, xAdj, yAdj)
{
+ // initialize the inherited members
+ this.inheritedFrom = GLGeomObj;
+ this.inheritedFrom();
+
///////////////////////////////////////////////////////////////////////
// Instance variables
///////////////////////////////////////////////////////////////////////
@@ -43,7 +47,7 @@ function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, stro
this._slope = slope;
this._strokeWidth = strokeSize;
- if (strokeCOlor)this._strokeColor = strokeColor;
+ if (strokeColor) this._strokeColor = strokeColor.slice();
this._strokeStyle = strokeStyle;
this._scaleX = (world.getViewportWidth())/(world.getViewportHeight());
@@ -57,10 +61,6 @@ function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, stro
this._materialDiffuse = [0.4, 0.4, 0.4, 1.0];
this._materialSpecular = [0.4, 0.4, 0.4, 1.0];
- // initialize the inherited members
- this.inheritedFrom = GLGeomObj;
- this.inheritedFrom();
-
if(strokeMaterial)
{
this._strokeMaterial = strokeMaterial;
--
cgit v1.2.3
From 5179adf63d25856a8ee96005678d7a6ac626cba6 Mon Sep 17 00:00:00 2001
From: Jon Reid
Date: Mon, 27 Feb 2012 13:31:39 -0800
Subject: Timeline: More work on clear timeline method.
---
js/panels/Timeline/Layer.reel/Layer.js | 1 -
.../Timeline/TimelinePanel.reel/TimelinePanel.js | 53 +++++++++++++++++-----
js/panels/Timeline/Tween.reel/Tween.js | 1 +
3 files changed, 43 insertions(+), 12 deletions(-)
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index e75b4d0f..d50360e6 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -509,7 +509,6 @@ var Layer = exports.Layer = Montage.create(Component, {
this.styleCollapser.bypassAnimation = true;
this.styleCollapser.toggle();
}
-
if (this.isSelected) {
this.element.classList.add("selected");
} else {
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index d7ce7079..0feada6b 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -171,11 +171,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
/* === BEGIN: Draw cycle === */
prepareForDraw:{
value:function () {
+ this.initTimeline();
this.eventManager.addEventListener( "onOpenDocument", this, false);
- var that = this;
- this.getme.addEventListener("click", function() {
- that.clearTimelinePanel();
- }, false)
+ this.eventManager.addEventListener("closeDocument", this, false);
}
},
@@ -198,6 +196,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
}
},
+
+ handleCloseDocument: {
+ value: function(event) {
+ this.clearTimelinePanel();
+ }
+ },
willDraw:{
value:function () {
if (this._isLayer) {
@@ -209,10 +213,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
/* === END: Draw cycle === */
/* === BEGIN: Controllers === */
- initTimelineView:{
- value:function () {
- var myIndex;
- this.layout_tracks = this.element.querySelector(".layout-tracks");
+ initTimeline : {
+ value: function() {
+ // Set up basic Timeline functions: event listeners, etc. Things that only need to be run once.
+ this.layout_tracks = this.element.querySelector(".layout-tracks");
this.layout_markers = this.element.querySelector(".layout_markers");
this.newlayer_button.identifier = "addLayer";
@@ -223,6 +227,13 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
this.layout_tracks.addEventListener("scroll", this.updateLayerScroll.bind(this), false);
this.user_layers.addEventListener("scroll", this.updateLayerScroll.bind(this), false);
this.end_hottext.addEventListener("changing", this.updateTrackContainerWidth.bind(this), false);
+
+ }
+ },
+ initTimelineView:{
+ value:function () {
+ var myIndex;
+
this.drawTimeMarkers();
@@ -253,13 +264,27 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
clearTimelinePanel : {
value: function() {
- console.log('clearing timeline...')
- // update playhead position and time text
+ // Remove events
+ this.eventManager.removeEventListener("deleteLayerClick", this, false);
+ this.eventManager.removeEventListener("newLayer", this, false);
+ this.eventManager.removeEventListener("deleteLayer", this, false);
+ this.eventManager.removeEventListener("layerBinding", this, false);
+ this.eventManager.removeEventListener("elementAdded", this, false);
+ this.eventManager.removeEventListener("elementDeleted", this, false);
+ this.eventManager.removeEventListener("deleteSelection", this, false);
+ this.eventManager.removeEventListener("selectionChange", this, true);
+
+ // Reset visual appearance
this.application.ninja.timeline.playhead.style.left = "-2px";
this.application.ninja.timeline.playheadmarker.style.left = "0px";
this.application.ninja.timeline.updateTimeText(0.00);
this.timebar.style.width = "0px";
+ // Clear variables--including repetitions.
+ this.hashInstance = null;
+ this.hashTrackInstance = null;
+ this.hashLayerNumber = null;
+ this.hashElementMapToLayer = null;
this.arrTracks = [];
this.arrLayers = [];
this.currentLayerNumber = 0;
@@ -271,6 +296,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
this._openDoc = false;
this.end_hottext.value = 25;
this.updateTrackContainerWidth();
+
+ // Redraw all the things
+ this.layerRepetition.needsDraw = true;
+ this.trackRepetition.needsDraw = true;
this.needsDraw = true;
}
},
@@ -502,6 +531,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
if(this._openDoc){
event.detail.ele.uuid =nj.generateRandom();
+ console.log("in open doc")
+ console.log(event.detail.ele)
thingToPush.elementsList.push(event.detail.ele);
}
@@ -657,7 +688,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
handleElementAdded:{
value:function (event) {
-
+ console.log('called')
event.detail.uuid=nj.generateRandom();
this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected);
this.currentLayerSelected.elementsList.push(event.detail);
diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js
index f6dbf32c..70b52297 100644
--- a/js/panels/Timeline/Tween.reel/Tween.js
+++ b/js/panels/Timeline/Tween.reel/Tween.js
@@ -140,6 +140,7 @@ var Tween = exports.Tween = Montage.create(Component, {
value:function (event) {
if (event.detail.source && event.detail.source !== "tween") {
// check for correct element selection
+ console.log(this.application.ninja.selectedElements[0]._element)
if (this.application.ninja.selectedElements[0]._element != this.parentComponent.parentComponent.animatedElement) {
alert("Wrong element selected for this keyframe track");
} else {
--
cgit v1.2.3
From b194efa0556806593b29eb197250df462e89fcc4 Mon Sep 17 00:00:00 2001
From: hwc487
Date: Mon, 27 Feb 2012 14:03:11 -0800
Subject: Enable shift key constraint for Pan Tool.
---
js/tools/PanTool.js | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/js/tools/PanTool.js b/js/tools/PanTool.js
index 71301d46..0537a27b 100755
--- a/js/tools/PanTool.js
+++ b/js/tools/PanTool.js
@@ -81,6 +81,14 @@ exports.PanTool = Montage.create(toolBase,
{
this._altKeyDown = true;
}
+ else if (event.shiftKey)
+ {
+ if (!this._shiftKeyDown)
+ {
+ this._shiftKeyDown = true;
+ this._shiftPt = this._lastGPt.slice();
+ }
+ }
}
},
@@ -90,6 +98,10 @@ exports.PanTool = Montage.create(toolBase,
{
this._altKeyDown = false;
}
+ else if (event.keyCode === Keyboard.SHIFT)
+ {
+ this._shiftKeyDown = false;
+ }
}
},
@@ -221,6 +233,7 @@ exports.PanTool = Montage.create(toolBase,
var tmpLocal = MathUtils.transformAndDivideHomogeneousPoint( this._globalPt, globalToLocalMat );
this._lastGPt = this._globalPt.slice();
+ this._shiftPt = this._lastGPt.slice();
this._lastY = this._lastGPt[1];
// set up the matrices we will be needing
@@ -285,6 +298,16 @@ exports.PanTool = Montage.create(toolBase,
this._globalPt[2] += dy;
gPt = [this._lastGPt[0], this._lastGPt[1], this._globalPt[2]];
}
+ else if (this._shiftKeyDown)
+ {
+ var dx = Math.abs( this._shiftPt[0] - gPt[0] ),
+ dy = Math.abs( this._shiftPt[1] - gPt[1] );
+
+ if (dx >= dy)
+ gPt[1] = this._shiftPt[1];
+ else
+ gPt[0] = this._shiftPt[0];
+ }
// update the scrollbars
var deltaGPt = VecUtils.vecSubtract(2, gPt, this._lastGPt);
--
cgit v1.2.3
From ef38731ae2769dcb2247db599cdfe62d38e34b28 Mon Sep 17 00:00:00 2001
From: Nivesh Rajbhandari
Date: Mon, 27 Feb 2012 15:39:16 -0800
Subject: Reset translation values as well when double-clicking to reset the
rotation values.
Signed-off-by: Nivesh Rajbhandari
---
js/tools/Rotate3DToolBase.js | 11 ++++-------
js/tools/Translate3DToolBase.js | 1 -
2 files changed, 4 insertions(+), 8 deletions(-)
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, {
iMat;
for(var i = 0; i < len; i++)
{
- // Reset to the identity matrix but retain the rotation values
+ // Reset to the identity matrix
item = this._targets[i];
- elt = item.elt;
-
- // Reset to the identity matrix but retain the translation values
iMat = Matrix.I(4);
mat = item.mat;
- iMat[12] = mat[12];
- iMat[13] = mat[13];
- iMat[14] = mat[14];
+// iMat[12] = mat[12];
+// iMat[13] = mat[13];
+// iMat[14] = mat[14];
dist = this._undoArray[i].dist;
diff --git a/js/tools/Translate3DToolBase.js b/js/tools/Translate3DToolBase.js
index cbf76830..3d9191da 100755
--- a/js/tools/Translate3DToolBase.js
+++ b/js/tools/Translate3DToolBase.js
@@ -85,7 +85,6 @@ exports.Translate3DToolBase = Montage.create(ModifierToolBase,
{
// Reset to the identity matrix but retain the rotation values
item = this._targets[i];
- elt = item.elt;
mat = item.mat.slice(0);
mat[12] = 0;
mat[13] = 0;
--
cgit v1.2.3
From a70c62891d0c7dd032d9382c50d1555ab81c4e33 Mon Sep 17 00:00:00 2001
From: Nivesh Rajbhandari
Date: Mon, 27 Feb 2012 16:24:13 -0800
Subject: Fixing tooltips and keyboard shortcuts for 3d tools.
IKNinja-1014 and IKNinja-1015.
Signed-off-by: Nivesh Rajbhandari
---
js/data/tools-data.js | 6 +++---
js/mediators/keyboard-mediator.js | 7 +++++++
2 files changed, 10 insertions(+), 3 deletions(-)
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, {
"properties": "rotate3DProperties",
"spriteSheet": true,
"action": "Rotate3DTool",
- "toolTip": "3D Rotate Object Tool (W)",
+ "toolTip": "3D Object Rotate Tool (W)",
"cursor": "auto",
"lastInGroup": false,
"container": false,
@@ -48,7 +48,7 @@ exports.ToolsData = Montage.create(Montage, {
"properties": "translate3DProperties",
"spriteSheet": true,
"action": "Translate3DTool",
- "toolTip": "3D Translate Object Tool (G)",
+ "toolTip": "3D Object Translate Tool (G)",
"cursor": "auto",
"lastInGroup": true,
"container": false,
@@ -195,7 +195,7 @@ exports.ToolsData = Montage.create(Montage, {
"properties": "rotateStageProperties",
"spriteSheet": true,
"action": "RotateStageTool3D",
- "toolTip": "3D Rotate Stage Tool",
+ "toolTip": "3D Stage Rotate Tool (M)",
"cursor": "auto",
"lastInGroup": false,
"container": false,
diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js
index 5b044f8a..a2589340 100755
--- a/js/mediators/keyboard-mediator.js
+++ b/js/mediators/keyboard-mediator.js
@@ -162,6 +162,13 @@ exports.KeyboardMediator = Montage.create(Component, {
return;
}
+ // Rotate Stage Tool is M
+ if(evt.keyCode === Keyboard.M ) {
+ evt.preventDefault();
+ this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[13]});
+ return;
+ }
+
// Hand tool
if(evt.keyCode === Keyboard.H ) {
evt.preventDefault();
--
cgit v1.2.3
From 445180591da04f681a22038600e8ab517b82c0ca Mon Sep 17 00:00:00 2001
From: Jon Reid
Date: Mon, 27 Feb 2012 20:26:49 -0800
Subject: Timeline: try to clean up bogus events manually.
---
js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 8 ++++++++
js/panels/Timeline/Tween.reel/Tween.js | 6 +++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 0feada6b..912dce83 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -273,6 +273,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
this.eventManager.removeEventListener("elementDeleted", this, false);
this.eventManager.removeEventListener("deleteSelection", this, false);
this.eventManager.removeEventListener("selectionChange", this, true);
+
+ // Remove every event listener for every tween in TimelineTrack
+ for (var i = 0; i < this.arrTracks.length; i++) {
+ for (var j = 0; j < this.arrTracks[i].tweens.length; j++) {
+ //this.eventManager.removeEventListener("elementChange", this, false);
+ this.arrTracks[i].tweens[j].eventManager.removeEventListener("elementChange", this.arrTracks[i].tweens[j], false);
+ }
+ }
// Reset visual appearance
this.application.ninja.timeline.playhead.style.left = "-2px";
diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js
index 70b52297..a9ee1fec 100644
--- a/js/panels/Timeline/Tween.reel/Tween.js
+++ b/js/panels/Timeline/Tween.reel/Tween.js
@@ -138,9 +138,12 @@ var Tween = exports.Tween = Montage.create(Component, {
handleElementChange:{
value:function (event) {
+
if (event.detail.source && event.detail.source !== "tween") {
// check for correct element selection
- console.log(this.application.ninja.selectedElements[0]._element)
+ console.log("handleElementChange! " + this.tweenID)
+ console.log(this.application.ninja.selectedElements[0]._element);
+ console.log(this.parentComponent.parentComponent.animatedElement);
if (this.application.ninja.selectedElements[0]._element != this.parentComponent.parentComponent.animatedElement) {
alert("Wrong element selected for this keyframe track");
} else {
@@ -162,6 +165,7 @@ var Tween = exports.Tween = Montage.create(Component, {
selectTween:{
value: function(){
// turn on event listener for element change
+ console.log('adding elementChange event listener for tween ' + this.tweenID)
this.eventManager.addEventListener("elementChange", this, false);
// select the containing layer
--
cgit v1.2.3
From 0031310ea80a33b1752d3813070b00215f0c52c6 Mon Sep 17 00:00:00 2001
From: Jon Reid
Date: Mon, 27 Feb 2012 21:55:37 -0800
Subject: Timeline: Successfully unbind event listeners in tweens when clearing
timeline.
---
.../Timeline/TimelinePanel.reel/TimelinePanel.js | 6 +-----
.../Timeline/TimelineTrack.reel/TimelineTrack.html | 5 +++++
js/panels/Timeline/Tween.reel/Tween.js | 19 +++++++++++++++----
3 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 912dce83..69e6527f 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -277,8 +277,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
// Remove every event listener for every tween in TimelineTrack
for (var i = 0; i < this.arrTracks.length; i++) {
for (var j = 0; j < this.arrTracks[i].tweens.length; j++) {
- //this.eventManager.removeEventListener("elementChange", this, false);
- this.arrTracks[i].tweens[j].eventManager.removeEventListener("elementChange", this.arrTracks[i].tweens[j], false);
+ this.arrTracks[i].tweens[j].isClearing = "clear it";
}
}
@@ -539,8 +538,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
if(this._openDoc){
event.detail.ele.uuid =nj.generateRandom();
- console.log("in open doc")
- console.log(event.detail.ele)
thingToPush.elementsList.push(event.detail.ele);
}
@@ -696,7 +693,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
handleElementAdded:{
value:function (event) {
- console.log('called')
event.detail.uuid=nj.generateRandom();
this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected);
this.currentLayerSelected.elementsList.push(event.detail);
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
index 158d666e..26d045d6 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
@@ -62,6 +62,11 @@
"boundObject" : {"@": "tweenRepetition"},
"boundObjectPropertyPath" : "objectAtCurrentIteration.isTweenAnimated",
"oneway" : false
+ },
+ "isClearing" : {
+ "boundObject" : {"@": "tweenRepetition"},
+ "boundObjectPropertyPath" : "objectAtCurrentIteration.isClearing",
+ "oneway" : false
}
}
},
diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js
index a9ee1fec..729abd64 100644
--- a/js/panels/Timeline/Tween.reel/Tween.js
+++ b/js/panels/Timeline/Tween.reel/Tween.js
@@ -118,6 +118,21 @@ var Tween = exports.Tween = Montage.create(Component, {
this.needsDraw = true;
}
},
+
+ _isClearing : {
+ serializable: true,
+ value: false
+ },
+ isClearing : {
+ get: function() {
+ return this._isClearing;
+ },
+ set: function(newVal) {
+ if (newVal === "clear it") {
+ this.eventManager.removeEventListener("elementChange", this, false);
+ }
+ }
+ },
prepareForDraw:{
value:function () {
@@ -141,9 +156,6 @@ var Tween = exports.Tween = Montage.create(Component, {
if (event.detail.source && event.detail.source !== "tween") {
// check for correct element selection
- console.log("handleElementChange! " + this.tweenID)
- console.log(this.application.ninja.selectedElements[0]._element);
- console.log(this.parentComponent.parentComponent.animatedElement);
if (this.application.ninja.selectedElements[0]._element != this.parentComponent.parentComponent.animatedElement) {
alert("Wrong element selected for this keyframe track");
} else {
@@ -165,7 +177,6 @@ var Tween = exports.Tween = Montage.create(Component, {
selectTween:{
value: function(){
// turn on event listener for element change
- console.log('adding elementChange event listener for tween ' + this.tweenID)
this.eventManager.addEventListener("elementChange", this, false);
// select the containing layer
--
cgit v1.2.3
From ad730e448c523b8c849cb1c9c63a30e8b62a2780 Mon Sep 17 00:00:00 2001
From: Jonathan Duran
Date: Tue, 28 Feb 2012 08:33:44 -0800
Subject: Fix re-reopened animation duration and milliseconds
Signed-off-by: Jonathan Duran
---
js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 55c84dce..d369106c 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -553,7 +553,9 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
var keyframeString = "@-webkit-keyframes " + this.animationName + " {";
for (var i = 0; i < this.tweens.length; i++) {
- var keyframePercent = Math.round((this.tweens[i].keyFrameMillisec / this.trackDuration) * 100) + "%";
+ var keyMill = parseInt(this.tweens[i].keyFrameMillisec);
+ var trackDur = parseFloat(this.trackDuration);
+ var keyframePercent = Math.round((keyMill / trackDur) * 100) + "%";
var keyframePropertyString = " " + keyframePercent + " {";
keyframePropertyString += "top: " + this.tweens[i].tweenedProperties["top"] + "px;";
keyframePropertyString += " left: " + this.tweens[i].tweenedProperties["left"] + "px;";
--
cgit v1.2.3
From b301702e2eed93df9124b9f4f9a02fdf36d31dfa Mon Sep 17 00:00:00 2001
From: Jonathan Duran
Date: Tue, 28 Feb 2012 08:41:37 -0800
Subject: todo note
Signed-off-by: Jonathan Duran
---
js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index d369106c..d6c1128e 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -554,7 +554,8 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
for (var i = 0; i < this.tweens.length; i++) {
var keyMill = parseInt(this.tweens[i].keyFrameMillisec);
- var trackDur = parseFloat(this.trackDuration);
+ // TODO - trackDur should be parseFloat rounded to significant digits
+ var trackDur = parseInt(this.trackDuration);
var keyframePercent = Math.round((keyMill / trackDur) * 100) + "%";
var keyframePropertyString = " " + keyframePercent + " {";
keyframePropertyString += "top: " + this.tweens[i].tweenedProperties["top"] + "px;";
--
cgit v1.2.3
From ffe308bc1c876b83a0b24fc1234a16f21a601aa2 Mon Sep 17 00:00:00 2001
From: Jonathan Duran
Date: Tue, 28 Feb 2012 09:17:09 -0800
Subject: remove comment
Signed-off-by: Jonathan Duran
---
js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index d6c1128e..bbf505fc 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -377,7 +377,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
// This needs to move to a keyboard shortcut that is TBD
var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
- //this.application.ninja.timeline.selectLayer(selectIndex);
if (ev.shiftKey) {
if (this.application.ninja.timeline.arrLayers[selectedIndex].elementsList.length == 1) {
--
cgit v1.2.3
From 09d487fb5d28a181f69e3c6afa87d6e2f624317b Mon Sep 17 00:00:00 2001
From: Jonathan Duran
Date: Tue, 28 Feb 2012 10:07:04 -0800
Subject: Fix to animation names to support multiclassed elements
Signed-off-by: Jonathan Duran
---
js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index bbf505fc..43cd7477 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -532,7 +532,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
this.tweens[0].tweenedProperties["top"] = this.animatedElement.offsetTop;
this.tweens[0].tweenedProperties["left"] = this.animatedElement.offsetLeft;
var animationDuration = Math.round(this.trackDuration / 1000) + "s";
- this.animationName = "animation_" + this.animatedElement.className;
+ this.animationName = "animation_" + this.animatedElement.classList[0];
this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-name", this.animationName);
this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-duration", animationDuration);
this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-iteration-count", "infinite");
--
cgit v1.2.3
From 7cbd26d475eaad817042692f9116f9a24ae60997 Mon Sep 17 00:00:00 2001
From: Pushkar Joshi
Date: Tue, 28 Feb 2012 10:24:06 -0800
Subject: Bug fixes:
1152: allow deleting of multiple paths from inside pen tool
1128: keyboard hotkey shortcut 'P' for pen tool
941: changing width or height of the path scales the path
---
js/helper-classes/RDGE/GLAnchorPoint.js | 7 +++
js/helper-classes/RDGE/GLSubpath.js | 64 ++++++++++++++++++++++++---
js/mediators/keyboard-mediator.js | 7 +++
js/tools/PenTool.js | 77 +++++++++++++++++++++++----------
4 files changed, 127 insertions(+), 28 deletions(-)
diff --git a/js/helper-classes/RDGE/GLAnchorPoint.js b/js/helper-classes/RDGE/GLAnchorPoint.js
index 716f59d4..c3e95b34 100755
--- a/js/helper-classes/RDGE/GLAnchorPoint.js
+++ b/js/helper-classes/RDGE/GLAnchorPoint.js
@@ -133,6 +133,13 @@ GLAnchorPoint.prototype.translateAll = function (x, y, z) {
}
+GLAnchorPoint.prototype.scaleAll = function(sx,sy,sz){
+ this._x *= sx;this._prevX *= sx;this._nextX *= sx;
+ this._y *= sy;this._prevY *= sy;this._nextY *= sy;
+ this._z *= sz;this._prevZ *= sz;this._nextZ *= sz;
+}
+
+
// ********* getters **********
GLAnchorPoint.prototype.getPosX = function () { return this._x; }
GLAnchorPoint.prototype.getPosY = function () { return this._y; }
diff --git a/js/helper-classes/RDGE/GLSubpath.js b/js/helper-classes/RDGE/GLSubpath.js
index 3200cf59..7beb11b9 100755
--- a/js/helper-classes/RDGE/GLSubpath.js
+++ b/js/helper-classes/RDGE/GLSubpath.js
@@ -178,6 +178,65 @@ function GLSubpath() {
} //render()
this.geomType = function () { return this.GEOM_TYPE_CUBIC_BEZIER; }
+
+
+ this.setWidth = function (newW) {
+ //todo this doesn't work in cases where the newW is zero or if the previous width was 0/1 (i.e. the path had become degenerate in width)
+ //todo same as above for the setHeight function below
+ //scale the contents of this subpath to lie within this width
+ //determine the scale factor by comparing with the old width
+ var oldWidth = this._BBoxMax[0]-this._BBoxMin[0];
+ if (oldWidth<1){
+ oldWidth=1;
+ }
+ var scaleX = newW/oldWidth;
+ if (scaleX===1){
+ return; //no need to do anything
+ }
+
+ //scale the anchor point positions such that the width of the bbox is the newW
+ var origX = this._BBoxMin[0];
+ var numAnchors = this._Anchors.length;
+ for (var i=0;i=0){
- this._hoveredAnchorIndex=-1;
- this._selectedSubpath.removeAnchor(this._selectedSubpath.getSelectedAnchorIndex());
- this._selectedSubpath.createSamples();
- //clear the canvas
- this.application.ninja.stage.clearDrawingCanvas();//stageManagerModule.stageManager.clearDrawingCanvas();
- this.DrawSubpathAnchors(this._selectedSubpath);
- this.ShowSelectedSubpath();
+ var len = this.application.ninja.selectedElements.length;
+ if (len===0) {
+ //clear the selected subpath...the only new additions to this function w.r.t. ToolBase
+ if (this._selectedSubpath){
+ if (this._selectedSubpath.getSelectedAnchorIndex()>=0){
+ this._hoveredAnchorIndex=-1;
+ this._selectedSubpath.removeAnchor(this._selectedSubpath.getSelectedAnchorIndex());
+ this._selectedSubpath.createSamples();
+ //clear the canvas
+ this.application.ninja.stage.clearDrawingCanvas();//stageManagerModule.stageManager.clearDrawingCanvas();
+ this.DrawSubpathAnchors(this._selectedSubpath);
+ this.ShowSelectedSubpath();
+ }
+ else {
+ this._selectedSubpath.clearAllAnchors(); //perhaps unnecessary
+ this._selectedSubpath = null;
+ //clear the canvas
+ this.application.ninja.stage.clearDrawingCanvas();//stageManagerModule.stageManager.clearDrawingCanvas();
+
+ //undo/redo...go through ElementController and NJEvent
+ var els = [];
+ ElementController.removeElement(this._penCanvas);
+ els.push(this._penCanvas);
+ NJevent( "deleteSelection", els );
+ this._penCanvas = null;
+ }
+ }
+ //do nothing if there was no selected subpath and if there was no selection
+ }
+ else {
+
+ //undo/redo...go through ElementMediator (see ElementMediator.handleDeleting() from where the much of this function is copied)
+ //clear the canvas
+ this.application.ninja.stage.clearDrawingCanvas();//stageManagerModule.stageManager.clearDrawingCanvas();
+ var els = [];
+ for(var i = 0; i
---
js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index c4206b18..85ce6a20 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -927,10 +927,12 @@ var TimelinePanel =