mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Merge pull request #8780 from ChillerDragon/pr_ed_fix_prop_clamp
Fix editor properties not being clamped on + and - button click
This commit is contained in:
commit
1ebfe269aa
|
@ -50,13 +50,13 @@ SEditResult<E> CEditor::DoPropertiesWithState(CUIRect *pToolBox, CProperty *pPro
|
||||||
}
|
}
|
||||||
if(DoButton_FontIcon((char *)&pIds[i] + 1, FONT_ICON_MINUS, 0, &Dec, 0, "Decrease", IGraphics::CORNER_L, 7.0f))
|
if(DoButton_FontIcon((char *)&pIds[i] + 1, FONT_ICON_MINUS, 0, &Dec, 0, "Decrease", IGraphics::CORNER_L, 7.0f))
|
||||||
{
|
{
|
||||||
*pNewVal = pProps[i].m_Value - 1;
|
*pNewVal = clamp(pProps[i].m_Value - 1, pProps[i].m_Min, pProps[i].m_Max);
|
||||||
Change = i;
|
Change = i;
|
||||||
State = EEditState::ONE_GO;
|
State = EEditState::ONE_GO;
|
||||||
}
|
}
|
||||||
if(DoButton_FontIcon(((char *)&pIds[i]) + 2, FONT_ICON_PLUS, 0, &Inc, 0, "Increase", IGraphics::CORNER_R, 7.0f))
|
if(DoButton_FontIcon(((char *)&pIds[i]) + 2, FONT_ICON_PLUS, 0, &Inc, 0, "Increase", IGraphics::CORNER_R, 7.0f))
|
||||||
{
|
{
|
||||||
*pNewVal = pProps[i].m_Value + 1;
|
*pNewVal = clamp(pProps[i].m_Value + 1, pProps[i].m_Min, pProps[i].m_Max);
|
||||||
Change = i;
|
Change = i;
|
||||||
State = EEditState::ONE_GO;
|
State = EEditState::ONE_GO;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue