mirror of
https://github.com/leozide/leocad
synced 2025-02-07 08:45:49 +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)
|
if (Location == lcViewCubeLocation::DISABLED)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (mMouseDown)
|
if (IsDragging())
|
||||||
{
|
{
|
||||||
if (qAbs(mMouseDownX - mView->mInputState.x) > 3 || qAbs(mMouseDownY - mView->mInputState.y) > 3)
|
mIntersectionFlags.reset();
|
||||||
{
|
mView->StartOrbitTracking();
|
||||||
mIntersectionFlags.reset();
|
return true;
|
||||||
mMouseDown = false;
|
|
||||||
mView->StartOrbitTracking();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mView->IsTracking())
|
if (mView->IsTracking())
|
||||||
|
@ -352,5 +348,10 @@ bool lcViewCube::OnMouseMove()
|
||||||
mView->Redraw();
|
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 OnMouseMove();
|
||||||
bool OnLeftButtonUp();
|
bool OnLeftButtonUp();
|
||||||
bool OnLeftButtonDown();
|
bool OnLeftButtonDown();
|
||||||
|
bool IsDragging() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
lcMatrix44 GetViewMatrix() const;
|
lcMatrix44 GetViewMatrix() const;
|
||||||
|
|
|
@ -2878,7 +2878,17 @@ void View::OnMouseMove()
|
||||||
if (mTrackButton == LC_TRACKBUTTON_NONE)
|
if (mTrackButton == LC_TRACKBUTTON_NONE)
|
||||||
{
|
{
|
||||||
if (mViewCube.OnMouseMove())
|
if (mViewCube.OnMouseMove())
|
||||||
|
{
|
||||||
|
lcTrackTool NewTrackTool = mViewCube.IsDragging() ? LC_TRACKTOOL_ORBIT_XY : LC_TRACKTOOL_NONE;
|
||||||
|
|
||||||
|
if (NewTrackTool != mTrackTool)
|
||||||
|
{
|
||||||
|
mTrackTool = NewTrackTool;
|
||||||
|
OnUpdateCursor();
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
UpdateTrackTool();
|
UpdateTrackTool();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue