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 7940bfd66e..69277fc6f8 100644 --- a/designer-form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -171,16 +171,14 @@ public class XWAbsoluteLayout extends XLayoutContainer { tabLayout.updateBoundsWidget(); } } - BoundsWidget boundsWidget = (BoundsWidget) layout.getBoundsWidget(xCreator.toData()); - Rectangle rectangle = dealWidgetBound(xCreator.getBounds()); } private Rectangle calculateBound(Rectangle rec, double pw, double ph) { Rectangle calRec = new Rectangle(0, 0, 0, 0); - calRec.x = (int) (rec.x / pw); - calRec.y = (int) (rec.y / ph); - calRec.width = (int) (rec.width / pw); - calRec.height = (int) (rec.height / ph); + calRec.x = (int) Math.round(rec.x / pw); + calRec.y = (int) Math.round(rec.y / ph); + calRec.width = (int) Math.round(rec.width / pw); + calRec.height = (int) Math.round(rec.height / ph); return calRec; } diff --git a/designer-form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java b/designer-form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java index 262e52588a..3b64c4a8e8 100644 --- a/designer-form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java +++ b/designer-form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java @@ -1,7 +1,11 @@ package com.fr.design.widget.ui.designer.component; import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.widget.WidgetBoundsPaneFactory; import com.fr.form.ui.container.WLayout; import com.fr.general.Inter; @@ -35,6 +39,8 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { @Override public void update() { + FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + formDesigner.getSelectionModel().getSelection().backupBounds(); super.update(); Rectangle bounds = new Rectangle(creator.getBounds()); bounds.x = (int) x.getValue(); @@ -45,6 +51,9 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { WLayout wabs = parent.toData(); wabs.setBounds(creator.toData(), bounds); creator.setBounds(bounds); + LayoutUtils.layoutContainer(creator); + XWAbsoluteLayout layout = (XWAbsoluteLayout) parent; + layout.updateBoundsWidget(creator); } @Override diff --git a/designer-form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java b/designer-form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java index a046b2d18f..1d2bab88b4 100644 --- a/designer-form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java +++ b/designer-form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java @@ -85,6 +85,7 @@ public class WidgetBoundPane extends BasicPane { public void fix() { Rectangle bounds = new Rectangle(creator.getBounds()); + creator.setBackupBound(creator.getBounds()); int w = (int) width.getValue(); int h = (int) height.getValue(); Rectangle rec = ComponentUtils.getRelativeBounds(parent); diff --git a/designer-realize/src/com/fr/design/mainframe/ElementCasePane.java b/designer-realize/src/com/fr/design/mainframe/ElementCasePane.java index fe4841962b..c69e437489 100644 --- a/designer-realize/src/com/fr/design/mainframe/ElementCasePane.java +++ b/designer-realize/src/com/fr/design/mainframe/ElementCasePane.java @@ -81,7 +81,6 @@ import com.fr.design.selection.Selectedable; import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionListener; import com.fr.general.ComparatorUtils; -import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.grid.Grid; import com.fr.grid.GridColumn; @@ -91,6 +90,7 @@ import com.fr.grid.GridUtils; import com.fr.grid.dnd.ElementCasePaneDropTarget; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.Selection; +import com.fr.log.FineLoggerFactory; import com.fr.page.PageAttributeGetter; import com.fr.page.ReportPageAttrProvider; import com.fr.poly.creator.PolyElementCasePane; @@ -524,15 +524,14 @@ public abstract class ElementCasePane extends Tar * 因为这边判断selection是一个selection,所以不会触发fireSelectionChanged */ public void setSelection(Selection selection) { - try { - //旧选中内容编辑器释放模板对象 - this.getCurrentEditor().release(); - } catch (UnsupportedOperationException e) { - FRContext.getLogger().info("Nothing to release"); - } - if (!ComparatorUtils.equals(this.selection, selection) || !ComparatorUtils.equals(EastRegionContainerPane.getInstance().getCellAttrPane(), CellElementPropertyPane.getInstance())) { + try { + //旧选中内容编辑器释放模板对象 + this.getCurrentEditor().release(); + } catch (UnsupportedOperationException e) { + FRContext.getLogger().info("Nothing to release"); + } this.selection = selection; fireSelectionChanged(); }