MacOS: Support HiDPI scaling in long filename tooltips #7669
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.
On MacOS, show long filename tooltips in e.g. the Projects pane in proper Retina resolution (2x scaling).
Before:
After:
The relevant improvement had already been made for Windows back in 2016, but seems to have been left unactivated for MacOS, probably because the author didn't have a Mac to test on. The trick is to create the BufferedImage via JComponent.createVolatileImage instead of 'new BufferedImage' (matching my own earlier experience with how HiDPI support in implemented in Swing). I simply removed the !isMac() condition.
The historical commit that introduced the related code is here: eirikbakke/netbeans-releases@707013e#diff-4bc2ee6c72afdca0c960c205bedd2a606eb0657dad93ff82c7a93fbd1d5b0dc5R524
This issue was previously tracked at https://issues.apache.org/jira/browse/NETBEANS-5729