mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #4323
4323: Pr no selection on template r=def- a=Jupeyy fixes #4322 ## Checklist - [x] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Jupeyy <jupjopjap@gmail.com>
This commit is contained in:
commit
62b4d94f3c
|
@ -312,9 +312,11 @@ int CUIEx::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned StrSi
|
|||
UpdateOffset = true;
|
||||
}
|
||||
|
||||
bool IsEmptyText = false;
|
||||
if(pDisplayStr[0] == '\0')
|
||||
{
|
||||
pDisplayStr = pEmptyText;
|
||||
IsEmptyText = true;
|
||||
TextRender()->TextColor(1, 1, 1, 0.75f);
|
||||
}
|
||||
|
||||
|
@ -382,7 +384,7 @@ int CUIEx::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned StrSi
|
|||
m_MouseCurX = UI()->MouseX();
|
||||
m_MouseCurY = UI()->MouseY();
|
||||
}
|
||||
HasMouseSel = m_MouseIsPress;
|
||||
HasMouseSel = m_MouseIsPress && !IsEmptyText;
|
||||
if(m_MouseIsPress && UI()->MouseButtonReleased(0))
|
||||
{
|
||||
m_MouseIsPress = false;
|
||||
|
|
Loading…
Reference in a new issue