mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Use CSSPixelLength in LengthOrPercentage{*}.
Replace Au with CSSPixelLength in LengthOrPercentage, LengthOrPercentageOrAuto, and LengthOrPercentageOrNone.
This commit is contained in:
parent
535c1e3c6f
commit
b89286e8e7
25 changed files with 109 additions and 118 deletions
|
@ -3039,7 +3039,7 @@ struct StopRun {
|
|||
|
||||
fn position_to_offset(position: LengthOrPercentage, total_length: Au) -> f32 {
|
||||
match position {
|
||||
LengthOrPercentage::Length(Au(length)) => length as f32 / total_length.0 as f32,
|
||||
LengthOrPercentage::Length(l) => l.to_i32_au() as f32 / total_length.0 as f32,
|
||||
LengthOrPercentage::Percentage(percentage) => percentage.0 as f32,
|
||||
LengthOrPercentage::Calc(calc) => {
|
||||
calc.to_used_value(Some(total_length)).unwrap().0 as f32 / total_length.0 as f32
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue