Browse Source

REPORT-55112 【组件背景分离】组件复用-点九图填充设置弹窗,分割线拖拽到靠近边缘时,像素值就被遮挡看不到了

【问题原因】
右侧分割线位置信息的计算位置不对,需要重新整理下
【改动思路】
【review建议】
feature/10.0
Starryi 3 years ago
parent
commit
5b34972896
  1. 23
      designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java

23
designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java

@ -494,28 +494,33 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver {
int scaleRight = (int) (ninePointRight * scale); int scaleRight = (int) (ninePointRight * scale);
int scaleBottom = (int) (ninePointBottom * scale); int scaleBottom = (int) (ninePointBottom * scale);
double topYInPane = scaleImgY + scaleTop;
double bottomYInPane = scaleImgY + scaleImgHeight - scaleBottom;
double leftXInPane = scaleImgX + scaleLeft;
double rightXInPane = scaleImgX + scaleImgWidth - scaleRight;
g2d.setColor(PATCH_COLOR); g2d.setColor(PATCH_COLOR);
// draw horizontal patch // draw horizontal patch
GraphDrawHelper.fillRect(g2d, 0, scaleImgY + scaleTop, getWidth(), scaleImgHeight - scaleTop - scaleBottom); GraphDrawHelper.fillRect(g2d, 0, topYInPane, getWidth(), scaleImgHeight - scaleTop - scaleBottom);
// draw vertical patch // draw vertical patch
GraphDrawHelper.fillRect(g2d, scaleImgX + scaleLeft, 0,scaleImgWidth - scaleLeft - scaleRight, getHeight()); GraphDrawHelper.fillRect(g2d, scaleImgX + scaleLeft, 0,scaleImgWidth - scaleLeft - scaleRight, getHeight());
g2d.setColor(DIVIDER_COLOR); g2d.setColor(DIVIDER_COLOR);
// draw top divider // draw top divider
GraphDrawHelper.drawLine(g2d, 0, scaleImgY + scaleTop, getWidth(), scaleImgY + scaleTop); GraphDrawHelper.drawLine(g2d, 0, topYInPane, getWidth(), topYInPane);
// draw bottom divider // draw bottom divider
GraphDrawHelper.drawLine(g2d, 0, scaleImgY + scaleImgHeight - scaleBottom, getWidth(), scaleImgY + scaleImgHeight - scaleBottom); GraphDrawHelper.drawLine(g2d, 0, bottomYInPane, getWidth(), bottomYInPane);
// draw left divider // draw left divider
GraphDrawHelper.drawLine(g2d, scaleImgX + scaleLeft, 0, scaleImgX + scaleLeft, getHeight()); GraphDrawHelper.drawLine(g2d, leftXInPane, 0, leftXInPane, getHeight());
// draw right divider // draw right divider
GraphDrawHelper.drawLine(g2d, scaleImgX + scaleImgWidth - scaleRight, 0, scaleImgX + scaleImgWidth - scaleRight, getHeight()); GraphDrawHelper.drawLine(g2d, rightXInPane, 0, rightXInPane, getHeight());
g2d.setColor(TEXT_COLOR); g2d.setColor(TEXT_COLOR);
// draw nine point info // draw nine point info
GraphDrawHelper.drawString(g2d, Integer.toString(ninePointTop), scaleImgX + (scaleImgWidth + scaleLeft - scaleRight) / 2.0, (scaleImgY + scaleTop) / 2.0); GraphDrawHelper.drawString(g2d, Integer.toString(ninePointTop), (leftXInPane + rightXInPane) / 2.0F, topYInPane / 2.0);
GraphDrawHelper.drawString(g2d, Integer.toString(ninePointBottom), scaleImgX + scaleLeft + (scaleImgWidth - scaleLeft - scaleRight) / 2.0, scaleImgY + scaleImgHeight - (scaleBottom - PADDING) / 2.0); GraphDrawHelper.drawString(g2d, Integer.toString(ninePointBottom), (leftXInPane + rightXInPane) / 2.0F, (bottomYInPane + getHeight()) / 2.0);
GraphDrawHelper.drawString(g2d, Integer.toString(ninePointLeft), (scaleImgX + scaleLeft) / 2.0, scaleImgY + (scaleImgHeight + scaleTop - scaleBottom) / 2.0); GraphDrawHelper.drawString(g2d, Integer.toString(ninePointLeft), leftXInPane / 2.0, (topYInPane + bottomYInPane) / 2.0);
GraphDrawHelper.drawString(g2d, Integer.toString(ninePointRight), scaleImgX + scaleImgWidth - (scaleRight - PADDING) / 2.0, scaleImgY + (scaleImgHeight + scaleTop - scaleBottom) / 2.0); GraphDrawHelper.drawString(g2d, Integer.toString(ninePointRight), (rightXInPane + getWidth()) / 2.0, (topYInPane + bottomYInPane) / 2.0);
} }
@Override @Override

Loading…
Cancel
Save