Browse Source

Merge pull request #809 in BA/design from ~YAOH.WU/design_0407:release to release

* commit '76d1d2fc4a7cd5f92868dcd1bbb301aafb30bf6e':
  report-1945,tab|自适应,无组件时粘贴问题
master
superman 8 years ago
parent
commit
88bd7eeae5
  1. 15
      designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java

15
designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java

@ -142,22 +142,29 @@ public class SelectionModel {
int leftUpY = container.toData().getMargin().getTop() + 1; int leftUpY = container.toData().getMargin().getTop() + 1;
//选中第一个坐标点坐在的组件 //选中第一个坐标点坐在的组件
selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY)); selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY));
pasteFromClipBoard(); Rectangle rectangle = selection.getRelativeBounds();
if (hasSelectedPasteSource()) {
selectedPaste();
} else {
FormSelectionUtils.paste2Container(designer, container, clipboard,
rectangle.x + rectangle.width / 2,
rectangle.y + DELTA_X_Y);
}
} else { } else {
//自适应布局编辑器内部左上角第一个坐标点 //自适应布局编辑器内部左上角第一个坐标点
int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1; int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1;
int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1; int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1;
//选中第一个坐标点坐在的组件 //选中第一个坐标点坐在的组件
selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY)); selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY));
Rectangle rectangle = selection.getRelativeBounds();
if (hasSelectedPasteSource()) { if (hasSelectedPasteSource()) {
selectedPaste(); selectedPaste();
} else { } else {
FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), FormSelectionUtils.paste2Container(designer, designer.getRootComponent(),
clipboard, clipboard,
DELTA_X_Y, rectangle.x + rectangle.width / 2,
DELTA_X_Y); rectangle.y + DELTA_X_Y);
} }
} }
} else { } else {
//绝对布局 //绝对布局

Loading…
Cancel
Save