1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0031102: Visualization, AIS_ViewController - AIS_DragAction_Stop is never emitted on mouse unclick

AIS_ViewController::UpdateMousePosition() now sets myMouseStopDragOnUnclick flag
to emit AIS_DragAction_Stop on mouse unclick.
This commit is contained in:
kgv 2019-10-24 13:44:49 +03:00 committed by apn
parent 5646c90e87
commit 215dd33149
2 changed files with 10 additions and 0 deletions

View File

@ -69,6 +69,7 @@ AIS_ViewController::AIS_ViewController()
myMousePressed (Aspect_VKeyMouse_NONE),
myMouseModifiers (Aspect_VKeyFlags_NONE),
myMouseSingleButton (-1),
myMouseStopDragOnUnclick (false),
//
myTouchToleranceScale (1.0f),
myTouchRotationThresholdPx (6.0f),
@ -611,6 +612,7 @@ bool AIS_ViewController::UpdateMouseButtons (const Graphic3d_Vec2i& thePoint,
{
myMouseClickTimer.Stop();
myMouseClickCounter = 0;
myMouseStopDragOnUnclick = false;
myUI.Dragging.ToStop = true;
toUpdateView = true;
}
@ -619,6 +621,12 @@ bool AIS_ViewController::UpdateMouseButtons (const Graphic3d_Vec2i& thePoint,
else if (theButtons == Aspect_VKeyMouse_NONE)
{
myMouseSingleButton = -1;
if (myMouseStopDragOnUnclick)
{
myMouseStopDragOnUnclick = false;
myUI.Dragging.ToStop = true;
toUpdateView = true;
}
}
else if (myMouseSingleButton == -1)
{
@ -769,6 +777,7 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
myMouseClickTimer.Stop();
myMouseClickCounter = 0;
myMouseSingleButton = -1;
myMouseStopDragOnUnclick = true;
}
}

View File

@ -647,6 +647,7 @@ protected: //! @name mouse input variables
Aspect_VKeyMouse myMousePressed; //!< active mouse buttons
Aspect_VKeyFlags myMouseModifiers; //!< active key modifiers passed with last mouse event
Standard_Integer myMouseSingleButton; //!< index of mouse button pressed alone (>0)
Standard_Boolean myMouseStopDragOnUnclick; //!< queue stop dragging even with at next mouse unclick
protected: //! @name multi-touch input variables