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 3ca89fc01..62927647a 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; }