Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account for empty ranges in Slider and ProgressBar #527

Merged
merged 3 commits into from
Nov 26, 2020

Commits on Nov 26, 2020

  1. fix active_progress_width formula

    change :
    let active_progress_width = bounds.width * ((value - range_start) / (range_end - range_start).max(1.0))
    to :
    let active_progress_width = bounds.width * ((value - range_start) / (range_end - range_start).max(f32::EPSILON)).max(0.0).min(1.0)
    rubik83 authored and hecrj committed Nov 26, 2020
    Configuration menu
    Copy the full SHA
    9991a89 View commit details
    Browse the repository at this point in the history
  2. fix slider handle_offset formula

    change :
    let handle_offset = (bounds.width - handle_width) * ((value - range_start) / (range_end - range_start).max(1.0))
    to :
    let handle_offset = (bounds.width - handle_width) * ((value - range_start) / (range_end - range_start).max(f32::EPSILON)).max(0.0).min(1.0)
    rubik83 authored and hecrj committed Nov 26, 2020
    Configuration menu
    Copy the full SHA
    955b62e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c23136a View commit details
    Browse the repository at this point in the history