Skip to content

Commit

Permalink
Merge pull request qdtroy#157 from nakkler/master
Browse files Browse the repository at this point in the history
fix CButtonUI bug
  • Loading branch information
qdtroy authored Sep 5, 2022
2 parents bfa997c + 7cf455c commit ab106eb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions DuiLib/Control/UIButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,14 @@ namespace DuiLib
}
if( event.Type == UIEVENT_MOUSEMOVE )
{
if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
if( ::PtInRect(&m_rcItem, event.ptMouse) ) m_uButtonState |= UISTATE_PUSHED;
else m_uButtonState &= ~UISTATE_PUSHED;
Invalidate();
}
if (m_pManager->IsCaptured())
{
if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
if( ::PtInRect(&m_rcItem, event.ptMouse) ) m_uButtonState |= UISTATE_PUSHED;
else m_uButtonState &= ~UISTATE_PUSHED;
Invalidate();
}
}
return;
}
if( event.Type == UIEVENT_BUTTONUP )
Expand Down

0 comments on commit ab106eb

Please sign in to comment.