plasma icon indicating copy to clipboard operation
plasma copied to clipboard

fix hot reload min/max change breaking slider

Open Boegie19 opened this issue 2 years ago • 1 comments

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:

  1. Making it smaller makes you not able to use the full slider.
  2. 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

Boegie19 avatar Jul 20 '22 16:07 Boegie19

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.

LastTalon avatar Oct 24 '23 23:10 LastTalon