From 25116d6466188442d0d384252bb81b01047681ad Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Wed, 12 Apr 2017 09:30:27 +0800 Subject: [PATCH] =?UTF-8?q?report-1945,tab|=E8=87=AA=E9=80=82=E5=BA=94,?= =?UTF-8?q?=E6=97=A0=E7=BB=84=E4=BB=B6=E6=97=B6=E7=B2=98=E8=B4=B4=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/beans/models/SelectionModel.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java b/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java index 4b7b97e7d..13eaa18ac 100644 --- a/designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java +++ b/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 { //绝对布局