-
Notifications
You must be signed in to change notification settings - Fork 0
Description
This problem affects all our plugins.
First discovered in xdev-software/intellij-plugin-openrewriter#19 (complete description)
Tracked upstream by https://youtrack.jetbrains.com/issue/IDEA-354465
Short summary
Steps to reproduce
- Install a plugin such as OpenRewriter X
- Enable the "New UI"
- Open the "Switcher" (Ctrl + Tab) or "Recent Files" (Ctrl + E)
Expected result (correct result):
Actual result (faulty result):
icon is rendered with expected size, like it was in 2023.2:
Additional information
There seems to be a problem with how the icon scaling is applied inside https://github.com/JetBrains/intellij-community/blob/def6433a5dd9f0a984cbc6e2835d27c97f2cb5f0/platform/platform-impl/src/com/intellij/ide/actions/SwitcherRendering.kt#L113-L119
New versions of IDEA (some time after 2023.2) use CachedImageIcon while 2023.2 used ToolWindowIcon for window.icon.
The scaling of CachedImageIcon seems to be applied incorrectly in this context apparently using the following scheme:
16 (reference width)/13 (incorrect detected width of CachedImageIcon) * 512 (actual width of icon), which results in 630 instead of the expected 16
Applied Counter-Measures/Workarounds
- Fix pluginIcon to a size of 16 so that broken scaling is not invoked
- like this:
<svg width="16" height="16" viewBox="0 0 40 40" style="fill:none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
- like this:
- Release new version of plugins ASAP as IDEA 2024.2 will enable "New UI" by default