From 6621921d0dd5f2af4a9a6060bfd409b9254ddb0e Mon Sep 17 00:00:00 2001 From: Starryi Date: Fri, 3 Dec 2021 14:37:52 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-56014=20&=20REPORT-56015=20=E3=80=90?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E8=83=8C=E6=99=AF=E5=88=86=E7=A6=BB=E3=80=91?= =?UTF-8?q?=E3=80=90=E4=B8=8B=E4=B8=AA=E7=89=88=E6=9C=AC=E3=80=91=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=A4=8D=E7=94=A8-=E7=BB=84=E4=BB=B6=E8=BE=B9?= =?UTF-8?q?=E6=A1=86=E7=82=B9=E4=B9=9D=E5=9B=BE=EF=BC=8C=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E7=BA=BF=E9=87=8D=E5=8F=A0=E4=BA=86=E7=9A=84=E8=AF=9D=EF=BC=8C?= =?UTF-8?q?web=E7=AB=AF=E6=98=BE=E7=A4=BA=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 点九图小而组件大,且中间不可缩放的尺寸为0时,就会出现空白。从点九图的 使用机制上看无法避免上上述情况,需要在生成点九图的时候,强制中间缩放 区域的尺寸最小为1才行,即两条平行线之间的最小间距为1. 【改动思路】 同上 --- .../gui/xpane/BorderLineAndImagePane.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java index 6e8cac0d8..1db2db2e2 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java @@ -503,6 +503,7 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { private int ninePointBottom = -1; private static final int MIN_NINE_POINT = 0; + private static final int MIN_GAP_PARALLEL_LINES = 1; private int imgWidth; private int imgHeight; @@ -773,8 +774,8 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { private void onNinePointTopChanged(int value) { if (value < MIN_NINE_POINT) { value = MIN_NINE_POINT; - } else if (value >= imgHeight - ninePointBottom) { - value = imgHeight - ninePointBottom - MIN_NINE_POINT; + } else if (value >= imgHeight - ninePointBottom - MIN_GAP_PARALLEL_LINES) { + value = imgHeight - ninePointBottom - MIN_GAP_PARALLEL_LINES; } this.ninePointTop = value; repaint(); @@ -783,8 +784,8 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { private void onNinePointBottomChanged(int value) { if (value < MIN_NINE_POINT) { value = MIN_NINE_POINT; - } else if (value >= imgHeight - ninePointTop) { - value = imgHeight - ninePointTop - MIN_NINE_POINT; + } else if (value >= imgHeight - ninePointTop - MIN_GAP_PARALLEL_LINES) { + value = imgHeight - ninePointTop - MIN_GAP_PARALLEL_LINES; } this.ninePointBottom = value; repaint(); @@ -793,8 +794,8 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { private void onNinePointLeftChanged(int value) { if (value < MIN_NINE_POINT) { value = MIN_NINE_POINT; - } else if (value >= imgWidth - ninePointRight) { - value = imgWidth - ninePointRight - MIN_NINE_POINT; + } else if (value >= imgWidth - ninePointRight - MIN_GAP_PARALLEL_LINES) { + value = imgWidth - ninePointRight - MIN_GAP_PARALLEL_LINES; } this.ninePointLeft = value; repaint(); @@ -803,8 +804,8 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { private void onNinePointRightChanged(int value) { if (value < MIN_NINE_POINT) { value = MIN_NINE_POINT; - } else if (value >= imgWidth - ninePointLeft) { - value = imgWidth - ninePointLeft - MIN_NINE_POINT; + } else if (value >= imgWidth - ninePointLeft - MIN_GAP_PARALLEL_LINES) { + value = imgWidth - ninePointLeft - MIN_GAP_PARALLEL_LINES; } this.ninePointRight = value; repaint();