vgui_controls: fix mouse click

This commit is contained in:
nillerusr 2020-11-17 23:05:31 +03:00
parent d4c9ed338f
commit f27eb7916b

View file

@ -696,13 +696,13 @@ void Button::SetMouseClickEnabled(MouseCode code,bool state)
if(state) if(state)
{ {
//set bit to 1 //set bit to 1
_mouseClickMask|=1<<((int)(code+1)); _mouseClickMask|=1<<(static_cast<int>(code-MOUSE_FIRST));
} }
else else
{ {
//set bit to 0 //set bit to 0
_mouseClickMask&=~(1<<((int)(code+1))); _mouseClickMask&=~(static_cast<int>(code-MOUSE_FIRST));
} }
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -710,7 +710,7 @@ void Button::SetMouseClickEnabled(MouseCode code,bool state)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool Button::IsMouseClickEnabled(MouseCode code) bool Button::IsMouseClickEnabled(MouseCode code)
{ {
if(_mouseClickMask&(1<<((int)(code+1)))) if(_mouseClickMask&(1<<(static_cast<int>(code-MOUSE_FIRST))))
{ {
return true; return true;
} }