From d2e92fd36f8bd6bb54724abf36acd918edcf6875 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 27 Oct 2015 15:30:51 +0100 Subject: [PATCH] trigger mouse click actions on release instead of on press (avoids problems with dragging) --- apps/opencs/view/render/worldspacewidget.cpp | 28 +++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/apps/opencs/view/render/worldspacewidget.cpp b/apps/opencs/view/render/worldspacewidget.cpp index e539c14b9..3f4b77383 100644 --- a/apps/opencs/view/render/worldspacewidget.cpp +++ b/apps/opencs/view/render/worldspacewidget.cpp @@ -563,25 +563,14 @@ void CSVRender::WorldspaceWidget::mousePressEvent (QMouseEvent *event) if (!mDragging) mDragMode = button; - - if (button=="p-navi" || button=="s-navi") - { - - } - else if (button=="p-edit" || button=="s-edit" || button=="select") - { - osg::ref_ptr tag = mousePick (event); - - handleMouseClick (tag, button); - } } void CSVRender::WorldspaceWidget::mouseReleaseEvent (QMouseEvent *event) { + std::string button = mapButton (event); + if (mDragging) { - std::string button = mapButton (event); - if (mDragMode=="p-navi" || mDragMode=="s-navi") { @@ -594,6 +583,19 @@ void CSVRender::WorldspaceWidget::mouseReleaseEvent (QMouseEvent *event) mDragging = false; } } + else + { + if (button=="p-navi" || button=="s-navi") + { + + } + else if (button=="p-edit" || button=="s-edit" || button=="select") + { + osg::ref_ptr tag = mousePick (event); + + handleMouseClick (tag, button); + } + } mDragMode.clear(); }