From d1683067c67651a0ee2aada8ac383bb90e075e12 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 3 Mar 2022 01:53:46 -0500 Subject: [PATCH] Only dispatch ActionEvent on mouse down in SvgButton. --- src/app/SvgButton.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/SvgButton.cpp b/src/app/SvgButton.cpp index bd4cc8a6..07ad2429 100644 --- a/src/app/SvgButton.cpp +++ b/src/app/SvgButton.cpp @@ -21,11 +21,10 @@ SvgButton::SvgButton() { void SvgButton::onButton(const ButtonEvent& e) { OpaqueWidget::onButton(e); - // Accept left and right-click dragging. - if (e.action == GLFW_PRESS && (e.button == GLFW_MOUSE_BUTTON_LEFT || e.button == GLFW_MOUSE_BUTTON_RIGHT)) { + // Dispatch ActionEvent on left click + if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT) { ActionEvent eAction; onAction(eAction); - e.consume(this); } } @@ -64,10 +63,11 @@ void SvgButton::onDragEnd(const DragEndEvent& e) { void SvgButton::onDragDrop(const DragDropEvent& e) { - if (e.origin == this) { - ActionEvent eAction; - onAction(eAction); - } + // Don't dispatch ActionEvent on DragDrop because it's already called on mouse down. + // if (e.origin == this) { + // ActionEvent eAction; + // onAction(eAction); + // } }