Skip to content

Commit 07ea7e9

Browse files
committed
Prevent exception in DrawLine for meridians
Reject coordinates out of drawing bounds
1 parent a12deb2 commit 07ea7e9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

solution/GraphicalDebugging/Viewport.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ public static bool DrawAxes(Graphics graphics, Geometry.Box box, Geometry.Unit u
740740
// NOTE: For bug coordinates anti_mer_step may be 0 which results in infinite loop
741741
&& Util.Assign(ref anti_mer_f, anti_mer_f + anti_mer_step))
742742
{
743-
if (anti_mer_f >= 0)
743+
if (anti_mer_f >= 0 && anti_mer_f <= w)
744744
{
745745
graphics.DrawLine(anti_pen, anti_mer_f, 0, anti_mer_f, h);
746746
}
@@ -751,7 +751,7 @@ public static bool DrawAxes(Graphics graphics, Geometry.Box box, Geometry.Unit u
751751
// NOTE: For bug coordinates anti_mer_step may be 0 which results in infinite loop
752752
&& Util.Assign(ref prime_mer_f, prime_mer_f += prime_mer_step))
753753
{
754-
if (prime_mer_f >= 0)
754+
if (prime_mer_f >= 0 && prime_mer_f <= w)
755755
{
756756
graphics.DrawLine(prime_pen, prime_mer_f, 0, prime_mer_f, h);
757757
primeMeridiansDrawn = true;

solution/GraphicalDebugging/release_notes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ version 0.53
33
bugfixes:
44
- fixed handling of debugger context change, e.g. on call stack
55
- fixed selection and text edit colors
6+
- fixed visualization of very small geographic areas
67

78
additions:
89
- expression error in Type column

0 commit comments

Comments
 (0)