Khan/khan-exercises — pull request #7821 by majek (2011-12-05 18:22:08+00:00)
Title: Fix #4965: Make sure the labels aren't too close to each other.

First, make sure that both points aren't in the same line - this is the simplest solution (the alternative is to ensure that the distance from each other is > 6 when X1 > X2)

Next, as we hardcode that label for x1 shall be on left and x2 on right, we may predict forbidden positions. The first point (label on left) shall not go too far left and shall avoid positions on the right of the Y axis.
Similarly X2 (label on right) shall avoid positions on the left of Y axis (note that, in 3 quater the coordinates take more space due to two minuses, like: -4 -4, so we have to forbid column -4 as well) and close to right border.

On the Y axis, we should just make sure that we don't collide with axis labels - it's enough to avoid line -1.

All that makes the exercise a bit harder (labels from -10, not -8, small numbers are now less probable).