From 29e61e4d0b1db8fe0e7a4469f6323fc3721512f5 Mon Sep 17 00:00:00 2001 From: Felipe Erias Date: Wed, 21 Aug 2024 06:20:11 +0900 Subject: [PATCH] Correct calculation for fullscreen window 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. --- .../shared/com/igalia/wolvic/ui/widgets/WindowWidget.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/common/shared/com/igalia/wolvic/ui/widgets/WindowWidget.java b/app/src/common/shared/com/igalia/wolvic/ui/widgets/WindowWidget.java index 6b78a80741..52f46ad963 100644 --- a/app/src/common/shared/com/igalia/wolvic/ui/widgets/WindowWidget.java +++ b/app/src/common/shared/com/igalia/wolvic/ui/widgets/WindowWidget.java @@ -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); }