Browse Source

Pull request #2055: REPORT-37250 windows下显示异常

Merge in DESIGN/design from ~KERRY/design_10.0:release/10.0 to release/10.0

* commit '6e7d59ba89377bf60c0957fbb27c7d5b6c57f7e6':
  REPORT-37250  windows下显示异常
feature/big-screen
kerry 4 years ago
parent
commit
4acce104bc
  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); 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; 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) { public void paint(final Graphics g, JComponent c) {
XCreator rootComponent = designer.getRootComponent(); XCreator rootComponent = designer.getRootComponent();
this.time = (float) designer.getResolution() / ScreenResolution.getScreenResolution(); 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) { if (rootComponent != null) {
// 设计自适应界面 // 设计自适应界面
repaintFit(g, rootComponent, c); repaintFit(g, rootComponent, c);

Loading…
Cancel
Save