Fix NumericEditBox behavior broken by switch to std::stoi

For some reason stoi doesn't throw an error for '1foo' while 'foo1' does.

Now the edit box flat out rejects any non-digit key events.
new-script-api
scrawl 7 years ago
parent 719255c5c6
commit 9fda3b6db4

@ -87,7 +87,7 @@ namespace Gui
setValue(std::max(mValue-1, mMinValue)); setValue(std::max(mValue-1, mMinValue));
eventValueChanged(mValue); eventValueChanged(mValue);
} }
else else if (character == 0 || (character >= '0' && character <= '9'))
Base::onKeyButtonPressed(key, character); Base::onKeyButtonPressed(key, character);
} }

Loading…
Cancel
Save