diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java index 52bae99f17..42371a44f9 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/topxcreator/TopXCreator.java @@ -42,16 +42,8 @@ public class TopXCreator extends BasicTopXCreator { * 依据鼠标事件和visible设置是否显示蒙层 * */ public void displayCoverPane(MouseEvent event, boolean visible) { - if (!visible) { - setVisible(false); - return; - } - Rectangle rect = getBounds(); - if (rect.contains(event.getX(), event.getY())) { - coverPanel.setVisible(true); - } else { - coverPanel.setVisible(false); - } + boolean isVisible = visible && getBounds().contains(event.getX(), event.getY()); + coverPanel.setVisible(isVisible); } }