Browse Source

Merge pull request #1360 in DESIGN/design from ~KERRY/design_10.0:bugfix/10.0 to bugfix/10.0

* commit '4f24288c06c345e9e9eaa70d458b7de2544839bf':
  REPORT-24117 这部分代码回退,当时的bug REPORT-21202修改FormSelection就可以避免tab的复制
bugfix/10.0
kerry 5 years ago
parent
commit
9b400bac0e
  1. 21
      designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java

21
designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java

@ -18,9 +18,7 @@ import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.stable.ArrayUtils;
import java.awt.LayoutManager;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
@ -177,6 +175,22 @@ public class SelectionModel {
}
private void pasteXWFitLayout() {
if (selection.getSelectedCreator().getClass().equals(XWTabFitLayout.class)) {
XLayoutContainer container = (XLayoutContainer) selection.getSelectedCreator();
//tab布局编辑器内部左上角第一个坐标点
int leftUpX = container.toData().getMargin().getLeft() + 1;
int leftUpY = container.toData().getMargin().getTop() + 1;
//选中第一个坐标点坐在的组件
selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY));
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;
@ -192,6 +206,7 @@ public class SelectionModel {
rectangle.y + DELTA_X_Y);
}
}
}
/**
* 粘贴时选择组件

Loading…
Cancel
Save