numeric robustness

This commit is contained in:
Jupeyy 2020-11-15 07:38:49 +01:00
parent 51a31774f8
commit e2be287827
2 changed files with 4 additions and 4 deletions

View file

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

View file

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