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

Fix to issue 9338 #9341

Merged
merged 1 commit into from Jan 18, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -1928,22 +1928,14 @@ struct StopRun {
stop_count: usize,
}

fn fmin(a: f32, b: f32) -> f32 {
if a < b {
a
} else {
b
}
}

fn position_to_offset(position: LengthOrPercentage, Au(total_length): Au) -> f32 {
match position {
LengthOrPercentage::Length(Au(length)) => {
fmin(1.0, (length as f32) / (total_length as f32))
(1.0f32).min(length as f32 / total_length as f32)
}
LengthOrPercentage::Percentage(percentage) => percentage as f32,
LengthOrPercentage::Calc(calc) =>
fmin(1.0, calc.percentage() + (calc.length().0 as f32) / (total_length as f32)),
(1.0f32).min(calc.percentage() + (calc.length().0 as f32) / (total_length as f32)),
}
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.