From 79ef4e4f51f8981feac3f3bddb6a06aa37407542 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 8 Feb 2012 09:53:32 -0800 Subject: Fixed radio button to update 3d values when switching from local to global and vice-versa. Signed-off-by: Nivesh Rajbhandari --- .../properties/sections/three-d-view.reel/three-d-view.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/panels/properties/sections/three-d-view.reel/three-d-view.html b/js/panels/properties/sections/three-d-view.reel/three-d-view.html index 11a5b3f2..1e24cb55 100644 --- a/js/panels/properties/sections/three-d-view.reel/three-d-view.html +++ b/js/panels/properties/sections/three-d-view.reel/three-d-view.html @@ -39,7 +39,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "value": { "boundObject": {"@": "owner"}, "boundObjectPropertyPath": "x3D", - "oneway": true + "oneway": false } }, "listeners": [ @@ -68,7 +68,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "value": { "boundObject": {"@": "owner"}, "boundObjectPropertyPath": "y3D", - "oneway": true + "oneway": false } }, "listeners": [ @@ -97,7 +97,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "value": { "boundObject": {"@": "owner"}, "boundObjectPropertyPath": "z3D", - "oneway": true + "oneway": false } }, "listeners": [ @@ -128,7 +128,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "value": { "boundObject": {"@": "owner"}, "boundObjectPropertyPath": "xAngle", - "oneway": true + "oneway": false } }, "listeners": [ @@ -159,7 +159,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "value": { "boundObject": {"@": "owner"}, "boundObjectPropertyPath": "yAngle", - "oneway": true + "oneway": false } }, "listeners": [ @@ -190,7 +190,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "value": { "boundObject": {"@": "owner"}, "boundObjectPropertyPath": "zAngle", - "oneway": true + "oneway": false } }, "listeners": [ -- cgit v1.2.3 From 2d68f944e93b201deb46015392e706b7a24201c9 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 8 Feb 2012 14:24:48 -0800 Subject: Fixed several typos in Materials import/export code to support toggling between 2d and 3d shape modes. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/shapes-controller.js | 25 +++++++++-- js/helper-classes/RDGE/GLMaterial.js | 2 +- js/helper-classes/RDGE/GLRectangle.js | 4 +- .../RDGE/Materials/BumpMetalMaterial.js | 10 ++--- js/helper-classes/RDGE/Materials/FlatMaterial.js | 48 ++++++++++++++-------- js/helper-classes/RDGE/Materials/UberMaterial.js | 6 +-- js/helper-classes/RDGE/MaterialsLibrary.js | 2 +- 7 files changed, 64 insertions(+), 33 deletions(-) diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index e764de4e..b9c033aa 100644 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -63,11 +63,11 @@ exports.ShapesController = Montage.create(CanvasController, { 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(); - break; + el.elementModel.shapeModel.GLWorld.render(); + this.application.ninja.selectionController.selectElement(el); + return; case "strokeMaterial": var sm = Object.create(MaterialsLibrary.getMaterial(value)); if(sm) @@ -338,13 +338,26 @@ exports.ShapesController = Montage.create(CanvasController, { { return; } - var world, + var sm, + fm, + world, worldData = el.elementModel.shapeModel.GLWorld.export(); if(worldData) { world = new GLWorld(el, true); el.elementModel.shapeModel.GLWorld = world; + el.elementModel.shapeModel.GLGeomObj.setWorld(world); el.elementModel.shapeModel.useWebGl = true; + sm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); + fm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); + if(sm && fm) + { + el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(sm); + el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm); + el.elementModel.shapeModel.strokeMaterial = sm; + el.elementModel.shapeModel.fillMaterial = fm; + el.elementModel.shapeModel.GLGeomObj.buildBuffers(); + } world.import(worldData); } @@ -365,6 +378,10 @@ exports.ShapesController = Montage.create(CanvasController, { world = new GLWorld(el, false); el.elementModel.shapeModel.GLWorld = world; el.elementModel.shapeModel.useWebGl = false; + el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(null); + el.elementModel.shapeModel.GLGeomObj.setFillMaterial(null); + el.elementModel.shapeModel.strokeMaterial = null; + el.elementModel.shapeModel.fillMaterial = null; world.import(worldData); } diff --git a/js/helper-classes/RDGE/GLMaterial.js b/js/helper-classes/RDGE/GLMaterial.js index 51c27ace..e1a68abd 100644 --- a/js/helper-classes/RDGE/GLMaterial.js +++ b/js/helper-classes/RDGE/GLMaterial.js @@ -186,7 +186,7 @@ function GLMaterial( world ) var endKey = "endMaterial\n"; var index = importStr.indexOf( endKey ); index += endKey.length; - rtnStr = importStr.substr( index ); + var rtnStr = importStr.substr( index ); return rtnStr; } diff --git a/js/helper-classes/RDGE/GLRectangle.js b/js/helper-classes/RDGE/GLRectangle.js index 8535a683..b88ecc71 100644 --- a/js/helper-classes/RDGE/GLRectangle.js +++ b/js/helper-classes/RDGE/GLRectangle.js @@ -177,8 +177,8 @@ function GLRectangle() this._strokeWidth = Number( this.getPropertyFromString( "strokeWidth: ", importStr ) ); this._innerRadius = Number( this.getPropertyFromString( "innerRadius: ", importStr ) ); this._strokeStyle = Number( this.getPropertyFromString( "strokeStyle: ", importStr ) ); - var strokeMaterialName = Number( this.getPropertyFromString( "strokeMat: ", importStr ) ); - var fillMaterialName = Number( this.getPropertyFromString( "fillMat: ", importStr ) ); + var strokeMaterialName = this.getPropertyFromString( "strokeMat: ", importStr ); + var fillMaterialName = this.getPropertyFromString( "fillMat: ", importStr ); this._strokeStyle = Number( this.getPropertyFromString( "strokeColor: ", importStr ) ); this._fillColor = eval( "[" + this.getPropertyFromString( "fillColor: ", importStr ) + "]" ); this._strokeColor = eval( "[" + this.getPropertyFromString( "strokeColor: ", importStr ) + "]" ); diff --git a/js/helper-classes/RDGE/Materials/BumpMetalMaterial.js b/js/helper-classes/RDGE/Materials/BumpMetalMaterial.js index 0aa3ee78..59720611 100644 --- a/js/helper-classes/RDGE/Materials/BumpMetalMaterial.js +++ b/js/helper-classes/RDGE/Materials/BumpMetalMaterial.js @@ -52,7 +52,7 @@ function BumpMetalMaterial() /////////////////////////////////////////////////////////////////////// // Material Property Accessors /////////////////////////////////////////////////////////////////////// - this._propNames = ["lightDiff", "diffuseMap", "normalMap", "specularMap"]; + this._propNames = ["lightDiff", "diffuseTexture", "normalMap", "specularTexture"]; this._propLabels = ["Diffuse Color", "Diffuse Map", "Bump Map", "Specular Map"]; this._propTypes = ["color", "file", "file", "file"]; this._propValues = []; @@ -122,7 +122,7 @@ function BumpMetalMaterial() exportStr += "lightDiff: " + this.getLightDiff() + "\n"; exportStr += "diffuseTexture: " + this.getDiffuseTexture() + "\n"; exportStr += "specularTexture: " + this.getSpecularTexture() + "\n"; - exportStr += "normalTexture: " + this.getNormalTexture() + "\n"; + exportStr += "normalMap: " + this.getNormalTexture() + "\n"; // every material needs to terminate like this exportStr += "endMaterial\n"; @@ -143,12 +143,12 @@ function BumpMetalMaterial() var lightDiff = eval( "[" + pu.nextValue( "lightDiff: " ) + "]" ), dt = pu.nextValue( "diffuseTexture: " ), st = pu.nextValue( "specularTexture: " ), - nt = pu.nextValue( "normalTexture: " ); + nt = pu.nextValue( "normalMap: " ); - this.setProperty( "lightDiff", lightDif); + this.setProperty( "lightDiff", lightDiff); this.setProperty( "diffuseTexture", dt ); this.setProperty( "specularTexture", st ); - this.setProperty( "normalTexture", nt ); + this.setProperty( "normalMap", nt ); var endKey = "endMaterial\n"; var index = importStr.indexOf( endKey ); diff --git a/js/helper-classes/RDGE/Materials/FlatMaterial.js b/js/helper-classes/RDGE/Materials/FlatMaterial.js index 5177a8a0..a5c079a8 100644 --- a/js/helper-classes/RDGE/Materials/FlatMaterial.js +++ b/js/helper-classes/RDGE/Materials/FlatMaterial.js @@ -63,11 +63,12 @@ function FlatMaterial() this.setProperty = function( prop, value ) { - // make sure we have legitimate imput + // make sure we have legitimate input if (this.validateProperty( prop, value )) { - this._color = value.slice(0); - this._shader.colorMe[prop].set(value); + this._propValues[prop] = value; + if (this._shader && this._shader.colorMe) + this._shader.colorMe[prop].set(value); } } /////////////////////////////////////////////////////////////////////// @@ -76,7 +77,7 @@ function FlatMaterial() { // this function should be overridden by subclasses var exportStr = "material: " + this.getShaderName() + "\n"; - exportStr = "name: " + this.getName() + "\n"; + exportStr += "name: " + this.getName() + "\n"; if (this._shader) exportStr += "color: " + String(this._shader.colorMe.color) + "\n"; @@ -87,19 +88,32 @@ function FlatMaterial() return exportStr; } - this.import = function( importStr ) - { - var pu = new ParseUtils( importStr ); - var material = pu.nextValue( "material: " ); - if (material != this.getShaderName()) throw new Error( "ill-formed material" ); - this.setName( pu.nextValue( "material: ") ); - var color = pu.nextValue( "color: " ); - - var endKey = "endMaterial\n"; - var index = importStr.indexOf( endKey ) + endKey.len; - var rtnStr = importStr.substr( index ); - return rtnStr; - } + this.import = function( importStr ) + { + var pu = new ParseUtils( importStr ); + var material = pu.nextValue( "material: " ); + if (material != this.getShaderName()) throw new Error( "ill-formed material" ); + this.setName( pu.nextValue( "name: ") ); + + var rtnStr; + try + { + var color = eval( "[" + pu.nextValue( "color: " ) + "]" ); + + this.setProperty( "color", color); + + var endKey = "endMaterial\n"; + var index = importStr.indexOf( endKey ); + index += endKey.length; + rtnStr = importStr.substr( index ); + } + catch (e) + { + throw new Error( "could not import material: " + importStr ); + } + + return rtnStr; + } } // used to create unique names diff --git a/js/helper-classes/RDGE/Materials/UberMaterial.js b/js/helper-classes/RDGE/Materials/UberMaterial.js index a8254465..f3acdaa6 100644 --- a/js/helper-classes/RDGE/Materials/UberMaterial.js +++ b/js/helper-classes/RDGE/Materials/UberMaterial.js @@ -45,9 +45,9 @@ function UberMaterial() /////////////////////////////////////////////////////////////////////// // Material Property Accessors /////////////////////////////////////////////////////////////////////// - this._propNames = ["ambientColor", "diffuseColor", "specularColor", "specularPower" , "diffuseMap", "normalMap", "specularMap", "environmentMap", "environmentAmount", "dummy" ]; - this._propLabels = ["Ambient Color", "Diffuse Color", "Specular Color", "Specular Power", "Texture Map", "Bump Map", "Specular Map", "Environment Map", "Environment Map Amount", "Dummy" ]; - this._propTypes = ["color", "color", "color", "float", "file", "file", "file", "file", "float", "checkbox"]; + this._propNames = ["ambientColor", "diffuseColor", "specularColor", "specularPower" , "diffuseMap", "normalMap", "specularMap", "environmentMap", "environmentAmount" ]; + this._propLabels = ["Ambient Color", "Diffuse Color", "Specular Color", "Specular Power", "Texture Map", "Bump Map", "Specular Map", "Environment Map", "Environment Map Amount" ]; + this._propTypes = ["color", "color", "color", "float", "file", "file", "file", "file", "float" ]; this._propValues = []; this._propValues[ this._propNames[0] ] = this._ambientColor.slice(0); diff --git a/js/helper-classes/RDGE/MaterialsLibrary.js b/js/helper-classes/RDGE/MaterialsLibrary.js index 9616b525..e7fc51ac 100644 --- a/js/helper-classes/RDGE/MaterialsLibrary.js +++ b/js/helper-classes/RDGE/MaterialsLibrary.js @@ -141,7 +141,7 @@ var MaterialsLibrary = Object.create(Object.prototype, { case "julia": mat = new JuliaMaterial(); break; case "mandel": mat = new MandelMaterial(); break; case "plasma": mat = new PlasmaMaterial(); break; - case "bumpMetal": mat = new PlasmaMaterial(); break; + case "bumpMetal": mat = new BumpMetalMaterial(); break; case "uber": mat = new UberMaterial(); break; default: -- cgit v1.2.3 From cd997c18bdb346ff44919880239e705df80079ea Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 8 Feb 2012 14:30:56 -0800 Subject: Fix for the PI Lock button. Fixing the following JIRA bugs: 111 Signed-off-by: Valerio Virgillito --- .../position-and-size.reel/position-and-size.js | 94 ++++++++++++++++++---- 1 file changed, 78 insertions(+), 16 deletions(-) diff --git a/js/panels/properties/sections/position-and-size.reel/position-and-size.js b/js/panels/properties/sections/position-and-size.reel/position-and-size.js index 43f08fcf..e539257d 100644 --- a/js/panels/properties/sections/position-and-size.reel/position-and-size.js +++ b/js/panels/properties/sections/position-and-size.reel/position-and-size.js @@ -28,6 +28,14 @@ exports.PosSize = Montage.create(Component, { value: null }, + aspectRatioWidth: { + value: null + }, + + aspectRatioHeight: { + value: null + }, + _disablePosition: { value: true }, @@ -62,9 +70,8 @@ exports.PosSize = Montage.create(Component, { this.widthControl.addEventListener("change", this, false); this.widthControl.addEventListener("changing", this, false); - - //this._controlList[0].control.addEventListener("action", this._handleStageEvent.bind(this), false); - //PropertiesPanelModule.PropertiesPanelBase.PIControlList["stageWidthHeightLock"] = this._controlList[0].control; + this.bindButton.identifier = "ratio"; + this.bindButton.addEventListener("action", this, false); } }, @@ -87,6 +94,25 @@ exports.PosSize = Montage.create(Component, { } }, + /** + * Calculate the current aspect ration when the bind button is pressed. + * If one of the values is 0, then use 1:1 as the ratio; + */ + handleRatioAction: { + value: function() { + if(this.bindButton.value) { + this.aspectRatioWidth = this.heightControl.value / this.widthControl.value; + if(isNaN(this.aspectRatioWidth) || !isFinite(this.aspectRatioWidth) || this.aspectRatioWidth === 0) this.aspectRatioWidth = 1; + + this.aspectRatioHeight = this.widthControl.value / this.heightControl.value; + if(isNaN(this.aspectRatioHeight) || !isFinite(this.aspectRatioHeight) || this.aspectRatioHeight === 0) this.aspectRatioHeight = 1; + } else { + this.aspectRatioWidth = 1; + this.aspectRatioHeight = 1; + } + } + }, + handleLeftChange: { value: function(event) { var prevPosition; @@ -121,6 +147,16 @@ exports.PosSize = Montage.create(Component, { if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; + + if(this.bindButton.value) { + var newWidth = Math.round(this.aspectRatioHeight * this.heightControl.value); + + if(!isFinite(newWidth)) newWidth = this.heightControl.value; + + this.widthControl.value = newWidth; + this.application.ninja.elementMediator.setProperty(items, "width", [newWidth + "px"] , "Change", "pi"); + } + this.application.ninja.elementMediator.setProperty(items, "height", [this.heightControl.value + "px"] , "Change", "pi", prevPosition); this.savedPosition = null; } @@ -135,9 +171,25 @@ exports.PosSize = Montage.create(Component, { if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; - this.application.ninja.elementMediator.setProperty(items, "width", [this.widthControl.value + "px"] , "Change", "pi", prevPosition); - this.savedPosition = null; + + if(this.bindButton.value) { + + var newHeight = Math.round(this.aspectRatioWidth * this.widthControl.value); + + if(!isFinite(newHeight)) newHeight = this.widthControl.value; + + this.heightControl.value = newHeight; + this.application.ninja.elementMediator.setProperty(items, "height", [newHeight + "px"] , "Change", "pi"); + + } else { + + this.application.ninja.elementMediator.setProperty(items, "width", [this.widthControl.value + "px"] , "Change", "pi", prevPosition); + this.savedPosition = null; + } + + } + } }, @@ -166,24 +218,22 @@ exports.PosSize = Montage.create(Component, { var items; if(!event.wasSetByCode) { + if(!this.savedPosition) this.savedPosition = this.heightSize; + + this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; + if(this.bindButton.value) { - if(!this.savedPosition) this.savedPosition = this.heightSize; - var delta = this.heightControl.value - this.savedPosition; - var hwRatio = Math.round(Math.round(this.widthControl.value / this.savedPosition * 10) / 10); - var newWidth = this.widthControl.value + hwRatio * delta; + var newWidth = Math.round(this.aspectRatioHeight * this.heightControl.value); + + if(!isFinite(newWidth)) newWidth = this.heightControl.value; - this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; this.widthControl.value = newWidth; - this.application.ninja.elementMediator.setProperty(items, "height", [this.heightControl.value + "px"] , "Changing", "pi"); this.application.ninja.elementMediator.setProperty(items, "width", [newWidth + "px"] , "Changing", "pi"); - } else { + } - if(!this.savedPosition) this.savedPosition = this.heightSize; + this.application.ninja.elementMediator.setProperty(items, "height", [this.heightControl.value + "px"] , "Changing", "pi"); - this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; - this.application.ninja.elementMediator.setProperty(items, "height", [this.heightControl.value + "px"] , "Changing", "pi"); - } } } }, @@ -192,8 +242,20 @@ exports.PosSize = Montage.create(Component, { value: function(event) { var items; if(!event.wasSetByCode) { + if(!this.savedPosition) this.savedPosition = this.widthSize; + this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; + + if(this.bindButton.value) { + var newHeight = Math.round(this.aspectRatioWidth * this.widthControl.value); + + if(!isFinite(newHeight)) newHeight = this.widthControl.value; + + this.heightControl.value = newHeight; + this.application.ninja.elementMediator.setProperty(items, "height", [newHeight + "px"] , "Changing", "pi"); + } + this.application.ninja.elementMediator.setProperty(items, "width", [this.widthControl.value + "px"] , "Changing", "pi"); } } -- cgit v1.2.3 From 5d4002b7a920a53ea02b0e8caeaec80b804995e4 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 8 Feb 2012 15:12:16 -0800 Subject: Merging fix for marquee selection that accounts for 3d values. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/math-utils.js | 97 +++++++++++++++++++++++++++++++++++++- js/tools/SelectionTool.js | 40 +++++++++++++--- 2 files changed, 129 insertions(+), 8 deletions(-) diff --git a/js/helper-classes/3D/math-utils.js b/js/helper-classes/3D/math-utils.js index 71ed62a0..58f0680a 100644 --- a/js/helper-classes/3D/math-utils.js +++ b/js/helper-classes/3D/math-utils.js @@ -8,7 +8,9 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot // Class Utils // Math Utility functions /////////////////////////////////////////////////////////////////////// -var VecUtils = require("js/helper-classes/3D/vec-utils").VecUtils; +var VecUtils = require("js/helper-classes/3D/vec-utils").VecUtils, + ViewUtils = require("js/helper-classes/3D/view-utils").ViewUtils, + Rectangle = require("js/helper-classes/3D/rectangle").Rectangle; var MathUtilsClass = exports.MathUtilsClass = Object.create(Object.prototype, { /////////////////////////////////////////////////////////////////////// @@ -536,6 +538,99 @@ var MathUtilsClass = exports.MathUtilsClass = Object.create(Object.prototype, { } }, + rectsOverlap: + { + value: function( pt, width, height, elt ) + { + // only consider rectangles with non-zero area + if ((width == 0) || (height == 0)) return false; + + // get the mins/maxs of the onput rectangle + var xMin, xMax, yMin, yMax; + if (width > 0) { xMin = pt[0]; xMax = pt[0] + width; } + else { xMax = pt[0]; xMin = pt[0] + width; } + if (height > 0) { yMin = pt[1]; yMax = pt[1] + height; } + else { yMax = pt[1]; yMin = pt[1] + height; } + + // get the bounds of the element in global screen space + var bounds = ViewUtils.getElementViewBounds3D( elt ); + var bounds3D = []; + for (var i=0; i<4; i++) + bounds3D[i] = ViewUtils.localToGlobal( bounds[i], elt ); + + // get the min/maxs for the element + var xMinElt = bounds3D[0][0], xMaxElt = bounds3D[0][0], + yMinElt = bounds3D[0][1], yMaxElt = bounds3D[0][1]; + for (var i=1; i<4; i++) + { + if (bounds3D[i][0] < xMinElt) xMinElt = bounds3D[i][0]; + else if (bounds3D[i][0] > xMaxElt) xMaxElt = bounds3D[i][0]; + if (bounds3D[i][1] < yMinElt) yMinElt = bounds3D[i][1]; + else if (bounds3D[i][1] > yMaxElt) yMaxElt = bounds3D[i][1]; + } + + // test 1. Overall bounding box test + if ((xMaxElt < xMin) || (xMinElt > xMax) || (yMaxElt < yMin) || (yMinElt > yMax)) + return false; + + // test 2. See if any of the corners of the element are contained in the rectangle + var rect = Object.create(Rectangle, {}); + rect.set( pt[0], pt[1], width, height ); + for (var i=0; i<4; i++) + { + if (rect.contains( bounds3D[i][0], bounds3D[i][1] )) return true; + } + + // test 3. Bounding box tests on individual edges of the element + for (var i=0; i<4; i++) + { + var pt0 = bounds3D[i], + pt1 = bounds3D[(i+1)%4]; + + // get the extremes of the edge + if (pt0[0] < pt1[0]) { xMinElt = pt0[0]; xMaxElt = pt1[0]; } + else { xMaxElt = pt0[0]; xMinElt = pt1[0]; } + if (pt0[1] < pt1[1]) { yMinElt = pt0[1]; yMaxElt = pt1[1]; } + else { yMaxElt = pt0[1]; yMinElt = pt1[1]; } + + if ((xMaxElt < xMin) || (xMinElt > xMax) || (yMaxElt < yMin) || (yMinElt > yMax)) + continue; + else + { + // intersect the element edge with the 4 sides of the rectangle + // vertical edges + var xRect = xMin; + for (var j=0; j<2; j++) + { + if ((xMinElt < xRect) && (xMaxElt > xRect)) + { + var t = (xRect - pt0[0])/(pt1[0] - pt0[0]); + var y = pt0[1] + t*(pt1[1] - pt0[1]); + if ((y >= yMin) && (y <= yMax)) return true; + } + xRect = xMax; + } + + // horizontal edges + var yRect = yMin; + for (var j=0; j<2; j++) + { + if ((yMinElt < yRect) && (yMaxElt > yRect)) + { + var t = (yRect - pt0[1])/(pt1[1] - pt0[1]); + var x = pt0[0] + t*(pt1[0] - pt0[0]); + if ((x >= xMin) && (x <= xMax)) return true; + } + yRect = yMax; + } + } + } + + // if we get here there is no overlap + return false; + } + }, + /////////////////////////////////////////////////////////////////////// // Bezier Methods /////////////////////////////////////////////////////////////////////// diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index 862b2e88..48548271 100644 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -135,18 +135,16 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { var box = []; selectedItems = []; - box[0] = this.downPoint.x - this.application.ninja.stage.documentOffsetLeft + this.application.ninja.stage.scrollLeft; - box[1] = this.downPoint.y - this.application.ninja.stage.documentOffsetTop + this.application.ninja.stage.scrollTop; - box[2] = box[0] + (point.x - this.downPoint.x); - box[3] = box[1] + (point.y - this.downPoint.y); - box = this.absoluteRectangle(box[0], box[1],box[2],box[3]); - + box[0] = this.downPoint.x; + box[1] = this.downPoint.y; + box[2] = point.x; + box[3] = point.y; //selectionManagerModule.selectionManager.marqueeSelection(box); var childNodes = this.application.ninja.currentDocument.documentRoot.childNodes; childNodes = Array.prototype.slice.call(childNodes, 0); childNodes.forEach(function(item) { - if(item.nodeType == 1 && SelectionTool._simpleCollisionDetection(item, box)) { + if(item.nodeType == 1 && SelectionTool._complicatedCollisionDetection(item, box)) { selectedItems.push(item); } }); @@ -802,6 +800,34 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { } }, + // TODO : Use the new element mediator to get element offsets + _complicatedCollisionDetection: + { + value: function(elt, box) + { + var left, top, width, height; + + left = box[0]; + width = box[2] - left; + if (width < 0) + { + left = box[2]; + width = -width; + } + top = box[1]; + height = box[3] - top; + if (height < 0) + { + top = box[3]; + height = -height; + } + + var rtnVal = MathUtils.rectsOverlap( [left,top], width, height, elt ); + + return rtnVal; + } + }, + // TODO : Use the new element mediator to get element offsets _simpleCollisionDetection: { value: function(ele, box){ -- cgit v1.2.3 From 529463fad4cf0a13293187b47e6b5081f3446cad Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Wed, 8 Feb 2012 15:13:25 -0800 Subject: Merging snap manager fix for infinite projection errors when stage view is changed to top or side. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/snap-manager.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 3af7d8cf..0a950658 100644 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js @@ -970,13 +970,12 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { value: function( screenPt, hitRecs ) { // start at the stage. var stage = this.getStage(); - //var stagePt = viewUtils.parentToChild( screenPt, stage ); // the root should be the 'view' canvas, so the first matrix is the camera viewUtils.setViewportObj( stage ); MathUtils.makeDimension3( screenPt ); - this.hSnapToElements( stage, screenPt, hitRecs, 0, screenPt ); + this.hSnapToElements( stage, hitRecs, 0, screenPt ); return; } @@ -984,7 +983,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { hSnapToElements : { - value: function( elt, parentPt, hitRecs, depth, globalScrPt ) + value: function( elt, hitRecs, depth, globalScrPt ) { // hit test the current object var hit; @@ -993,11 +992,9 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { // if the element is in the 2D cache snapping is done there if (elt.elementModel && !elt.elementModel.isIn2DSnapCache) { - var scrPt = viewUtils.parentToChild( parentPt, elt, false ); - hit = this.snapToElement( elt, scrPt, globalScrPt ); + hit = this.snapToElement( elt, globalScrPt ); if (hit) { - //hitRecs.push( hit ); if (!hit.checkType()) { console.log( "invalid hit record: " + hit.getTypeString() ); @@ -1016,17 +1013,14 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { } // test the rest of the tree var n = elt.childElementCount; - var eltPt = viewUtils.parentToChild( parentPt, elt, true ); if (n > 0) { for (var i=0; i span.pp-span-all > span.pp-col-files > span.span-space { background-image: url("../images/panels/project-panel/icon-file-folderopen.png"); background-position: 100% 0px; } +#pp-container-list li.directory.open > span.pp-span-all > span.pp-col-files > span.span-space, .branch-label { background-image: url("../images/panels/project-panel/icon-file-folderopen.png"); background-position: 100% 0px; } #pp-container-list li.directory.closed > span.pp-span-all > span.pp-col-files > span.span-space { background-image: url("../images/panels/project-panel/icon-file-folderclosed.png"); background-position: 100% 0px; } diff --git a/js/components/treeview/ninja-branch.reel/ninja-branch.css b/js/components/treeview/ninja-branch.reel/ninja-branch.css index 6a458cc7..d8c212e8 100644 --- a/js/components/treeview/ninja-branch.reel/ninja-branch.css +++ b/js/components/treeview/ninja-branch.reel/ninja-branch.css @@ -18,14 +18,15 @@ width: 100%; } .treeRoot .branch .branch-label { - border-bottom: 1px solid #505050; - cursor: pointer; - padding: 3px 0 4px; background-repeat: no-repeat; background-position: 3px 2px; - box-shadow: 0 0 0 0 rgba(0,0,0,0); - font-weight: bold; + border-bottom: 1px solid #505050; box-shadow: 0 3px 4px -4px rgba(0,0,0,0.2); + color: #FFF; + cursor: pointer; + font-weight: bold; + padding: 3px 0 4px; + text-shadow: 1px 1px 0 #000; } /* First Level */ diff --git a/js/components/treeview/ninja-leaf.reel/ninja-leaf.css b/js/components/treeview/ninja-leaf.reel/ninja-leaf.css index b2f427b5..085b11e0 100644 --- a/js/components/treeview/ninja-leaf.reel/ninja-leaf.css +++ b/js/components/treeview/ninja-leaf.reel/ninja-leaf.css @@ -19,6 +19,8 @@ /* Second level */ .branch .branch .leaf-label { background-position: 25px center; + box-shadow: 0 3px 4px -4px rgba(0,0,0,0.2); + color: #FFF; padding-left: 45px; } /* Third level */ diff --git a/js/components/treeview/treeview.reel/treeview.html b/js/components/treeview/treeview.reel/treeview.html index d70b016c..4f9e6a72 100644 --- a/js/components/treeview/treeview.reel/treeview.html +++ b/js/components/treeview/treeview.reel/treeview.html @@ -26,7 +26,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "name" : "Branch" }, "defaultLeaf" : { - "module" : "js/components/treeview/presets-leaf.reel", + "module" : "js/components/treeview/leaf.reel", "name" : "Leaf" }, "scrollview": { -- cgit v1.2.3 From 76377d5378c7c23fd3c267fcab91aba39b30c555 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 8 Feb 2012 17:24:46 -0800 Subject: Updating the sass file. Signed-off-by: Valerio Virgillito --- scss/imports/scss/_PanelUI.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scss/imports/scss/_PanelUI.scss b/scss/imports/scss/_PanelUI.scss index 21ada556..ccac99ca 100644 --- a/scss/imports/scss/_PanelUI.scss +++ b/scss/imports/scss/_PanelUI.scss @@ -563,7 +563,7 @@ span.pp-span-all:focus { #pp-container-list span.span-space { background-repeat: no-repeat; } -#pp-container-list li.directory.open > span.pp-span-all > span.pp-col-files > span.span-space { +#pp-container-list li.directory.open > span.pp-span-all > span.pp-col-files > span.span-space, .branch-label { background-image:url("../images/panels/project-panel/icon-file-folderopen.png"); background-position: 100% 0px; } -- cgit v1.2.3 From 88e80d512bdd125e6d604541c291f699bf5df564 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 8 Feb 2012 17:49:02 -0800 Subject: Correcting the PI lock for height which had a bug in the original pull request. Signed-off-by: Valerio Virgillito --- .../sections/position-and-size.reel/position-and-size.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/panels/properties/sections/position-and-size.reel/position-and-size.js b/js/panels/properties/sections/position-and-size.reel/position-and-size.js index e539257d..49117090 100644 --- a/js/panels/properties/sections/position-and-size.reel/position-and-size.js +++ b/js/panels/properties/sections/position-and-size.reel/position-and-size.js @@ -149,6 +149,7 @@ exports.PosSize = Montage.create(Component, { this.application.ninja.selectedElements.length ? items = this.application.ninja.selectedElements : items = [this.application.ninja.currentDocument.documentRoot]; if(this.bindButton.value) { + var newWidth = Math.round(this.aspectRatioHeight * this.heightControl.value); if(!isFinite(newWidth)) newWidth = this.heightControl.value; @@ -181,12 +182,10 @@ exports.PosSize = Montage.create(Component, { this.heightControl.value = newHeight; this.application.ninja.elementMediator.setProperty(items, "height", [newHeight + "px"] , "Change", "pi"); - } else { - - this.application.ninja.elementMediator.setProperty(items, "width", [this.widthControl.value + "px"] , "Change", "pi", prevPosition); - this.savedPosition = null; } + this.application.ninja.elementMediator.setProperty(items, "width", [this.widthControl.value + "px"] , "Change", "pi", prevPosition); + this.savedPosition = null; } -- cgit v1.2.3 From 4bd8b5ce3286d472fd852dc53ef07e90aadfb7e9 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 9 Feb 2012 08:47:33 -0800 Subject: Fixed runtime error when using 3d tools without any items selected. Signed-off-by: Nivesh Rajbhandari --- js/tools/Rotate3DToolBase.js | 2 +- js/tools/RotateStage3DTool.js | 2 +- js/tools/modifier-tool-base.js | 35 +++++++++++++++++++++-------------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/js/tools/Rotate3DToolBase.js b/js/tools/Rotate3DToolBase.js index 6e17864b..aa91b2f4 100644 --- a/js/tools/Rotate3DToolBase.js +++ b/js/tools/Rotate3DToolBase.js @@ -254,7 +254,7 @@ exports.Rotate3DToolBase = Montage.create(ModifierToolBase, { captureSelectionDrawn: { value: function(event){ this._origin = null; - this._targets = null; + this._targets = []; this._startOriginArray = null; var len = this.application.ninja.selectedElements.length; diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js index 6f07adae..ca2a8bf3 100644 --- a/js/tools/RotateStage3DTool.js +++ b/js/tools/RotateStage3DTool.js @@ -83,7 +83,7 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { captureSelectionDrawn: { value: function(event){ this._origin = null; - this._targets = null; + this._targets = []; this._startOriginArray = null; var stage = this.application.ninja.currentDocument.documentRoot; diff --git a/js/tools/modifier-tool-base.js b/js/tools/modifier-tool-base.js index f78e99c8..67b217c4 100644 --- a/js/tools/modifier-tool-base.js +++ b/js/tools/modifier-tool-base.js @@ -437,16 +437,19 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { startDraw: { value: function(event) { - this.isDrawing = true; - this.application.ninja.stage.showSelectionBounds = false; - - if(this._canSnap) - { - this.initializeSnapping(event); - } - else + if(this._target) { - this.drawWithoutSnapping(event); + this.isDrawing = true; + this.application.ninja.stage.showSelectionBounds = false; + + if(this._canSnap) + { + this.initializeSnapping(event); + } + else + { + this.drawWithoutSnapping(event); + } } } }, @@ -674,11 +677,15 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { return this._targets; }, set: function (value) { - this._target = value; - if (value === null) + this._targets = value; + if (value !== null && value.length) { - return; + this.target = value[0]; } + else + { + this.target = null; + } } }, @@ -723,7 +730,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { } else { this.eventManager.removeEventListener("selectionChange", this, true); this.application.ninja.stage._iframeContainer.removeEventListener("scroll", this, false); - this._targets = null; + this._targets = []; // Clean up NJevent("disableStageMove"); @@ -749,7 +756,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { captureSelectionDrawn: { value: function(event){ - this._targets = null; + this._targets = []; var len = this.application.ninja.selectedElements.length; if(len) -- cgit v1.2.3 From 09030b2230631961e972bd3ee8537239741b243d Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 9 Feb 2012 08:50:42 -0800 Subject: Reversed the orientation of one of the triangles for WebGL rendering. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/RDGE/GLLine.js | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/js/helper-classes/RDGE/GLLine.js b/js/helper-classes/RDGE/GLLine.js index bd3cbc26..67379b52 100644 --- a/js/helper-classes/RDGE/GLLine.js +++ b/js/helper-classes/RDGE/GLLine.js @@ -77,11 +77,16 @@ function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, stro this.getStrokeMaterial = function() { return this._strokeMaterial; } this.setStrokeMaterial = function(m) { this._strokeMaterial = m; } - this.getStrokeColor = function() { return this._strokeColor; } + this.getStrokeColor = function() { return this._strokeColor; } //this.setStrokeColor = function(c) { this._strokeColor = c; } - this.getStrokeStyle = function() { return this._strokeStyle; } - this.setStrokeStyle = function(s) { this._strokeStyle = s; } + this.getStrokeStyle = function() { return this._strokeStyle; } + this.setStrokeStyle = function(s) { this._strokeStyle = s; } + + this.getFillMaterial = function() { return null; } + + this.setStrokeMaterial = function(m) { this._strokeMaterial = m; } + this.getStrokeMaterial = function() { return this._strokeMaterial; } this.getWidth = function() { return this._width; } this.setWidth = function(w) { this._width = w; } @@ -184,9 +189,9 @@ function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, stro xFill+x, yFill+y, 0.0, -xFill+x, -yFill+y, 0.0, - xFill+x, yFill+y, 0.0, + xFill+x, -yFill+y, 0.0, -xFill+x, -yFill+y, 0.0, - xFill+x, -yFill+y, 0.0 + xFill+x, yFill+y, 0.0 ]; } else if(this._slope === "horizontal") @@ -199,10 +204,10 @@ function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, stro xFill+x, yFill+y, 0.0, -xFill+x, -yFill+y, 0.0, - xFill+x, yFill+y, 0.0, + xFill+x, -yFill+y, 0.0, -xFill+x, -yFill+y, 0.0, - xFill+x, -yFill+y, 0.0 - ]; + xFill+x, yFill+y, 0.0 + ]; } else if(this._slope > 0) { @@ -212,9 +217,9 @@ function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, stro -xFill+2*xAdj+x, yFill+y, 0.0, xFill-2*xAdj+x, -yFill+y, 0.0, - -xFill+2*xAdj+x, yFill+y, 0.0, + xFill+x, -yFill+2*yAdj+y, 0.0, xFill-2*xAdj+x, -yFill+y, 0.0, - xFill+x, -yFill+2*yAdj+y, 0.0 + -xFill+2*xAdj+x, yFill+y, 0.0 ]; } else @@ -225,9 +230,9 @@ function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, stro -xFill+2*xAdj+x, -yFill+y, 0.0, xFill-2*xAdj+x, yFill+y, 0.0, - -xFill+2*xAdj+x, -yFill+y, 0.0, + xFill+x, yFill-2*yAdj+y, 0.0, xFill-2*xAdj+x, yFill+y, 0.0, - xFill+x, yFill-2*yAdj+y, 0.0 + -xFill+2*xAdj+x, -yFill+y, 0.0 ]; } } -- cgit v1.2.3 From 8b1c3431be14b12ea5f66fe940f579c740784724 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 9 Feb 2012 08:51:04 -0800 Subject: Changed the rendering for canvas 2D rectangle. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/RDGE/GLRectangle.js | 137 +++++++++++++++------------------- 1 file changed, 62 insertions(+), 75 deletions(-) diff --git a/js/helper-classes/RDGE/GLRectangle.js b/js/helper-classes/RDGE/GLRectangle.js index b88ecc71..2f242414 100644 --- a/js/helper-classes/RDGE/GLRectangle.js +++ b/js/helper-classes/RDGE/GLRectangle.js @@ -312,72 +312,71 @@ function GLRectangle() var width = Math.round(this.getWidth()), height = Math.round(this.getHeight()); - // get the top left point pt = [inset, inset]; // top left corner - rad = this.getTLRadius() - inset; - if (rad < 0) rad = 0; - pt[1] += rad; - if (MathUtils.fpSign(rad) == 0) pt[1] = 0; - ctx.moveTo( pt[0], pt[1] ); - - // get the bottom left point - pt = [inset, height - inset]; - rad = this.getBLRadius() - inset; - if (rad < 0) rad = 0; - pt[1] -= rad; - ctx.lineTo( pt[0], pt[1] ); - - // get the bottom left arc - if (MathUtils.fpSign(rad) > 0) - { - ctr = [ this.getBLRadius(), height - this.getBLRadius() ]; - //this.renderQuadraticBezier( MathUtils.circularArcToBezier( ctr, pt, -0.5*Math.PI ), ctx ); - ctx.arc( ctr[0], ctr[1], rad, Math.PI, 0.5*Math.PI, true ); - } - - // do the bottom of the rectangle - pt = [width - inset, height - inset]; - rad = this.getBRRadius() - inset; - if (rad < 0) rad = 0; - pt[0] -= rad; - ctx.lineTo( pt[0], pt[1] ); - - // get the bottom right arc - if (MathUtils.fpSign(rad) > 0) - { - ctr = [width - this.getBRRadius(), height - this.getBRRadius()]; - //this.renderQuadraticBezier( MathUtils.circularArcToBezier( ctr, pt, -0.5*Math.PI ), ctx ); - ctx.arc( ctr[0], ctr[1], rad, 0.5*Math.PI, 0.0, true ); - } - // get the right of the rectangle - pt = [width - inset, inset]; - rad = this.getTRRadius() - inset; - if (rad < 0) rad = 0; - pt[1] += rad; - ctx.lineTo( pt[0], pt[1] ); + var tlRad = this._tlRadius; //top-left radius + var trRad = this._trRadius; + var blRad = this._blRadius; + var brRad = this._brRadius; - // do the top right corner - if (MathUtils.fpSign(rad) > 0) + if ((tlRad <= 0) && (blRad <= 0) && (brRad <= 0) && (trRad <= 0)) { - ctr = [width - this.getTRRadius(), this.getTRRadius()]; - //this.renderQuadraticBezier( MathUtils.circularArcToBezier( ctr, pt, -0.5*Math.PI ), ctx ); - ctx.arc( ctr[0], ctr[1], rad, 0.0, -0.5*Math.PI, true ); + ctx.rect(pt[0], pt[1], width - 2*inset, height - 2*inset); } - - // do the top of the rectangle - pt = [inset, inset] - rad = this.getTLRadius() - inset; - if (rad < 0) rad = 0; - pt[0] += rad; - ctx.lineTo( pt[0], pt[1] ); - - // do the top left corner - if (MathUtils.fpSign(rad) > 0) + else { - ctr = [this.getTLRadius(), this.getTLRadius()]; - //this.renderQuadraticBezier( MathUtils.circularArcToBezier( ctr, pt, -0.5*Math.PI ), ctx ); - ctx.arc( ctr[0], ctr[1], rad, -0.5*Math.PI, Math.PI, true ); + // get the top left point + rad = tlRad - inset; + if (rad < 0) rad = 0; + pt[1] += rad; + if (MathUtils.fpSign(rad) == 0) pt[1] = inset; + ctx.moveTo( pt[0], pt[1] ); + + // get the bottom left point + pt = [inset, height - inset]; + rad = blRad - inset; + if (rad < 0) rad = 0; + pt[1] -= rad; + ctx.lineTo( pt[0], pt[1] ); + + // get the bottom left curve + if (MathUtils.fpSign(rad) > 0) + ctx.quadraticCurveTo( inset, height-inset, inset+rad, height-inset ); + + // do the bottom of the rectangle + pt = [width - inset, height - inset]; + rad = brRad - inset; + if (rad < 0) rad = 0; + pt[0] -= rad; + ctx.lineTo( pt[0], pt[1] ); + + // get the bottom right arc + if (MathUtils.fpSign(rad) > 0) + ctx.quadraticCurveTo( width-inset, height-inset, width-inset, height-inset-rad ); + + // get the right of the rectangle + pt = [width - inset, inset]; + rad = trRad - inset; + if (rad < 0) rad = 0; + pt[1] += rad; + ctx.lineTo( pt[0], pt[1] ); + + // do the top right corner + if (MathUtils.fpSign(rad) > 0) + ctx.quadraticCurveTo( width-inset, inset, width-inset-rad, inset ); + + // do the top of the rectangle + pt = [inset, inset] + rad = tlRad - inset; + if (rad < 0) rad = 0; + pt[0] += rad; + ctx.lineTo( pt[0], pt[1] ); + + // do the top left corner + if (MathUtils.fpSign(rad) > 0) + ctx.quadraticCurveTo( inset, inset, inset, inset+rad ); + else + ctx.lineTo( inset, 2*inset ); } } @@ -396,32 +395,20 @@ function GLRectangle() var w = world.getViewportWidth(), h = world.getViewportHeight(); - // draw the fill + // set the fill ctx.beginPath(); ctx.fillStyle = "#990000"; - //ctx.strokeStyle = "#0000ff"; if (this._fillColor) ctx.fillStyle = MathUtils.colorToHex( this._fillColor ); - //ctx.lineWidth = 0; - //ctx.rect( lw, lw, w - 2*lw, h- 2*lw ); - //this.renderPath( lw, ctx ) - //ctx.fill(); - //ctx.closePath(); - - // draw the stroke - //ctx.beginPath(); - //ctx.fillStyle = "#990000"; + // set the stroke ctx.strokeStyle = "#0000ff"; if (this._strokeColor) ctx.strokeStyle = MathUtils.colorToHex( this._strokeColor ); ctx.lineWidth = lw; - //ctx.rect( 0.5*lw, 0.5*lw, w-lw, h-lw ); var inset = Math.ceil( 0.5*lw ) + 0.5; -// console.log( "linewidth: " + lw + ", inset: " + inset+ ", width: " + Math.round(this.getWidth()) + ", height: " + Math.round(this.getHeight()) ); this.renderPath( inset, ctx ); - //this.renderPath( lw, ctx ); ctx.fill(); ctx.stroke(); ctx.closePath(); @@ -1193,4 +1180,4 @@ ShapePrimitive.create = function(coords, normals, uvs, indices, primType, ver renderer.createPrimitive(prim, vertexCount); return prim; -} \ No newline at end of file +} -- cgit v1.2.3 From e842ce3bdca5460f2dcca253e8882b5509f8a478 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Thu, 9 Feb 2012 09:29:31 -0800 Subject: Updated fav icon to the final image --- images/favicon.png | Bin 1085 -> 564 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/images/favicon.png b/images/favicon.png index b578b2bf..dba96b25 100644 Binary files a/images/favicon.png and b/images/favicon.png differ -- cgit v1.2.3 From 937fcd971085d53e3c44eb9554a2e8597c168f74 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Thu, 9 Feb 2012 09:30:06 -0800 Subject: fixed error with initializing and accessing the ninja version object from the main reel --- js/ninja.reel/ninja.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 90015f5a..469d38f7 100644 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -14,7 +14,7 @@ exports.Ninja = Montage.create(Component, { _preload: { value: false }, ninjaVersion: { - value: window.ninjaVersion.ninja.version + value: null }, toolsData: { value: null }, @@ -34,6 +34,7 @@ exports.Ninja = Montage.create(Component, { templateDidLoad: { value: function() { + this.ninjaVersion = window.ninjaVersion.ninja.version; this.eventManager.addEventListener( "preloadFinish", this, false); } }, -- cgit v1.2.3 From 5708e1728b92c750b9cbdf1b2ff10a8e0e46253c Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Thu, 9 Feb 2012 09:30:42 -0800 Subject: Implemented final splash screen, the credits page and the license page --- credits.html | Bin 0 -> 5692 bytes index.html | 291 ++++++++++++----------------------------------------------- license.html | 52 +++++++++++ 3 files changed, 111 insertions(+), 232 deletions(-) create mode 100644 credits.html create mode 100644 license.html diff --git a/credits.html b/credits.html new file mode 100644 index 00000000..4c7060b4 Binary files /dev/null and b/credits.html differ diff --git a/index.html b/index.html index 53bd6605..306906c2 100644 --- a/index.html +++ b/index.html @@ -8,20 +8,19 @@ - Ninja + Motorola Ninja - +