Browse Source

REPORT-3959 [9.0一轮回归]行(列)隐藏时行(列)号依然显示

master
MoMeak 7 years ago
parent
commit
3ea73837dc
  1. 8
      designer/src/com/fr/grid/GridColumnUI.java
  2. 7
      designer/src/com/fr/grid/GridRowUI.java

8
designer/src/com/fr/grid/GridColumnUI.java

@ -163,11 +163,11 @@ public class GridColumnUI extends ComponentUI {
float time = (float)resolution/ScreenResolution.getScreenResolution();
double stringWidth = gridColumn.getFont().getStringBounds(columnContent, fontRenderContext).getWidth() * time;
// if (stringWidth > tmpIncreaseWidth) {
// paintMoreContent(i, g2d, tmpWidth1, size, tmpIncreaseWidth, isSelectedBounds, gridColumn, elementCase, columnContent, stringWidth, fmAscent);
// } else {
if (stringWidth > tmpIncreaseWidth) {
paintMoreContent(i, g2d, tmpWidth1, size, tmpIncreaseWidth, isSelectedBounds, gridColumn, elementCase, columnContent, stringWidth, fmAscent);
} else {
paintNormalContent(i, g2d, tmpWidth1, tmpIncreaseWidth, isSelectedBounds, gridColumn, elementCase, columnContent, stringWidth, fmAscent);
// }
}
}

7
designer/src/com/fr/grid/GridRowUI.java

@ -159,6 +159,8 @@ public class GridRowUI extends ComponentUI {
float fmAscent = GraphHelper.getFontMetrics(gridRow.getFont()).getAscent() * time;
double stringWidth = gridRow.getFont().getStringBounds(paintText, fontRenderContext).getWidth() * time;
double stringHeight = gridRow.getFont().getStringBounds(paintText, fontRenderContext).getHeight() * time;
// 如果高度太小了就不画了
if (stringHeight <= tmpIncreaseHeight + 2) {
if (isSelectedBounds) {
g2d.setColor(gridRow.getSelectedForeground());
} else {
@ -170,9 +172,8 @@ public class GridRowUI extends ComponentUI {
}
}
GraphHelper.drawString(g2d, paintText, (size.width - stringWidth) / 2, tmpHeight1 + (tmpIncreaseHeight - stringHeight) / 2 + GridHeader.SIZE_ADJUST / 2 + fmAscent
- 2);
GraphHelper.drawString(g2d, paintText, (size.width - stringWidth) / 2, tmpHeight1 + (tmpIncreaseHeight - stringHeight) / 2 + GridHeader.SIZE_ADJUST / 2 + fmAscent - 2);
}
}
}
Loading…
Cancel
Save