plasma
plasma copied to clipboard
fix hot reload min/max change breaking slider
fix hot reload min/max change breaking slider
Problem
if you change the min or max values with a hot reload the slider beaks The slider will still think the initial min and max variables are the current once even after changing them. This causes the following problems:
- Making it smaller makes you not able to use the full slider.
- Making it bigger makes the dot go off screen.
My solution
Change it so that useInstance only sets a percentage with out knowing the min and max value. This fixes both problems put above. This means that I changed the value state to a percentage state and calculate the value every frame.
Changed behaver
This fix changes the behaver of the slider once the values are changed. Before value stayed the same even if the min and max changed After now the percentage will stay the same meaning the value changes if min and max are changed
I've had a look at this, it seems like a decent fix, but I want to take some more time to try this out.