Skip to content

Commit

Permalink
Correct screen size override
Browse files Browse the repository at this point in the history
The screen size override needs to use the DPI as reference, not the density.

For websites, screen.width and screen.height must be always greater or equal
than window.innerWidth and window.innerHeight, otherwise there could be
layout issues as the Wolvic window becomes too large.

Fixes #1517
  • Loading branch information
felipeerias committed Aug 22, 2024
1 parent 29e61e4 commit 2eb4a79
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ object EngineProvider {
.build())
builder.displayDensityOverride(settingsStore.displayDensity)
builder.displayDpiOverride(settingsStore.displayDpi)
// This calculation ensures that screen.width and screen.height are always greater or
// equal than window.innerWidth and window.innerHeight, even with different densities.
builder.screenSizeOverride(
(settingsStore.maxWindowWidth * settingsStore.displayDensity).toInt(),
(settingsStore.maxWindowHeight * settingsStore.displayDensity).toInt()
(settingsStore.maxWindowWidth * settingsStore.displayDpi / 100.0).toInt(),
(settingsStore.maxWindowHeight * settingsStore.displayDpi / 100.0).toInt()
)
builder.enterpriseRootsEnabled(settingsStore.isSystemRootCAEnabled)
builder.inputAutoZoomEnabled(false)
Expand Down

0 comments on commit 2eb4a79

Please sign in to comment.