From 3ea73837dcb9e5a1464a006d0e18233f2b8f112b Mon Sep 17 00:00:00 2001 From: MoMeak Date: Mon, 4 Sep 2017 15:15:17 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-3959=20[9.0=E4=B8=80=E8=BD=AE=E5=9B=9E?= =?UTF-8?q?=E5=BD=92]=E8=A1=8C=EF=BC=88=E5=88=97=EF=BC=89=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E6=97=B6=E8=A1=8C=EF=BC=88=E5=88=97=EF=BC=89=E5=8F=B7?= =?UTF-8?q?=E4=BE=9D=E7=84=B6=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/grid/GridColumnUI.java | 8 ++++---- designer/src/com/fr/grid/GridRowUI.java | 23 +++++++++++----------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/designer/src/com/fr/grid/GridColumnUI.java b/designer/src/com/fr/grid/GridColumnUI.java index 971282168..ab32e6ce8 100644 --- a/designer/src/com/fr/grid/GridColumnUI.java +++ b/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); -// } + } } diff --git a/designer/src/com/fr/grid/GridRowUI.java b/designer/src/com/fr/grid/GridRowUI.java index 016cfe637..2f97914bb 100644 --- a/designer/src/com/fr/grid/GridRowUI.java +++ b/designer/src/com/fr/grid/GridRowUI.java @@ -159,20 +159,21 @@ 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 (isSelectedBounds) { - g2d.setColor(gridRow.getSelectedForeground()); - } else { - // p:检查eanbled - if (gridRow.isEnabled()) { - g2d.setColor(gridRow.getForeground()); + // 如果高度太小了就不画了 + if (stringHeight <= tmpIncreaseHeight + 2) { + if (isSelectedBounds) { + g2d.setColor(gridRow.getSelectedForeground()); } else { - g2d.setPaint(UIManager.getColor("controlShadow")); + // p:检查eanbled + if (gridRow.isEnabled()) { + g2d.setColor(gridRow.getForeground()); + } else { + g2d.setPaint(UIManager.getColor("controlShadow")); + } } - } - - 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); + } } } \ No newline at end of file