From 6df664320d6acc489ca0f0f6d99f58d5851a0890 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Fri, 22 Jun 2012 14:15:09 -0700 Subject: fixed a small startup issue with the RDGE library. --- js/helper-classes/RDGE/rdge-compiled.js | 12 ++++++------ js/helper-classes/RDGE/src/core/script/runtime.js | 6 +++++- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'js/helper-classes') diff --git a/js/helper-classes/RDGE/rdge-compiled.js b/js/helper-classes/RDGE/rdge-compiled.js index 0bbcb05b..53a99c35 100755 --- a/js/helper-classes/RDGE/rdge-compiled.js +++ b/js/helper-classes/RDGE/rdge-compiled.js @@ -248,13 +248,13 @@ RDGE.SceneGraph.prototype.insertAbove=function(a,b){RDGE.verifyTransformNode(a); RDGE.SceneGraph.prototype._TraverseDFHelper=function(a,b,c){if("undefined"!=b.children){var d=[];for(d.push({node:b,parent:null});0 --- js/helper-classes/3D/draw-utils.js | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'js/helper-classes') diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index bd47ffc3..87151964 100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js @@ -1185,8 +1185,38 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { var context = this.application.ninja.stage.gridContext; var stage = this.application.ninja.stage; var stageRoot = this.application.ninja.currentDocument.model.documentRoot; - var bounds3D = this.viewUtils.getElementBoundsInGlobal(stageRoot); + // draw an outline around the template body if stage has any transforms + if(stage.currentDocument.model.views.design._template && !MathUtils.isIdentityMatrix(this.viewUtils.getMatrixFromElement(stageRoot))) { + var saveContext = this.getDrawingSurfaceElement(); + this.setDrawingSurfaceElement(this.application.ninja.stage.gridCanvas); + + var stagePt = MathUtils.getPointOnPlane([0,0,1,0]); + var stageMat = this.getPlaneToWorldMatrix([0,0,1], stagePt); + var width = this.snapManager.getStageWidth(), + height = this.snapManager.getStageHeight(), + pt0 = [0, 0, 0], + pt1 = [0, height, 0], + delta = [width, 0, 0]; + + this._gridLineArray.length = 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); + + this._lineColor = "red"; + for (var i = 0; i < 4; i++) { + this.drawIntersectedLine(this._gridLineArray[i], this._drawingContext); + } + + this.setDrawingSurfaceElement(saveContext); + } + + // draw reference lines across origin + var bounds3D = this.viewUtils.getElementBoundsInGlobal(stageRoot); var l = MathUtils.segSegIntersection2D(bounds3D[0], bounds3D[3], [0, 0, 0], [0, stage.canvas.height, 0], 0.1); if(!l) return; var r = MathUtils.segSegIntersection2D(bounds3D[0], bounds3D[3], [stage.canvas.width, 0, 0], [stage.canvas.width, stage.canvas.height, 0], 0.1); -- cgit v1.2.3