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