Scale the character with the IDE zoom level (fixes #11) - #12
Open
victorrentea wants to merge 1 commit into
Open
Conversation
ProgressBarUi lays out everything through JBUIScale — bar height, corner radii, the character's own x/y offsets — but the sprites themselves were plain ImageIcons, which always paint their raster at its natural size. So the bar grew with the IDE zoom while Mario stayed 15x21: at 150% he covered two thirds of the bar height, and in presentation mode a lot less. ScaledGifIcon paints the GIF through the width/height overload of drawImage instead. That keeps the animation running (the raster is still a multi-frame Toolkit image driven by the ImageObserver) while following JBUIScale, and it resolves the size on every paint because the IDE zoom can change while the IDE is running. Nearest-neighbour interpolation keeps the sprites looking like pixel art once they are enlarged. No change was needed in ProgressBarUi: its offsets were already scaled, so the characters line up with the bar again on their own.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11.
The problem
ProgressBarUilays out everything throughJBUIScale— the bar height (scale(20)), the corner radii, and even the character's own x/y offsets. The sprites themselves, however, were plainImageIcons, and anImageIconalways paints its raster at the natural size.So the bar grows with the IDE zoom while Mario stays 15×21 forever. At a 150% zoom he covers roughly two thirds of the bar height; in presentation mode (which pushes the zoom higher still) he shrinks to a speck. The Koopa shell in the indeterminate bar has the same problem, and so do the progress bars inside modal dialogs, since they share this UI.
The fix
A small
ScaledGifIconthat paints the GIF through the width/height overload ofdrawImageinstead of the natural-size one:ImageObserver, which is what a repaint-on-frame relies on;ProgressBarUiitself needed no change: its offsets were already scaled, so the characters line up with the bar again on their own.Before / after
Determinate and indeterminate bars at a 150% IDE zoom on a HiDPI screen:
Before
After
Verification
I rendered the real
paintDeterminate/paintIndeterminateoff-screen against IntelliJ IDEA 2026.2, at several zoom levels:At 100% zoom on a non-HiDPI screen the rendering is pixel-identical to the current behaviour, so this is not a restyling — only the zoomed cases change.
Notes
<change-notes>, since those look like they belong to your release flow — happy to add them if you'd prefer them in the same PR.@2xassets insrc/main/resourcesare still unused. They are not needed for this fix: with nearest-neighbour scaling the 1× sprite upscales to exact pixel blocks whenever the total scale factor is an integer (e.g. 150% zoom × 2 for HiDPI = 3×), which is actually cleaner than resampling the pre-doubled@2xraster by 1.5. Worth a separate discussion if you want them put to use.🤖 Generated with Claude Code