Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hexagon geometry #4831

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix horizontal vs vertical offset coords; they got mixed up when movi…
…ng the implementation into HexGrid
  • Loading branch information
kwvanderlinde committed Jun 11, 2024
commit 5e26705dee54af786dc102c24ea4a8a51abccce3
4 changes: 2 additions & 2 deletions src/main/java/net/rptools/maptool/model/HexGrid.java
Original file line number Diff line number Diff line change
Expand Up @@ -626,9 626,9 @@ protected AffineTransform getGridOffset(Token token) {
double coordinateOffsetU = -0.5 * (edgeProjection edgeLength);
if (isHexHorizontal()) {
// Swap x and y;
at.translate(coordinateOffsetU, coordinateOffsetV);
} else {
at.translate(coordinateOffsetV, coordinateOffsetU);
} else {
at.translate(coordinateOffsetU, coordinateOffsetV);
}
}

Expand Down