mirror of
https://github.com/leozide/leocad
synced 2025-01-30 20:34:56 +01:00
Fixed wrong cursor when the mouse is over the view cube and other objects at the same time.
This commit is contained in:
parent
7ba01dbff7
commit
f507e08cde
3 changed files with 21 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ public:
|
|||
bool OnMouseMove();
|
||||
bool OnLeftButtonUp();
|
||||
bool OnLeftButtonDown();
|
||||
bool IsDragging() const;
|
||||
|
||||
protected:
|
||||
lcMatrix44 GetViewMatrix() const;
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue