mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Check if line_count is zero to calculate space around line
This commit is contained in:
parent
1e0ebf1c1a
commit
684816bfb3
1 changed files with 6 additions and 2 deletions
|
@ -713,14 +713,18 @@ impl FlexFlow {
|
||||||
|
|
||||||
line_interval = match line_align {
|
line_interval = match line_align {
|
||||||
align_content::T::space_between => {
|
align_content::T::space_between => {
|
||||||
if line_count == 1 {
|
if line_count <= 1 {
|
||||||
Au(0)
|
Au(0)
|
||||||
} else {
|
} else {
|
||||||
free_space / (line_count - 1)
|
free_space / (line_count - 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
align_content::T::space_around => {
|
align_content::T::space_around => {
|
||||||
free_space / line_count
|
if line_count == 0 {
|
||||||
|
Au(0)
|
||||||
|
} else {
|
||||||
|
free_space / line_count
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ => Au(0),
|
_ => Au(0),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue