Browse Source

REPORT-702 表单图表块高度会自己变

master
zhouping 8 years ago
parent
commit
f62b5aae07
  1. 9
      designer_form/src/com/fr/design/designer/creator/XWFitLayout.java

9
designer_form/src/com/fr/design/designer/creator/XWFitLayout.java

@ -159,7 +159,10 @@ public class XWFitLayout extends XLayoutContainer {
creator.updateChildBound(getActualMinHeight()); 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(); updateCreatorsBackupBound();
// 间隔也按显示大小比例调整 // 间隔也按显示大小比例调整
if (!hasCalGap) { if (!hasCalGap) {
@ -239,7 +242,7 @@ public class XWFitLayout extends XLayoutContainer {
posX.add(margin.getLeft()); posX.add(margin.getLeft());
int width = this.getWidth() - margin.getLeft() - margin.getRight(); int width = this.getWidth() - margin.getLeft() - margin.getRight();
int containW = (int) (width / perc); int containW = (int) (width / perc);
posX.add(containW); posX.add(containW + margin.getLeft());
for (int i=0, len=this.getComponentCount(); i < len; i++) { for (int i=0, len=this.getComponentCount(); i < len; i++) {
int x = this.getComponent(i).getX(); int x = this.getComponent(i).getX();
int finalX = (int) (x / perc); int finalX = (int) (x / perc);
@ -265,7 +268,7 @@ public class XWFitLayout extends XLayoutContainer {
posY.add(margin.getTop()); posY.add(margin.getTop());
int height = this.getHeight() - margin.getTop() - margin.getBottom(); int height = this.getHeight() - margin.getTop() - margin.getBottom();
int containH = (int) (height / perc); int containH = (int) (height / perc);
posY.add(containH); posY.add(containH + margin.getTop());
for (int i=0, len=this.getComponentCount(); i < len; i++) { for (int i=0, len=this.getComponentCount(); i < len; i++) {
int y = this.getComponent(i).getY(); int y = this.getComponent(i).getY();
int finalY = (int) (y / perc); int finalY = (int) (y / perc);

Loading…
Cancel
Save