Fixed slider being grabbed when pressing mouse1 outside the slider rect and then moving hover it

This commit is contained in:
LordSk 2019-02-04 16:37:19 +01:00
parent 5e01ed3352
commit 8e651de217

View file

@ -2817,7 +2817,7 @@ void CMenus::EndScrollRegion(CScrollRegion* pSr)
{
UI()->SetHotItem(pID);
if(!UI()->CheckActiveItem(pID) && UI()->MouseButton(0))
if(!UI()->CheckActiveItem(pID) && UI()->MouseButtonClicked(0))
{
UI()->SetActiveItem(pID);
pSr->m_MouseGrabStart.y = UI()->MouseY();
@ -2830,7 +2830,7 @@ void CMenus::EndScrollRegion(CScrollRegion* pSr)
UI()->SetActiveItem(0);
// move slider
if(UI()->CheckActiveItem(pID))
if(UI()->CheckActiveItem(pID) && UI()->MouseButton(0))
{
float my = UI()->MouseY();
pSr->m_ScrollY += my - pSr->m_MouseGrabStart.y;