If the minimum of the linear gauge is not zero, it incorrectly displays the "progress". This PR fixes it.
Previously non-working config:
Min value 24, max value 25, current value 24.5.
Previous normalized_value would be min(max(24.5,0), 25) * width / 25 = min(24.5, 25) * width / 25 = 24.5 * width / 25 = almost 100% width, while it should be 50%.
New normalized value is min(max(24.5-24, 0), 25 - 24) * width / (25-24) = min(0.5, 1) * width / 1 = 50% width.
If the minimum of the linear gauge is not zero, it incorrectly displays the "progress". This PR fixes it.
Previously non-working config:
Min value 24, max value 25, current value 24.5.
Previous normalized_value would be
min(max(24.5,0), 25) * width / 25 = min(24.5, 25) * width / 25 = 24.5 * width / 25 = almost 100% width
, while it should be 50%.New normalized value is
min(max(24.5-24, 0), 25 - 24) * width / (25-24) = min(0.5, 1) * width / 1 = 50% width
.