Skip to content

Commit

Permalink
Workaround to height zoom issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
riverwanderer committed Nov 25, 2024
1 parent 97870c7 commit 2b659b7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions vassal-app/src/main/java/VASSAL/build/module/map/Zoomer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1038,8 +1038,13 @@ else if (FIT_WIDTH.equals(cmd)) {
setZoomFactor(vd.getWidth() / md.getWidth());
}
else if (FIT_HEIGHT.equals(cmd)) {
final Dimension vd = map.getView().getVisibleRect().getSize();
final Dimension md = map.mapSize();
// A single pass (see WIDTH above) results in a poor fit for HEIGHT (ref issue #13635)
// Repeating the sequence corrects the issue. FIXME: This is a workaround
Dimension vd = map.getView().getVisibleRect().getSize();
Dimension md = map.mapSize();
setZoomFactor(vd.getHeight() / md.getHeight());
vd = map.getView().getVisibleRect().getSize();
md = map.mapSize();
setZoomFactor(vd.getHeight() / md.getHeight());
}
else if (FIT_VISIBLE.equals(cmd)) {
Expand Down

0 comments on commit 2b659b7

Please sign in to comment.