Fix drawing for very small graph and add new projection for fake maps.

This commit is contained in:
Holt59
2018-03-21 20:39:46 +01:00
parent e2d1d47beb
commit 80b4b1c7fc
5 changed files with 170 additions and 47 deletions

View File

@@ -81,6 +81,31 @@ public class GraphStatistics {
return this.extend(size, size, size, size);
}
/**
* @param point Point to check
*
* @return true if this box contains the given point.
*/
public boolean contains(Point point) {
return this.bottomRight.getLatitude() <= point.getLatitude()
&& this.topLeft.getLatitude() >= point.getLatitude()
&& this.topLeft.getLongitude() <= point.getLongitude()
&& this.bottomRight.getLongitude() >= point.getLongitude();
}
/**
* @return true if this box contains the given box.
*/
public boolean contains(BoundingBox other) {
return this.contains(other.bottomRight) && this.contains(other.topLeft);
}
@Override
public String toString() {
return "BoundingBox(topLeft=" + this.topLeft + ", bottomRight=" + this.bottomRight
+ ")";
}
}
// Bounding box for this graph.