mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[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.
This commit is contained in:
+5
-1
@@ -140,6 +140,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,
|
||||
@@ -154,6 +155,7 @@ public class GraphCommitCellRenderer extends TypeSafeTableCellRenderer<GraphComm
|
||||
|
||||
myIssueLinkRenderer = new IssueLinkRenderer(myLogData.getProject(), this);
|
||||
myFont = RectanglePainter.getFont();
|
||||
myConfiguration = myGraphTable.getGraphicsConfiguration();
|
||||
myHeight = calculateHeight();
|
||||
}
|
||||
|
||||
@@ -236,8 +238,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;
|
||||
|
||||
Reference in New Issue
Block a user