Skip to content

Commit

Permalink
Correct calculation for fullscreen window
Browse files Browse the repository at this point in the history
Fix an error in the calculation of the size of
a fullscreen window, where we were using the
current window size in DP instead of converting
it to our 3D world dimensions.
  • Loading branch information
felipeerias committed Aug 21, 2024
1 parent 34e82f7 commit 29e61e4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -666,12 +666,12 @@ public float getCurrentScale() {
boolean isHorizontal = getCurrentAspect() >= 1.0;
if (isHorizontal) {
// horizontal orientation
mainAxisCurrent = getWindowWidth() - mBorderWidth * 2;
mainAxisCurrent = (getWindowWidth() - mBorderWidth * 2) * WidgetPlacement.worldToDpRatio(getContext());
mainAxisDefault = WidgetPlacement.floatDimension(getContext(), R.dimen.window_world_width);
mainAxisMinMax = Pair.create(minWorldSize.first, maxWorldSize.first);
} else {
// vertical orientation
mainAxisCurrent = getWindowHeight() - mBorderWidth * 2;
mainAxisCurrent = (getWindowHeight() - mBorderWidth * 2) * WidgetPlacement.worldToDpRatio(getContext());
mainAxisDefault = WidgetPlacement.floatDimension(getContext(), R.dimen.window_world_width) * getCurrentAspect();
mainAxisMinMax = Pair.create(minWorldSize.second, maxWorldSize.second);
}
Expand Down

0 comments on commit 29e61e4

Please sign in to comment.