Open tazdevil78 opened 4 years ago
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] }```
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().
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] }```