diff --git a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java index df2875939..06ae6fa78 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -96,7 +96,6 @@ public class XWAbsoluteLayout extends XLayoutContainer { if(screenValue != FormArea.DEFAULT_SLIDER){ this.setContainerPercent(screenValue / FormArea.DEFAULT_SLIDER); } - widget.setDesigningResolution(scrnsize); } /** @@ -208,7 +207,33 @@ public class XWAbsoluteLayout extends XLayoutContainer { } } } - + + /** + * 更新子组件的Bound + * 这边主要用于绝对布局子组件在适应区域选项时 + * 涉及到的不同分辨率下缩放 + * @param minHeight 最小高度 + */ + @Override + public void updateChildBound(int minHeight) { + double prevContainerPercent = FRScreen.getByDimension(toData().getDesigningResolution()).getValue() / FormArea.DEFAULT_SLIDER; + if (toData().getCompState() == 0 && prevContainerPercent != containerPercent) { + 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); + BoundsWidget wgt = toData().getBoundsWidget(creator.toData()); + wgt.setBounds(rec); + creator.setBounds(rec); + creator.updateChildBound(minHeight); + } + } + toData().setDesigningResolution(Toolkit.getDefaultToolkit().getScreenSize()); + } + /** * 增加对齐线 * @param connector 对齐线 @@ -418,7 +443,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { ); g2d.setColor(Color.BLACK); //画编辑文字 - g2d.drawString(Inter.getLocText("Edit"), x + w / 2 - 2, y + h / 2 + 5); + g2d.drawString(Inter.getLocText("FR-Designer_Edit"), x + w / 2 - 2, y + h / 2 + 5); } }