From 5c2e6b26dcd5f7723d92635e09242800d61267a0 Mon Sep 17 00:00:00 2001 From: zhouping Date: Fri, 29 Sep 2017 10:51:53 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-4718=20[9.0=E5=86=85=E6=B5=8B]=E6=89=93?= =?UTF-8?q?=E5=BC=80=E7=BB=9D=E5=AF=B9=E5=B8=83=E5=B1=80=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=EF=BC=8Cbody=E7=BB=84=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E8=87=AA=E9=80=82=E5=BA=94=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E7=9A=84=E5=B1=9E=E6=80=A7=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/designer/beans/models/StateModel.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/designer/beans/models/StateModel.java b/designer_form/src/com/fr/design/designer/beans/models/StateModel.java index ff3fcbedcd..d089e282f6 100644 --- a/designer_form/src/com/fr/design/designer/beans/models/StateModel.java +++ b/designer_form/src/com/fr/design/designer/beans/models/StateModel.java @@ -265,7 +265,15 @@ public class StateModel { Rectangle bounds = createCurrentBounds(x, y); if ((x != currentX) || (y != currentY)) { - selectionModel.setSelectedCreators(getHotspotCreators(bounds, designer.getRootComponent())); + ArrayList creators = getHotspotCreators(bounds, designer.getRootComponent()); + if (creators.isEmpty() && designer.getRootComponent().getXCreatorCount() > 0) { + //当初始化布局是绝对布局的时候特殊处理,画框的时候若没有控件,默认焦点设置在绝对布局上 + XCreator layout = designer.getRootComponent().getXCreator(0); + if (layout.acceptType(XWAbsoluteBodyLayout.class)) { + creators.add(layout); + } + } + selectionModel.setSelectedCreators(creators); } selectionModel.setHotspotBounds(null); }