fix numeric input initial value to be in range

This commit is contained in:
Andrea Blankenstijn 2021-07-23 22:32:56 +02:00
parent 4b87af7bc4
commit cc0bed2287
2 changed files with 2 additions and 1 deletions

View file

@ -195,6 +195,8 @@ namespace bwidgets::widget
if (min > max)
throw std::invalid_argument("min cannot be greater than max");
_value_range = {min, max};
Input<T>::value = process_value(Input<T>::value);
Input<T>::input_text(Input<T>::value_to_string(Input<T>::value));
return this;
}
};

View file

@ -3,7 +3,6 @@
#include <basic_widgets/core/math.hpp>
#include <basic_widgets/core/texture.hpp>
#include <basic_widgets/w/caption.hpp>
#include <iostream>
using namespace bwidgets;