From b3b21572c8888898434fd9e58c25354e88a9c497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Thu, 22 Feb 2024 16:47:11 +0100 Subject: [PATCH] fix(editor): ignore mouse up event on bond action if mouse down was not captured (#1) The action handler requires a starting point. --- .../research/share/gui/editor/actions/BondBaseAction.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/actelion/research/share/gui/editor/actions/BondBaseAction.java b/src/main/java/com/actelion/research/share/gui/editor/actions/BondBaseAction.java index 1a516501..27a80056 100644 --- a/src/main/java/com/actelion/research/share/gui/editor/actions/BondBaseAction.java +++ b/src/main/java/com/actelion/research/share/gui/editor/actions/BondBaseAction.java @@ -79,6 +79,10 @@ public void onChangeBond(int bond) public boolean onMouseUp(IMouseEvent evt) { + // Ignore event if the action didn't start in the editor. + if (origin == null) { + return false; + } boolean ok = true; GenericPoint pt = new GenericPoint(evt.getX(), evt.getY());