Skip to content

fix brush duration reporting rounding error

Before this Merge Request there is a rounding error when you open up the brush editor and see the value for Time of a brush setting(such as Hue). This value is always rounded down to nearest integer. Values less than 1 are rounded to 0.02 ( since this is the smallest value allowed for duration).

To reproduce:

  1. Open brush editor
  2. Go to Color -> Hue -> Time -> Duration bar
  3. Set duration to some non-integer value
  4. Overwrite Brush preset and close brush editor
  5. Re-open brush editor
  6. Go to Color -> Hue -> Time and see Duration is now set to an integer ( or 0.02).

I think the Duration is actually getting set correctly it's just the reporting of the number in the Duration bar is incorrect. If I set the Duration to 1.99, draw a line, set duration to 1.00, and draw another line the two lines take a noticeably different amount of time to cycle through the hues. If you try this yourself it is easier to see if you unclick "repeat" in the brush editor.

To Test this MR: Follow reproduce steps but the value of Duration should be exactly you set when you re-open the brush editor

This was found/discuss on reddit here

Edited by reinold rojas

Merge request reports