From c1d29e61697a5997eaadeb53751620158efe06be Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 29 Jun 2020 17:28:01 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-33944=20=E6=94=B9=E4=B8=BA=E5=B8=B8?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-realize/src/main/java/com/fr/grid/GridUI.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/grid/GridUI.java b/designer-realize/src/main/java/com/fr/grid/GridUI.java index 3ca89fc016..62927647aa 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridUI.java +++ b/designer-realize/src/main/java/com/fr/grid/GridUI.java @@ -300,6 +300,8 @@ public class GridUI extends ComponentUI { private int resolution; + private static final double THRESHOLD = 1.0E-4D; + DrawLineHelper(int startIndex, int endIndex, boolean showGridLine, boolean showPaginateLine, DynamicUnitList sizeList, double paperPaintSize, List paginateLineList, int resolution) { @@ -315,7 +317,7 @@ public class GridUI extends ComponentUI { } protected void iterateStart2End(Graphics2D g2d) { - double tmpSize = 0, paperSumSize = 0, sumSize = 0; + float tmpSize = 0, paperSumSize = 0, sumSize = 0; for (int i = 0; i <= endIndex; i++) { // denny: 开始 if (i == 0) { @@ -323,7 +325,7 @@ public class GridUI extends ComponentUI { // denny: 增加从0到Grid左边被hide的列宽 for (int k = 0; k < startIndex; k++) { - tmpSize = sizeList.get(k).toPixD(resolution); + tmpSize = sizeList.get(k).toPixF(resolution); paperSumSize += tmpSize; if (paperSumSize >= paperPaintSize) { @@ -333,7 +335,7 @@ public class GridUI extends ComponentUI { } // adjust height. - tmpSize = sizeList.get(i).toPixD(resolution); + tmpSize = sizeList.get(i).toPixF(resolution); paperSumSize += tmpSize; if (showGridLine) {// paint line. @@ -342,7 +344,7 @@ public class GridUI extends ComponentUI { } // paint paper margin line. - if (showPaginateLine && paperSumSize - paperPaintSize > 1.0E-7D) { + if (showPaginateLine && paperSumSize - paperPaintSize > THRESHOLD) { paginateLineList.add(getPaginateLine2D((int) sumSize)); paperSumSize = tmpSize; }