Browse Source

REPORT-56014 & REPORT-56015 【组件背景分离】【下个版本】组件复用-组件边框点九图,如果线重叠了的话,web端显示有问题

【问题原因】
点九图小而组件大,且中间不可缩放的尺寸为0时,就会出现空白。从点九图的
使用机制上看无法避免上上述情况,需要在生成点九图的时候,强制中间缩放
区域的尺寸最小为1才行,即两条平行线之间的最小间距为1.

【改动思路】
同上
bugfix/10.0
Starryi 2 years ago
parent
commit
6621921d0d
  1. 17
      designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java

17
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();

Loading…
Cancel
Save