mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Support nesting editboxes, pickers and scrollbars in clipping areas
This commit is contained in:
parent
1e8278ca95
commit
ca091d87b2
|
@ -466,9 +466,7 @@ int CUI::DoButtonLogic(const void *pID, int Checked, const CUIRect *pRect)
|
|||
|
||||
int CUI::DoPickerLogic(const void *pID, const CUIRect *pRect, float *pX, float *pY)
|
||||
{
|
||||
const bool Inside = MouseInside(pRect);
|
||||
|
||||
if(Inside)
|
||||
if(MouseHovered(pRect))
|
||||
SetHotItem(pID);
|
||||
|
||||
if(HotItem() == pID && MouseButtonClicked(0))
|
||||
|
|
|
@ -57,8 +57,8 @@ float CUIEx::DoScrollbarV(const void *pID, const CUIRect *pRect, float Current)
|
|||
|
||||
// logic
|
||||
static float s_OffsetY;
|
||||
const bool InsideRail = UI()->MouseInside(&Rail);
|
||||
const bool InsideHandle = UI()->MouseInside(&Handle);
|
||||
const bool InsideRail = UI()->MouseHovered(&Rail);
|
||||
const bool InsideHandle = UI()->MouseHovered(&Handle);
|
||||
bool Grabbed = false; // whether to apply the offset
|
||||
|
||||
if(UI()->ActiveItem() == pID)
|
||||
|
@ -137,8 +137,8 @@ float CUIEx::DoScrollbarH(const void *pID, const CUIRect *pRect, float Current,
|
|||
|
||||
// logic
|
||||
static float s_OffsetX;
|
||||
const bool InsideRail = UI()->MouseInside(&Rail);
|
||||
const bool InsideHandle = UI()->MouseInside(&Handle);
|
||||
const bool InsideRail = UI()->MouseHovered(&Rail);
|
||||
const bool InsideHandle = UI()->MouseHovered(&Handle);
|
||||
bool Grabbed = false; // whether to apply the offset
|
||||
|
||||
if(UI()->ActiveItem() == pID)
|
||||
|
@ -214,7 +214,7 @@ float CUIEx::DoScrollbarH(const void *pID, const CUIRect *pRect, float Current,
|
|||
|
||||
bool CUIEx::DoEditBox(const void *pID, const CUIRect *pRect, char *pStr, unsigned StrSize, float FontSize, float *pOffset, bool Hidden, int Corners, const SUIExEditBoxProperties &Properties)
|
||||
{
|
||||
const bool Inside = UI()->MouseInside(pRect);
|
||||
const bool Inside = UI()->MouseHovered(pRect);
|
||||
bool ReturnValue = false;
|
||||
bool UpdateOffset = false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue