aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/draw-utils.js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-06-22 10:59:17 -0700
committerNivesh Rajbhandari2012-06-22 10:59:17 -0700
commit330a954e92dfc95fae6ae5cf10dd5998f346b304 (patch)
treec1d91ad00bf9be0f73d7058a39a434a75a856761 /js/helper-classes/3D/draw-utils.js
parentbf6585a8f8a6abc203c210ba337e7ef260cb87d3 (diff)
downloadninja-330a954e92dfc95fae6ae5cf10dd5998f346b304.tar.gz
Have to guard against cases when stage lines are parallel to the canvas and the line intersection routine returns null.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/helper-classes/3D/draw-utils.js')
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js
index c31424eb..168d550d 100755
--- a/js/helper-classes/3D/draw-utils.js
+++ b/js/helper-classes/3D/draw-utils.js
@@ -1188,10 +1188,15 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
1188 var bounds3D = this.viewUtils.getElementBoundsInGlobal(stageRoot); 1188 var bounds3D = this.viewUtils.getElementBoundsInGlobal(stageRoot);
1189 1189
1190 var l = MathUtils.segSegIntersection2D(bounds3D[0], bounds3D[3], [0, 0, 0], [0, stage.canvas.height, 0], 0.1); 1190 var l = MathUtils.segSegIntersection2D(bounds3D[0], bounds3D[3], [0, 0, 0], [0, stage.canvas.height, 0], 0.1);
1191 if(!l) return;
1191 var r = MathUtils.segSegIntersection2D(bounds3D[0], bounds3D[3], [stage.canvas.width, 0, 0], [stage.canvas.width, stage.canvas.height, 0], 0.1); 1192 var r = MathUtils.segSegIntersection2D(bounds3D[0], bounds3D[3], [stage.canvas.width, 0, 0], [stage.canvas.width, stage.canvas.height, 0], 0.1);
1193 if(!r) return;
1192 1194
1193 var t = MathUtils.segSegIntersection2D(bounds3D[0], bounds3D[1], [0, 0, 0], [stage.canvas.width, 0, 0], 0.1); 1195 var t = MathUtils.segSegIntersection2D(bounds3D[0], bounds3D[1], [0, 0, 0], [stage.canvas.width, 0, 0], 0.1);
1196 if(!t) return;
1194 var b = MathUtils.segSegIntersection2D(bounds3D[0], bounds3D[1], [0, stage.canvas.height, 0], [stage.canvas.width, stage.canvas.height, 0], 0.1); 1197 var b = MathUtils.segSegIntersection2D(bounds3D[0], bounds3D[1], [0, stage.canvas.height, 0], [stage.canvas.width, stage.canvas.height, 0], 0.1);
1198 if(!b) return;
1199
1195 context.save(); 1200 context.save();
1196 context.strokeStyle = "#333"; 1201 context.strokeStyle = "#333";
1197 context.lineWidth = 0.5; 1202 context.lineWidth = 0.5;