Browse Source

report-1945,tab|自适应,无组件时粘贴问题

master
yaoh.wu 8 years ago
parent
commit
25116d6466
  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;
//选中第一个坐标点坐在的组件
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 {
//自适应布局编辑器内部左上角第一个坐标点
int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1;
int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1;
//选中第一个坐标点坐在的组件
selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY));
Rectangle rectangle = selection.getRelativeBounds();
if (hasSelectedPasteSource()) {
selectedPaste();
} else {
FormSelectionUtils.paste2Container(designer, designer.getRootComponent(),
clipboard,
DELTA_X_Y,
DELTA_X_Y);
rectangle.x + rectangle.width / 2,
rectangle.y + DELTA_X_Y);
}
}
} else {
//绝对布局

Loading…
Cancel
Save