mixite icon indicating copy to clipboard operation
mixite copied to clipboard

External Bounding Box has negative height

Open tazdevil78 opened this issue 4 years ago • 1 comments

call to Hexagon.getExternalBoundingBox() returns a negative value for height.

``@Test public void negativeHeight() { HexagonalGridBuilder builder = new HexagonalGridBuilder() .setGridHeight(3) .setGridWidth(3) .setGridLayout(HexagonalGridLayout.HEXAGONAL) .setOrientation(HexagonOrientation.FLAT_TOP) .setRadius(138); HexagonalGrid grid = builder.build(); Hexagon hex = (Hexagon) grid.getHexagons().iterator().next(); Rectangle rect = hex.getExternalBoundingBox(); assertTrue(rect.getHeight()>0); // [207.0, 358.5, 276.0 ,-239.0] }```

tazdevil78 avatar Jan 31 '20 02:01 tazdevil78

height for a flat top hex with a radius of 138 is sqrt(3)*138 = 239. Appears the magnitude is correct, just need to take the abs().

tazdevil78 avatar Jan 31 '20 02:01 tazdevil78