Skip to content

Commit d5a80dc

Browse files
committed
docs: add kdoc for CheckPointsValueDistribution
1 parent 1fe6651 commit d5a80dc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

slider/src/main/java/io/monstarlab/mosaic/slider/distribution/CheckPointsValueDistribution.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ import io.monstarlab.mosaic.slider.math.Point
55
import io.monstarlab.mosaic.slider.math.RangedLinearEquation
66
import io.monstarlab.mosaic.slider.math.valueToFraction
77

8+
/**
9+
* Represents a distribution strategy for slider values based on a list of check points.
10+
* Each check point is a pair of offset fraction and value that will be associated with with this progress
11+
* The distribution will interpolate between the check points using linear equations.
12+
*
13+
* Example:
14+
* For the value range of 0..100
15+
* CheckPointsValueDistribution(listOf(0f to 0f, 0.5f to 80f, 1f to 100f))
16+
* This will create a distribution that will place value of 80 at 0.5 progress allowing the user to
17+
* have more precision while selecting values between 80 and 100
18+
*/
819
public class CheckPointsValueDistribution(
920
valuesMap: List<Pair<Float, Float>>,
1021
) :

0 commit comments

Comments
 (0)