Skip to content

The calculation ((maxRange - minRange) / 0.1f).toInt() - 1 can result in negative values when the range is very small (less than 0.1). While maxOf(0, ...) prevents negative steps, this could result in 0 steps which may cause unexpected slider behavior. Consider using maxOf(1, ...) to ensure at least one step. #41

@JnCoe

Description

@JnCoe

The calculation ((maxRange - minRange) / 0.1f).toInt() - 1 can result in negative values when the range is very small (less than 0.1). While maxOf(0, ...) prevents negative steps, this could result in 0 steps which may cause unexpected slider behavior. Consider using maxOf(1, ...) to ensure at least one step.

                            steps = maxOf(1, ((maxRange - minRange) / 0.1f).toInt() - 1), // Dynamic steps based on range, ensure at least 1 step

Originally posted by @Copilot in #40 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions