Browse Source

REPORT-40025 修改在已选择组件中按坐标获取组件的逻辑

feature/big-screen
Yuan.Wang 4 years ago
parent
commit
28cde5e899
  1. 10
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

10
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -848,11 +848,11 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
//如果不是布局容器,直接进行对比 //如果不是布局容器,直接进行对比
if (!(creator instanceof XLayoutContainer)) { if (!(creator instanceof XLayoutContainer)) {
x -= relativeParentX + creator.getX(); int newX = x - relativeParentX - creator.getX();
y -= relativeParentY + creator.getY(); int newY = y - relativeParentY - creator.getY();
Rectangle rect = ComponentUtils.computeVisibleRect(creator); Rectangle rect = ComponentUtils.computeVisibleRect(creator);
// 判断是否处于交叉区域 // 判断是否处于交叉区域
if (isIntersectArea(x, y, rect)) { if (isIntersectArea(newX, newY, rect)) {
return creator; return creator;
} }
} }
@ -860,7 +860,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
//如果是布局容器,从布局容器向下找 //如果是布局容器,从布局容器向下找
if (creator instanceof XLayoutContainer) { if (creator instanceof XLayoutContainer) {
XCreator result = xCreatorAt(x - relativeParentX, y - relativeParentY, creator, null); XCreator result = xCreatorAt(x - relativeParentX, y - relativeParentY, creator, null);
if (result != null) return result; if (result != null) {
return result;
}
} }
//最后,如果组件为Tab容器中的子组件,再从Tab容器中去找 //最后,如果组件为Tab容器中的子组件,再从Tab容器中去找

Loading…
Cancel
Save