mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
Merge pull request #2019 from LordSk/fix/sr_scrollbar_grab
Fixed scroll region slider being grabbed before specifically clicking on it
This commit is contained in:
commit
5b30a168bb
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue