This commit is contained in:
Sean Owen 2021-09-01 22:13:16 -05:00
parent 50ead4f658
commit 6bcae2e5ea

View file

@ -343,7 +343,8 @@ public final class Detector {
int fromX = (int) from.getX(); int fromX = (int) from.getX();
int fromY = (int) from.getY(); int fromY = (int) from.getY();
int toX = (int) to.getX(); int toX = (int) to.getX();
int toY = (int) to.getY(); int toY = Math.min(image.getHeight() - 1, (int) to.getY());
boolean steep = Math.abs(toY - fromY) > Math.abs(toX - fromX); boolean steep = Math.abs(toY - fromY) > Math.abs(toX - fromX);
if (steep) { if (steep) {
int temp = fromX; int temp = fromX;