From fa9ea218cec3d52a1b30ef2894168b76ce168871 Mon Sep 17 00:00:00 2001
From: Julia Beliaeva <Julia.Beliaeva@jetbrains.com>
Date: Mon, 26 Mar 2018 15:25:47 +0300
Subject: [PATCH] [vcs-log] also cache graphics configuration to correctly
 update commit renderer height

When window with log table is moved to another monitor, font does not change, but GraphicsConfiguration does and thus row height should change as well to avoid software scaling.
---
 .../intellij/vcs/log/ui/render/GraphCommitCellRenderer.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/GraphCommitCellRenderer.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/GraphCommitCellRenderer.java
index 99fa0a0e129c..2d6c20a1dbb0 100644
--- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/GraphCommitCellRenderer.java
+++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/GraphCommitCellRenderer.java
@@ -143,6 +143,7 @@ public class GraphCommitCellRenderer extends TypeSafeTableCellRenderer<GraphComm
     @NotNull protected GraphImage myGraphImage = new GraphImage(UIUtil.createImage(1, 1, BufferedImage.TYPE_INT_ARGB), 0);
     @NotNull private Font myFont;
     private int myHeight;
+    private GraphicsConfiguration myConfiguration;
 
     public MyComponent(@NotNull VcsLogData data,
                        @NotNull GraphCellPainter painter,
@@ -157,6 +158,7 @@ public class GraphCommitCellRenderer extends TypeSafeTableCellRenderer<GraphComm
 
       myIssueLinkRenderer = new IssueLinkRenderer(myLogData.getProject(), this);
       myFont = RectanglePainter.getFont();
+      myConfiguration = myGraphTable.getGraphicsConfiguration();
       myHeight = calculateHeight();
     }
 
@@ -248,8 +250,10 @@ public class GraphCommitCellRenderer extends TypeSafeTableCellRenderer<GraphComm
 
     public int getPreferredHeight() {
       Font font = RectanglePainter.getFont();
-      if (myFont != font) {
+      GraphicsConfiguration configuration = myGraphTable.getGraphicsConfiguration();
+      if (myFont != font || myConfiguration != configuration) {
         myFont = font;
+        myConfiguration = configuration;
         myHeight = calculateHeight();
       }
       return myHeight;
-- 
GitLab