diff options
author | Nivesh Rajbhandari | 2012-06-22 10:59:17 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-06-22 10:59:17 -0700 |
commit | 330a954e92dfc95fae6ae5cf10dd5998f346b304 (patch) | |
tree | c1d91ad00bf9be0f73d7058a39a434a75a856761 /js/helper-classes/3D | |
parent | bf6585a8f8a6abc203c210ba337e7ef260cb87d3 (diff) | |
download | ninja-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')
-rwxr-xr-x | js/helper-classes/3D/draw-utils.js | 5 |
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; |