From 7f608b28d29116e02a2e4cb7db71f0eb74158c12 Mon Sep 17 00:00:00 2001 From: Anton Tarasov Date: Wed, 20 Sep 2017 18:10:08 +0300 Subject: [PATCH] IDEA-171404 [followup] allow UI scale exceed 2x --- platform/util/src/com/intellij/util/ui/JBUI.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/platform/util/src/com/intellij/util/ui/JBUI.java b/platform/util/src/com/intellij/util/ui/JBUI.java index 129229317626..4c8e36898ee2 100644 --- a/platform/util/src/com/intellij/util/ui/JBUI.java +++ b/platform/util/src/com/intellij/util/ui/JBUI.java @@ -673,6 +673,17 @@ public class JBUI { * the context scale ({@link BaseScaleContext#usrScale}) or something else. */ protected abstract double currentScale(); + + /** + * Synchronizes the state with the provided scaler. + * + * @return whether the state has been updated + */ + public boolean update(@NotNull Scaler scaler) { + boolean updated = initialScale != scaler.initialScale; + initialScale = scaler.initialScale; + return updated; + } } /** @@ -1053,6 +1064,7 @@ public class JBUI { protected JBIcon(JBIcon icon) { this(); updateScaleContext(icon.getScaleContext()); + myScaler.update(icon.myScaler); } protected boolean isIconPreScaled() {