From 648ee61ae84216d0236e0dbc211addc13b2cfa3a Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 11:52:06 -0700 Subject: Expand tabs --- js/stage/layout.js | 2 +- js/stage/stage-deps.js | 16 +++--- js/stage/stage.reel/stage.js | 114 +++++++++++++++++++++---------------------- js/stage/tool-handle.js | 10 ++-- 4 files changed, 71 insertions(+), 71 deletions(-) (limited to 'js/stage') diff --git a/js/stage/layout.js b/js/stage/layout.js index 650d448f..3fcfe9eb 100755 --- a/js/stage/layout.js +++ b/js/stage/layout.js @@ -221,7 +221,7 @@ exports.Layout = Montage.create(Component, { var zoomFactor = 1; if (this.stage._viewport && this.stage._viewport.style && this.stage._viewport.style.zoom) { - zoomFactor = Number(this.stage._viewport.style.zoom); + zoomFactor = Number(this.stage._viewport.style.zoom); } var sSL = this.stage._scrollLeft; diff --git a/js/stage/stage-deps.js b/js/stage/stage-deps.js index 058c6dbc..73164013 100755 --- a/js/stage/stage-deps.js +++ b/js/stage/stage-deps.js @@ -28,14 +28,14 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component, - snapManager = require("js/helper-classes/3D/snap-manager").SnapManager, - viewUtils = require("js/helper-classes/3D/view-utils").ViewUtils, - drawUtils = require("js/helper-classes/3D/draw-utils").DrawUtils, - ElementPlanes = require("js/helper-classes/3D/element-planes").ElementPlanes, - MathUtilsClass = require("js/helper-classes/3D/math-utils").MathUtilsClass, - VecUtils = require("js/helper-classes/3D/vec-utils").VecUtils; +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component, + snapManager = require("js/helper-classes/3D/snap-manager").SnapManager, + viewUtils = require("js/helper-classes/3D/view-utils").ViewUtils, + drawUtils = require("js/helper-classes/3D/draw-utils").DrawUtils, + ElementPlanes = require("js/helper-classes/3D/element-planes").ElementPlanes, + MathUtilsClass = require("js/helper-classes/3D/math-utils").MathUtilsClass, + VecUtils = require("js/helper-classes/3D/vec-utils").VecUtils; exports.StageDeps = Montage.create(Component, { diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 86df0903..67ce5081 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js @@ -28,10 +28,10 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -var Montage = require("montage/core/core").Montage, +var Montage = require("montage/core/core").Montage, Component = require("montage/ui/component").Component, drawUtils = require("js/helper-classes/3D/draw-utils").DrawUtils, - vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils; + vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils; exports.Stage = Montage.create(Component, { @@ -65,13 +65,13 @@ exports.Stage = Montage.create(Component, { _resizeCanvases: { value: true }, - viewUtils: { - get: function() { return this.stageDeps.viewUtils; } - }, + viewUtils: { + get: function() { return this.stageDeps.viewUtils; } + }, - snapManager: { - get: function() { return this.stageDeps.snapManager; } - }, + snapManager: { + get: function() { return this.stageDeps.snapManager; } + }, drawUtils: { get: function() { return this.stageDeps.drawUtils; } @@ -895,16 +895,16 @@ exports.Stage = Montage.create(Component, { this._drawingContext.strokeStyle = this._canvasDrawingPrefs.color; this._drawingContext.lineWidth = this._canvasDrawingPrefs.thickness; - //this._drawingContext.strokeRect(x,y,w,h); - this._drawingContext.beginPath(); - this._drawingContext.moveTo( x0 + 0.5, y0 + 0.5 ); - this._drawingContext.lineTo( x1 + 0.5, y1 + 0.5 ); - this._drawingContext.lineTo( x2 + 0.5, y2 + 0.5 ); - this._drawingContext.lineTo( x3 + 0.5, y3 + 0.5 ); - this._drawingContext.lineTo( x0 + 0.5, y0 + 0.5 ); + //this._drawingContext.strokeRect(x,y,w,h); + this._drawingContext.beginPath(); + this._drawingContext.moveTo( x0 + 0.5, y0 + 0.5 ); + this._drawingContext.lineTo( x1 + 0.5, y1 + 0.5 ); + this._drawingContext.lineTo( x2 + 0.5, y2 + 0.5 ); + this._drawingContext.lineTo( x3 + 0.5, y3 + 0.5 ); + this._drawingContext.lineTo( x0 + 0.5, y0 + 0.5 ); - this._drawingContext.closePath(); - this._drawingContext.stroke(); + this._drawingContext.closePath(); + this._drawingContext.stroke(); this._drawingContext.font = "10px sans-serif"; this._drawingContext.textAlign = "right"; @@ -946,7 +946,7 @@ exports.Stage = Montage.create(Component, { var zoomFactor = 1; if (this._viewport && this._viewport.style && this._viewport.style.zoom) { - zoomFactor = Number(this._viewport.style.zoom); + zoomFactor = Number(this._viewport.style.zoom); } var tmpMat = this.stageDeps.viewUtils.getLocalToGlobalMatrix( elt ); @@ -1088,9 +1088,9 @@ exports.Stage = Montage.create(Component, { /** * draw3DProjectedAndUnprojectedRectangles -- Draws a 3D rectangle used for marquee selection. - * Draws a second rectangle to indicate the projected - * location of the created geometry - * Uses the _canvasDrawingPrefs for line thickness and color + * Draws a second rectangle to indicate the projected + * location of the created geometry + * Uses the _canvasDrawingPrefs for line thickness and color * * @params: x, y, w, h */ @@ -1100,24 +1100,24 @@ exports.Stage = Montage.create(Component, { this._drawingContext.strokeStyle = this._canvasDrawingPrefs.color; this._drawingContext.lineWidth = this._canvasDrawingPrefs.thickness; - this._drawingContext.beginPath(); - var x0 = unProjPts[0][0], y0 = unProjPts[0][1], - x1 = unProjPts[1][0], y1 = unProjPts[1][1], - x2 = unProjPts[2][0], y2 = unProjPts[2][1], - x3 = unProjPts[3][0], y3 = unProjPts[3][1]; - this._drawingContext.moveTo( x0 + 0.5, y0 + 0.5 ); - this._drawingContext.lineTo( x1 + 0.5, y1 + 0.5 ); - this._drawingContext.lineTo( x2 + 0.5, y2 + 0.5 ); - this._drawingContext.lineTo( x3 + 0.5, y3 + 0.5 ); - this._drawingContext.lineTo( x0 + 0.5, y0 + 0.5 ); + this._drawingContext.beginPath(); + var x0 = unProjPts[0][0], y0 = unProjPts[0][1], + x1 = unProjPts[1][0], y1 = unProjPts[1][1], + x2 = unProjPts[2][0], y2 = unProjPts[2][1], + x3 = unProjPts[3][0], y3 = unProjPts[3][1]; + this._drawingContext.moveTo( x0 + 0.5, y0 + 0.5 ); + this._drawingContext.lineTo( x1 + 0.5, y1 + 0.5 ); + this._drawingContext.lineTo( x2 + 0.5, y2 + 0.5 ); + this._drawingContext.lineTo( x3 + 0.5, y3 + 0.5 ); + this._drawingContext.lineTo( x0 + 0.5, y0 + 0.5 ); - this._drawingContext.closePath(); - this._drawingContext.stroke(); + this._drawingContext.closePath(); + this._drawingContext.stroke(); this.stageDeps.snapManager.drawDashedLine( projPts[0], projPts[1], this._drawingContext ); - this.stageDeps.snapManager.drawDashedLine( projPts[1], projPts[2], this._drawingContext ); - this.stageDeps.snapManager.drawDashedLine( projPts[2], projPts[3], this._drawingContext ); - this.stageDeps.snapManager.drawDashedLine( projPts[3], projPts[0], this._drawingContext ); + this.stageDeps.snapManager.drawDashedLine( projPts[1], projPts[2], this._drawingContext ); + this.stageDeps.snapManager.drawDashedLine( projPts[2], projPts[3], this._drawingContext ); + this.stageDeps.snapManager.drawDashedLine( projPts[3], projPts[0], this._drawingContext ); this._drawingContext.font = "10px sans-serif"; this._drawingContext.textAlign = "right"; @@ -1216,14 +1216,14 @@ exports.Stage = Montage.create(Component, { { var w = this._canvas.width, h = this._canvas.height; - var globalPt = [w/2, h/2, 0]; + var globalPt = [w/2, h/2, 0]; this.stageDeps.viewUtils.setStageZoom( globalPt, value/100 ); //TODO - Maybe move to mediator. - var newVal = value/100.0; - if (newVal >= 1) - this.currentDocument.model.views.design.iframe.style.zoom = value/100; + var newVal = value/100.0; + if (newVal >= 1) + this.currentDocument.model.views.design.iframe.style.zoom = value/100; this.updatedStage = true; @@ -1233,35 +1233,35 @@ exports.Stage = Montage.create(Component, { } }, - getPlaneForView: - { - value: function( side ) - { - var plane = [0,0,1,0]; + getPlaneForView: + { + value: function( side ) + { + var plane = [0,0,1,0]; switch(side) - { + { case "top": - plane = [0,1,0,0]; - plane[3] = this.currentDocument.model.documentRoot.offsetHeight / 2.0; + plane = [0,1,0,0]; + plane[3] = this.currentDocument.model.documentRoot.offsetHeight / 2.0; break; case "side": - plane = [1,0,0,0]; - plane[3] = this.currentDocument.model.documentRoot.offsetWidth / 2.0; + plane = [1,0,0,0]; + plane[3] = this.currentDocument.model.documentRoot.offsetWidth / 2.0; break; case "front": plane = [0,0,1,0]; break; - default: - console.log( "unrecognized view in snapManager.getPlaneForView: " + side ); - break; + default: + console.log( "unrecognized view in snapManager.getPlaneForView: " + side ); + break; } - return plane; - } - }, + return plane; + } + }, setStageView: { value: function(side) { @@ -1292,7 +1292,7 @@ exports.Stage = Montage.create(Component, { drawUtils.drawXY = isDrawingGrid; break; } - workingPlane = this.getPlaneForView( side ); + workingPlane = this.getPlaneForView( side ); this.stageDeps.viewUtils.setMatrixForElement(currentDoc, mat, false); diff --git a/js/stage/tool-handle.js b/js/stage/tool-handle.js index 5ce243ff..e5b0a22f 100755 --- a/js/stage/tool-handle.js +++ b/js/stage/tool-handle.js @@ -736,14 +736,14 @@ exports.TranslateHandle = Montage.create(ToolHandle, { }, collidesWithPoint: - { + { value:function (x, y) - { + { var globalPt = [x, y, this._origin[2]]; - // test for a hit on the origin - var dist = vecUtils.vecDist( 2, globalPt, this._origin ); - if (dist <= 5) return 1; + // test for a hit on the origin + var dist = vecUtils.vecDist( 2, globalPt, this._origin ); + if (dist <= 5) return 1; var nearPt = MathUtils.nearestPointOnLine2D( this._origin, this._dirVec, globalPt ); if(!nearPt) -- cgit v1.2.3 From 04343eda8c2f870b0da55cfdc8003c99fe1cc4de Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 11:53:10 -0700 Subject: Remove trailing spaces --- js/stage/layout.js | 4 ++-- js/stage/objects-tray.reel/objects-tray.js | 10 +++++----- js/stage/stage.reel/stage.js | 2 +- js/stage/tool-handle.js | 28 ++++++++++++++-------------- 4 files changed, 22 insertions(+), 22 deletions(-) (limited to 'js/stage') diff --git a/js/stage/layout.js b/js/stage/layout.js index 3fcfe9eb..bf7e79c3 100755 --- a/js/stage/layout.js +++ b/js/stage/layout.js @@ -309,7 +309,7 @@ exports.Layout = Montage.create(Component, { { return; } - + try { if(element.nodeType == 1 && this.application.ninja.currentDocument.inExclusion(element) === -1 ) { @@ -393,5 +393,5 @@ exports.Layout = Montage.create(Component, { } } - + }); diff --git a/js/stage/objects-tray.reel/objects-tray.js b/js/stage/objects-tray.reel/objects-tray.js index 2494c2b5..d81c2a8c 100644 --- a/js/stage/objects-tray.reel/objects-tray.js +++ b/js/stage/objects-tray.reel/objects-tray.js @@ -46,19 +46,19 @@ exports.ObjectsTray = Montage.create(Component, { offStageObjectsController : { value: null }, - + _showAllObjects : { value: null }, showAllObjects : { get : function() { return this._showAllObjects; }, set : function(value) { if(value === this._showAllObjects) { return; } - + this._showAllObjects = value; - + this.needsDraw = true; } }, - + workspaceMode : { get : function() { return this._workspaceMode; }, set : function(value) { @@ -119,7 +119,7 @@ exports.ObjectsTray = Montage.create(Component, { Draw Cycle --------------------- */ - templateDidLoad: { + templateDidLoad: { value: function() { this.offStageObjectsController.filterFunction = this.offStageObjectFilter.bind(this); } diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 67ce5081..49e7b641 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js @@ -567,7 +567,7 @@ exports.Stage = Montage.create(Component, { this._clickPoint.y = point.y; // event.layerY; this.enableMouseInOut(); - + this.application.ninja.toolsData.selectedToolInstance.downPoint.x = point.x; this.application.ninja.toolsData.selectedToolInstance.downPoint.y = point.y; this.application.ninja.toolsData.selectedToolInstance.HandleLeftButtonDown(event); diff --git a/js/stage/tool-handle.js b/js/stage/tool-handle.js index e5b0a22f..ecd16951 100755 --- a/js/stage/tool-handle.js +++ b/js/stage/tool-handle.js @@ -111,7 +111,7 @@ var ToolHandle = exports.ToolHandle = Montage.create(Component, { return true; } } - + }); @@ -302,7 +302,7 @@ exports.RotateHandle = Montage.create(ToolHandle, { this._planeEq[3] = -vecUtils.vecDot(3, this._planeEq, this._origin); this._dirVecL = MathUtils.transformPoint(this._dirVec, this._matL); - + context.beginPath(); var pt = [this._radius, 0.0, 0.0]; @@ -322,7 +322,7 @@ exports.RotateHandle = Montage.create(ToolHandle, { // Draw the transform handle context.beginPath(); - + pt = [this._transformCenterRadius, 0.0, 0.0]; for (var i=0; i +