As I interpret the documentation, getY() is supposed to return the upper-left hand Y coordinate of a rectangle; i.e the biggest Y coordinate. However, when calling getMaxY() (which is inherited from the RectangularShape class) I get back a bigger value!
In code:
Path2D bg = polygons.get(polyId2GeoId.get(id));
Rectangle2D bgBox = bg.getBounds2D();
boolean omgwtfbbqrsvp = bgBox.getY()<bgBox.getMaxY();
omgwtfbbqrsvp is true... What am I missing here?
My x values contain negative numbers idk if that makes a difference. It sames like bgBox.getY() == bgBox.getMinY() (which is wrong if getY is upper coord) but bgBox.getX() == bgBox.getMinX() (which is correct if getX is left coord). The heights and widths appear correct.
Thanks!
The problem is that the coordinate system used here has its point (0,0) on the upper left corner. The point (n,n) is on the lower right corner.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With