diff --git a/platform/util/src/com/intellij/util/ui/JBUI.java b/platform/util/src/com/intellij/util/ui/JBUI.java index 58fdf0cd0369..ba1f79a0e208 100644 --- a/platform/util/src/com/intellij/util/ui/JBUI.java +++ b/platform/util/src/com/intellij/util/ui/JBUI.java @@ -970,7 +970,7 @@ public class JBUI { public static ScaleContext create(@Nullable Component component, @Nullable Graphics graphics) { // Component is preferable to Graphics as a scale provider, as it lets the context stick // to the comp's actual scale via the update method. - if (component == null || component.getGraphicsConfiguration() == null) { + if (component == null || (component.getGraphicsConfiguration() == null && graphics instanceof Graphics2D)) { return create((Graphics2D)graphics); } else {