From ed82eca8c98c75ba507514b96385c2a9bd0b4a8b Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Sun, 28 Jun 2020 19:56:31 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-33944=20=E9=A1=B5=E8=BE=B9=E8=B7=9D?= =?UTF-8?q?=E4=B8=BA0=EF=BC=8C=E8=AE=BE=E8=AE=A1=E5=99=A8=E8=99=9A?= =?UTF-8?q?=E7=BA=BF=E5=92=8C=E5=AE=9E=E9=99=85=E6=9C=891=E7=9A=84?= =?UTF-8?q?=E8=AF=AF=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/grid/GridUI.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 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 ff027af08..36b81ea68 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridUI.java +++ b/designer-realize/src/main/java/com/fr/grid/GridUI.java @@ -315,7 +315,7 @@ public class GridUI extends ComponentUI { } protected void iterateStart2End(Graphics2D g2d) { - float tmpSize = 0, paperSumSize = 0, sumSize = 0; + double tmpSize = 0, paperSumSize = 0, sumSize = 0; for (int i = 0; i <= endIndex; i++) { // denny: 开始 if (i == 0) { @@ -323,7 +323,7 @@ public class GridUI extends ComponentUI { // denny: 增加从0到Grid左边被hide的列宽 for (int k = 0; k < startIndex; k++) { - tmpSize = sizeList.get(k).toPixF(resolution); + tmpSize = sizeList.get(k).toPixD(resolution); paperSumSize += tmpSize; if (paperSumSize >= paperPaintSize) { @@ -333,7 +333,7 @@ public class GridUI extends ComponentUI { } // adjust height. - tmpSize = sizeList.get(i).toPixF(resolution); + tmpSize = sizeList.get(i).toPixD(resolution); paperSumSize += tmpSize; if (showGridLine) {// paint line. @@ -342,7 +342,7 @@ public class GridUI extends ComponentUI { } // paint paper margin line. - if (showPaginateLine && paperSumSize >= paperPaintSize) { + if (showPaginateLine && (float)paperSumSize > (float) paperPaintSize) { paginateLineList.add(getPaginateLine2D((int) sumSize)); paperSumSize = tmpSize; } @@ -497,8 +497,8 @@ public class GridUI extends ComponentUI { paintCellElementRectangleList.add(this.tmpRectangle.clone()); - double cellWidth = this.tmpRectangle.getWidth(); - double cellHeight = this.tmpRectangle.getHeight(); + double cellWidth = this.tmpRectangle.getWidth(); + double cellHeight = this.tmpRectangle.getHeight(); // denny_Grid: 画Grid中单元格的内容(包括单元格的背景Content + Background), 不包括边框 painter.paintBackground(g2d, report, tmpCellElement, cellWidth - 1, cellHeight - 1); @@ -625,10 +625,10 @@ public class GridUI extends ComponentUI { tmpLine2D = (Line2D) paginateLineList.get(j);// 直接强制转换,因为List中肯定都是Line2D型的 for (int k = j + 1; k < paginateLineList.size(); k++) { tmpLine2D2 = (Line2D) paginateLineList.get(k); - if (AssistUtils.equals(tmpLine2D2.getX1() ,tmpLine2D.getX1()) - && AssistUtils.equals(tmpLine2D2.getX2() , tmpLine2D.getX2()) - && AssistUtils.equals(tmpLine2D2.getY1() , tmpLine2D.getY1()) - && AssistUtils.equals(tmpLine2D2.getY2() , tmpLine2D.getY2())) { + if (AssistUtils.equals(tmpLine2D2.getX1(), tmpLine2D.getX1()) + && AssistUtils.equals(tmpLine2D2.getX2(), tmpLine2D.getX2()) + && AssistUtils.equals(tmpLine2D2.getY1(), tmpLine2D.getY1()) + && AssistUtils.equals(tmpLine2D2.getY2(), tmpLine2D.getY2())) { paginateLineList.remove(k); } } From a6648211e945261b7273b109d1dc479efa7777a5 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 29 Jun 2020 14:41:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-33944=20=E5=A4=A7=E4=BA=8E=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E7=9A=84=E7=B2=BE=E5=BA=A6=E4=B9=8B=E5=A4=96=E6=89=8D?= =?UTF-8?q?=E6=98=AF=E5=A4=A7=E4=BA=8E?= 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 36b81ea68..3ca89fc01 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridUI.java +++ b/designer-realize/src/main/java/com/fr/grid/GridUI.java @@ -342,7 +342,7 @@ public class GridUI extends ComponentUI { } // paint paper margin line. - if (showPaginateLine && (float)paperSumSize > (float) paperPaintSize) { + if (showPaginateLine && paperSumSize - paperPaintSize > 1.0E-7D) { paginateLineList.add(getPaginateLine2D((int) sumSize)); paperSumSize = tmpSize; } From c1d29e61697a5997eaadeb53751620158efe06be Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 29 Jun 2020 17:28:01 +0800 Subject: [PATCH 3/3] =?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 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; }