Skip to content

Commit

Permalink
Check if line_count is zero to calculate space around line
Browse files Browse the repository at this point in the history
  • Loading branch information
DominoTree committed Aug 26, 2017
1 parent 1e0ebf1 commit 684816b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/layout/flex.rs
Expand Up @@ -713,14 +713,18 @@ impl FlexFlow {

line_interval = match line_align {
align_content::T::space_between => {
if line_count == 1 {
if line_count <= 1 {
Au(0)
} else {
free_space / (line_count - 1)
}
}
align_content::T::space_around => {
free_space / line_count
if line_count == 0 {
Au(0)
} else {
free_space / line_count
}
}
_ => Au(0),
};
Expand Down

0 comments on commit 684816b

Please sign in to comment.