Commit fa9ea218 authored by Julia Beliaeva's avatar Julia Beliaeva
Browse files

[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.
parent 6ffac988
Branches unavailable Tags unavailable
Showing with 5 additions and 1 deletion
+5 -1
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment