trigger mouse click actions on release instead of on press (avoids problems with dragging)

openmw-37
Marc Zinnschlag 9 years ago
parent f3ee3f5be1
commit d2e92fd36f

@ -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<TagBase> 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<TagBase> tag = mousePick (event);
handleMouseClick (tag, button);
}
}
mDragMode.clear();
}

Loading…
Cancel
Save