Support nesting editboxes, pickers and scrollbars in clipping areas

This commit is contained in:
Robert Müller 2022-05-13 21:34:46 +02:00
parent 1e8278ca95
commit ca091d87b2
2 changed files with 6 additions and 8 deletions

View file

@ -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))

View file

@ -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;