Browse Source

REPORT-9019 绝对布局适应区域,减少不同分辨率下组件坐标的计算误差

master
plough 6 years ago
parent
commit
c74810869d
  1. 8
      designer-form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java

8
designer-form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java

@ -248,10 +248,10 @@ public class XWAbsoluteLayout extends XLayoutContainer {
for (int i = 0; i < this.getComponentCount(); i++) {
XCreator creator = getXCreator(i);
Rectangle rec = new Rectangle(creator.getBounds());
rec.x = (int) (rec.x / prevContainerPercent * containerPercent);
rec.y = (int) (rec.y / prevContainerPercent * containerPercent);
rec.height = (int) (rec.height / prevContainerPercent * containerPercent);
rec.width = (int) (rec.width / prevContainerPercent * containerPercent);
rec.x = (int)Math.round (rec.x / prevContainerPercent * containerPercent);
rec.y = (int)Math.round (rec.y / prevContainerPercent * containerPercent);
rec.height = (int)Math.round (rec.height / prevContainerPercent * containerPercent);
rec.width = (int)Math.round (rec.width / prevContainerPercent * containerPercent);
BoundsWidget wgt = (BoundsWidget) toData().getBoundsWidget(creator.toData());
wgt.setBounds(rec);
creator.setBounds(rec);

Loading…
Cancel
Save