Browse Source

REPORT-38618 【回归】表单-下方缩放缩小之后,拖入tab块,查看右侧边框线消失

feature/big-screen
kerry 4 years ago
parent
commit
31f74c9392
  1. 19
      designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java

19
designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java

@ -22,10 +22,12 @@ import com.fr.form.main.parameter.FormParameterUI;
import com.fr.page.WatermarkPainter; import com.fr.page.WatermarkPainter;
import com.fr.report.core.ReportUtils; import com.fr.report.core.ReportUtils;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import javax.swing.*; import javax.swing.*;
import javax.swing.plaf.ComponentUI; import javax.swing.plaf.ComponentUI;
import java.awt.AlphaComposite; import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
@ -41,6 +43,8 @@ import java.util.ArrayList;
*/ */
public class FormDesignerUI extends ComponentUI { public class FormDesignerUI extends ComponentUI {
private static final Color DESIGNER_BORDER_COLOR = new Color(198, 198, 198);
// 当前的设计器 // 当前的设计器
private FormDesigner designer; private FormDesigner designer;
private SelectionModel selectionModel; private SelectionModel selectionModel;
@ -90,7 +94,7 @@ public class FormDesignerUI extends ComponentUI {
designer.getDrawLineHelper().drawAuxiliaryLine(g); designer.getDrawLineHelper().drawAuxiliaryLine(g);
return; return;
} }
paintBorder(g);
paintSelection(g); paintSelection(g);
if (DesignerMode.isAuthorityEditing()) { if (DesignerMode.isAuthorityEditing()) {
@ -275,6 +279,19 @@ public class FormDesignerUI extends ComponentUI {
clipg.dispose(); clipg.dispose();
} }
public void paintBorder(Graphics g) {
Rectangle bounds = designer.getTopContainer().getBounds();
bounds.x = -designer.getHorizontalScaleValue();
bounds.y = -designer.getVerticalScaleValue();
Graphics clipg = g.create();
clipg.clipRect(bounds.x, bounds.y, bounds.width, bounds.height);
Color oldColor = g.getColor();
g.setColor(DESIGNER_BORDER_COLOR);
GraphHelper.draw(g, bounds, Constants.LINE_THIN);
clipg.dispose();
g.setColor(oldColor);
}
/** /**
* 画出当前选择拖拽状态框 * 画出当前选择拖拽状态框
* *

Loading…
Cancel
Save