From f62b5aae072fd33d0959d904ce611c961128b9a6 Mon Sep 17 00:00:00 2001 From: zhouping Date: Mon, 21 Nov 2016 17:18:41 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-702=20=E8=A1=A8=E5=8D=95=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E9=AB=98=E5=BA=A6=E4=BC=9A=E8=87=AA=E5=B7=B1?= =?UTF-8?q?=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/designer/creator/XWFitLayout.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java b/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java index 04904a7238..682a195907 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWFitLayout.java @@ -159,7 +159,10 @@ public class XWFitLayout extends XLayoutContainer { creator.updateChildBound(getActualMinHeight()); } // 布局内部组件放大缩小后,都是乘以百分比后取整,可能会产生空隙,此处调整容器 - this.setSize(containerW + margin.getLeft() + margin.getRight(), containerH + margin.getTop() + margin.getBottom()); + this.setSize( + containerW + (int)(margin.getLeft() * (1.0+percent) + margin.getRight() * (1.0+percent)), + containerH + (int)(margin.getTop() * (1.0+percent) + margin.getBottom() * (1.0+percent)) + ); updateCreatorsBackupBound(); // 间隔也按显示大小比例调整 if (!hasCalGap) { @@ -239,7 +242,7 @@ public class XWFitLayout extends XLayoutContainer { posX.add(margin.getLeft()); int width = this.getWidth() - margin.getLeft() - margin.getRight(); int containW = (int) (width / perc); - posX.add(containW); + posX.add(containW + margin.getLeft()); for (int i=0, len=this.getComponentCount(); i < len; i++) { int x = this.getComponent(i).getX(); int finalX = (int) (x / perc); @@ -265,7 +268,7 @@ public class XWFitLayout extends XLayoutContainer { posY.add(margin.getTop()); int height = this.getHeight() - margin.getTop() - margin.getBottom(); int containH = (int) (height / perc); - posY.add(containH); + posY.add(containH + margin.getTop()); for (int i=0, len=this.getComponentCount(); i < len; i++) { int y = this.getComponent(i).getY(); int finalY = (int) (y / perc);