Fix exponential sliders
This commit is contained in:
parent
3b68f0d051
commit
5b03af6b73
1 changed files with 2 additions and 2 deletions
|
@ -50,9 +50,9 @@ void Slider::_input_event(InputEvent p_event) {
|
|||
grab.pos=orientation==VERTICAL?mb.y:mb.x;
|
||||
double max = orientation==VERTICAL ? get_size().height : get_size().width ;
|
||||
if (orientation==VERTICAL)
|
||||
set_val( ( ( -(double)grab.pos / max) * ( get_max() - get_min() ) ) + get_max() );
|
||||
set_unit_value( 1 - ((double)grab.pos / max) );
|
||||
else
|
||||
set_val( ( ( (double)grab.pos / max) * ( get_max() - get_min() ) ) + get_min() );
|
||||
set_unit_value((double)grab.pos / max);
|
||||
grab.active=true;
|
||||
grab.uvalue=get_unit_value();
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue