From 0f16c5ea0d08a740f553284c436bb3e589fb1357 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 1 May 2012 16:49:29 -0700 Subject: Draw a red outline around the stage for reference when rotating stage. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/3D/draw-utils.js | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'js/helper-classes') diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index 81a740e0..88830964 100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js @@ -651,6 +651,21 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { this._lineColor = saveColor; this._drawingContext.lineWidth = saveLineWidth; + if(this.application.ninja.currentDocument.documentRoot.id !== "UserContent") { + // draw an outline around the body + var stagePt = MathUtils.getPointOnPlane([0,0,1,0]); + var stageMat = this.getPlaneToWorldMatrix([0,0,1], stagePt); + // glmat4.multiply( tMat, stageMat, stageMat); + pt0 = [0, 0, 0]; + pt1 = [0, height, 0]; + delta = [width, 0, 0]; + this.drawGridLines(pt0, pt1, delta, stageMat, 2); + pt0 = [0, 0, 0]; + pt1 = [width, 0, 0]; + delta = [0, height, 0]; + this.drawGridLines(pt0, pt1, delta, stageMat, 2); + } + // draw the lines this.redrawGridLines(); @@ -752,12 +767,27 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { this._drawingContext.lineWidth = 0.25; // draw the lines - var nLines = this._gridLineArray.length; + var line, + nLines = this._gridLineArray.length; + if(this.application.ninja.currentDocument.documentRoot.id !== "UserContent") { + nLines = this._gridLineArray.length-4; + } + for (var i = 0; i < nLines; i++) { - var line = this._gridLineArray[i]; + line = this._gridLineArray[i]; this.drawIntersectedLine(line, this._drawingContext); } + if(this.application.ninja.currentDocument.documentRoot.id !== "UserContent") { + this._lineColor = "red"; + i = nLines; + nLines += 4; + for (; i < nLines; i++) { + line = this._gridLineArray[i]; + this.drawIntersectedLine(line, this._drawingContext); + } + } + this.popState(); } }, -- cgit v1.2.3