Browse Source

REPORT-37250 windows下显示异常

feature/big-screen
kerry 4 years ago
parent
commit
6e7d59ba89
  1. 28
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  2. 7
      designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java

28
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -402,6 +402,19 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);
}
public void paintChildren(Graphics g) {
Graphics2D g2d = (Graphics2D) g;
AffineTransform old = g2d.getTransform();
AffineTransform at = new AffineTransform();
at.translate(this.getPaintX(), this.getPaintY());
at.scale(this.getScale(), this.getScale());
g2d.transform(at);
super.paintChildren(g);
g2d.setTransform(old);
}
/**
* 自动添加组件
*
@ -1283,21 +1296,6 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
this.formArea = formArea;
}
public void paint(Graphics g){
//重新设置下绘制的起点和缩放幅度
AffineTransform at = new AffineTransform();
if (rootComponent.getParent() != null) {
at.translate(this.getPaintX(), this.getPaintY());
at.scale(this.getScale(), this.getScale());
Graphics2D g2 = (Graphics2D) g;
g2.transform(at);
}
super.paint(g);
}
/**
* 绘制组件根节点
*

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

@ -68,6 +68,13 @@ public class FormDesignerUI extends ComponentUI {
public void paint(final Graphics g, JComponent c) {
XCreator rootComponent = designer.getRootComponent();
this.time = (float) designer.getResolution() / ScreenResolution.getScreenResolution();
AffineTransform at = new AffineTransform();
if (rootComponent.getParent() != null) {
at.translate(designer.getPaintX(), designer.getPaintY());
at.scale(designer.getScale(), designer.getScale());
Graphics2D g2 = (Graphics2D) g;
g2.transform(at);
}
if (rootComponent != null) {
// 设计自适应界面
repaintFit(g, rootComponent, c);

Loading…
Cancel
Save