Skip to content

fix(gui): fix macOS GUI scale ratio and avoid double-scaling minWidth in DefaultSettingsWidgetFactory - #6721

Open
Eccys wants to merge 1 commit into
MeteorDevelopment:masterfrom
Eccys:fix/wide-setting-double-scale
Open

Eccys wants to merge 1 commit into
MeteorDevelopment:masterfrom
Eccys:fix/wide-setting-double-scale

Conversation

@Eccys

@Eccys Eccys commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Type of change

  • Bug fix
  • New feature

Description

  1. In MeteorGuiTheme.scale(double value), the 26.1 Mojmap migration (26.1 Update #6266) replaced mc.getWindow().getWidth() / mc.getWindow().getFramebufferWidth() with mc.getWindow().getWidth() / mc.getWindow().getWidth() (which always evaluates to 1.0). In Mojmap, Window.getScreenWidth() is the window width in screen coordinates and Window.getWidth() is the framebuffer pixel width, so (double) mc.getWindow().getScreenWidth() / mc.getWindow().getWidth() restores the intended macOS Retina scale adjustment.
  2. In DefaultSettingsWidgetFactory, WWidget.calculateSize() scales this.minWidth via theme.scale(this.minWidth). However, both list.minWidth = list.width (after list.calculateSize()) and cell.minWidth(Utils.getWindowWidth() - Utils.getWindowWidth() / 4.0) for setting.wide assign values that are already in scaled framebuffer pixels, causing WWidget.calculateSize() to multiply them by theme.scale(...) a second time (and a third time for setting.wide via list.minWidth). Dividing these pixel widths by theme.scale(1) before assigning minWidth prevents the double-scaling.

Related issues

Fixes #5632

How Has This Been Tested?

Compiled and verified with ./gradlew compileJava.

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

@Eccys
Eccys force-pushed the fix/wide-setting-double-scale branch from f4194ee to 5403ffd Compare October 24, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Very wide settings window for text HUD elements

1 participant