Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix editor scaling #536

Merged
merged 1 commit into from
Dec 24, 2023
Merged

Fix editor scaling #536

merged 1 commit into from
Dec 24, 2023

Conversation

NebelNidas
Copy link
Member

@NebelNidas NebelNidas commented Dec 24, 2023

  • The editor font actually scales now. It didn't before because of multiple reasons:
    • editor.setFont was called too early. In this state, the editor doesn't have a font applied, so the system default (non-monospaced!) is returned.
    • This didn't matter though, since editor.setContentType("text/enigma-sources") overwrote it anyway with the DefaultFont property defined in EnigmaSyntaxKit (making the DEFAULT_FONT reflection hack redundant, no idea why that existed).
    • DefaultFont is usually set to UiConfig.getFallbackEditorFont(), which intends to scale the default monospace font to the current DPI settings.
    • This didn't work either though, as BasicTweaker#modifyFont only scales UIResources, which Font is not a subclass of.
  • Highlight boxes are now scaled correctly too.

@modmuss50 modmuss50 merged commit e82b5a0 into FabricMC:master Dec 24, 2023
2 checks passed
@NebelNidas NebelNidas deleted the fix-editor-scaling branch March 16, 2024 08:30
ix0rai added a commit to ix0rai/enigma that referenced this pull request Apr 17, 2024
ix0rai added a commit to QuiltMC/enigma that referenced this pull request Apr 22, 2024
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.

2 participants