mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
numeric robustness
This commit is contained in:
parent
51a31774f8
commit
e2be287827
|
@ -483,7 +483,7 @@ int CMenus::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned StrS
|
|||
do
|
||||
{
|
||||
*Offset += minimum(wt - *Offset - Textbox.w, Textbox.w / 3);
|
||||
} while(w - *Offset > Textbox.w);
|
||||
} while(w - *Offset > Textbox.w + 0.0001f);
|
||||
}
|
||||
else if(w - *Offset < 0.0f)
|
||||
{
|
||||
|
@ -491,7 +491,7 @@ int CMenus::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned StrS
|
|||
do
|
||||
{
|
||||
*Offset = maximum(0.0f, *Offset - Textbox.w / 3);
|
||||
} while(w - *Offset < 0.0f);
|
||||
} while(w - *Offset < -0.0001f);
|
||||
}
|
||||
}
|
||||
UI()->ClipEnable(pRect);
|
||||
|
|
|
@ -461,7 +461,7 @@ int CEditor::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned Str
|
|||
do
|
||||
{
|
||||
*Offset += minimum(wt - *Offset - Textbox.w, Textbox.w / 3);
|
||||
} while(w - *Offset > Textbox.w);
|
||||
} while(w - *Offset > Textbox.w + 0.0001f);
|
||||
}
|
||||
else if(w - *Offset < 0.0f)
|
||||
{
|
||||
|
@ -469,7 +469,7 @@ int CEditor::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned Str
|
|||
do
|
||||
{
|
||||
*Offset = maximum(0.0f, *Offset - Textbox.w / 3);
|
||||
} while(w - *Offset < 0.0f);
|
||||
} while(w - *Offset < -0.0001f);
|
||||
}
|
||||
}
|
||||
UI()->ClipEnable(pRect);
|
||||
|
|
Loading…
Reference in a new issue