Fix getLongestDelta bug reported by lmctruck.

This commit is contained in:
Major-
2014-07-20 16:31:01 +01:00
parent f58c4784fa
commit 81ddd36662
+2 -2
View File
@@ -160,8 +160,8 @@ public final class Position {
* @return The longest horizontal or vertical delta.
*/
public int getLongestDelta(Position other) {
int deltaX = x - other.x;
int deltaY = y - other.y;
int deltaX = Math.abs(x - other.x);
int deltaY = Math.abs(y - other.y);
return Math.max(deltaX, deltaY);
}