Skip to content

Commit f71a1b8

Browse files
authored
Change formula for ratio
Hello! I've tried to use this component, but as my min value is greater than 0, I've discovered a bug in the way the ratio was calculed ; you should substract the min value from the max value :)
1 parent 09d6c79 commit f71a1b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DoubleSlider.elm

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ update message model =
157157
0
158158
, thumbStartingPosition = offsetLeft + 16
159159
, thumbParentWidth = offsetWidth
160-
, ratio = model.max / offsetWidth
160+
, ratio = (model.max - model.min) / offsetWidth
161161
, dragStartPosition = toFloat positionX
162162
}
163163
in

0 commit comments

Comments
 (0)