QuiltMC / enigma

A deobfuscation/remapping tool for Java bytecode, fork of cuchaz's Enigma.
GNU Lesser General Public License v3.0
56 stars 31 forks source link

Fix (most) scaling #222

Closed supersaiyansubtlety closed 1 month ago

supersaiyansubtlety commented 1 month ago

Removes ScaleUtil::rescaleFontInConfig

It scaled fonts in addition to ScaleUtil::scaleFont, and it didn't account for switching themes. If you increased scale on one theme, its fonts would be scaled to match. But if you switched themes, the previous theme would keep its scaled fonts and the new theme would not have scaled fonts. If you then decreased scale on the new theme, its fonts would be scaled down (and they'd never been scaled up because the scale increase happened on another theme).

This makes the font sizes in theme configs 'base' sizes before main.toml's scale is applied.

Fixes Theme's editor font size getting overwritten (and being read twice)

It was read and set first in Config::updateSyntaxpain. Then it was read again in ScaleUtil::applyScaling and its size was explicitly set to 12 and scaled with main.toml's scale.

Now its read in Config::updateSyntaxpain, and ScaleUtil::applyScaling gets the syntaxpain's current font (already set from config), gets its size, and scales it with main.toml's scale.

Fixes DockerButton scaled size+position for flatlaf themes

Broken since #216 (oops). Buttons were already manually scaled+positioned to account for text width, I just added the same thing for text height.

Fixes icon scaling for flatlaf themes

Also broken since #216 (oops). Instead of skipping all scaling for flatlaf themes in ScaleUtil::applyScaling, they now have their fonts scaled.

ix0rai commented 1 month ago

interface scales flawlessly on my laptop, thank you so much!