diff --git a/common/lc_viewcube.cpp b/common/lc_viewcube.cpp index 4d49c473..0bfcc8b8 100644 --- a/common/lc_viewcube.cpp +++ b/common/lc_viewcube.cpp @@ -295,15 +295,11 @@ bool lcViewCube::OnMouseMove() if (Location == lcViewCubeLocation::DISABLED) return false; - if (mMouseDown) + if (IsDragging()) { - if (qAbs(mMouseDownX - mView->mInputState.x) > 3 || qAbs(mMouseDownY - mView->mInputState.y) > 3) - { - mIntersectionFlags.reset(); - mMouseDown = false; - mView->StartOrbitTracking(); - return true; - } + mIntersectionFlags.reset(); + mView->StartOrbitTracking(); + return true; } if (mView->IsTracking()) @@ -352,5 +348,10 @@ bool lcViewCube::OnMouseMove() mView->Redraw(); } - return true; + return mIntersectionFlags.any(); +} + +bool lcViewCube::IsDragging() const +{ + return mMouseDown && (qAbs(mMouseDownX - mView->mInputState.x) > 3 || qAbs(mMouseDownY - mView->mInputState.y) > 3); } diff --git a/common/lc_viewcube.h b/common/lc_viewcube.h index c91525ae..b05c5c4e 100644 --- a/common/lc_viewcube.h +++ b/common/lc_viewcube.h @@ -14,6 +14,7 @@ public: bool OnMouseMove(); bool OnLeftButtonUp(); bool OnLeftButtonDown(); + bool IsDragging() const; protected: lcMatrix44 GetViewMatrix() const; diff --git a/common/view.cpp b/common/view.cpp index 3da114f7..4cdec0b3 100644 --- a/common/view.cpp +++ b/common/view.cpp @@ -2878,7 +2878,17 @@ void View::OnMouseMove() if (mTrackButton == LC_TRACKBUTTON_NONE) { if (mViewCube.OnMouseMove()) + { + lcTrackTool NewTrackTool = mViewCube.IsDragging() ? LC_TRACKTOOL_ORBIT_XY : LC_TRACKTOOL_NONE; + + if (NewTrackTool != mTrackTool) + { + mTrackTool = NewTrackTool; + OnUpdateCursor(); + } + return; + } UpdateTrackTool();