mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Fix dimensionality of Au
Previously, we implemented: Au * Au -> Au Au / Au -> Au Au % Au -> Au ... which are inconsistent. It should be: Au * Au -> SquaredAu Au / Au -> i32 Au % Au -> i32 or: Au * i32 -> Au Au / i32 -> Au Au % i32 -> Au I picked the latter. Also, the multiplicative identity does not make sense when multiplication take two different types.
This commit is contained in:
parent
2652d223f5
commit
415bbaeb2e
2 changed files with 11 additions and 21 deletions
|
@ -273,7 +273,7 @@ impl Flow for TableFlow {
|
|||
*col_inline_size = (*col_inline_size).scale_by(ratio);
|
||||
}
|
||||
} else if num_unspecified_inline_sizes != 0 {
|
||||
let extra_column_inline_size = (content_inline_size - total_column_inline_size) / Au::new(num_unspecified_inline_sizes);
|
||||
let extra_column_inline_size = (content_inline_size - total_column_inline_size) / num_unspecified_inline_sizes;
|
||||
for col_inline_size in self.col_inline_sizes.mut_iter() {
|
||||
if *col_inline_size == Au(0) {
|
||||
*col_inline_size = extra_column_inline_size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue