Centre table floats without losing rules or columns
The rule rectangle used width-margin for its right edge, so a centred table shrank or lost its booktabs rules. Derive the right edge from the last column offset instead, then centre a table float by shifting its margin. All three columns and the rules now stay inside the measure. Test count stays 1074.
This commit is contained in:
1 parent
aa2f3cb0af
commit
576626fe04
2 files changed
+7
-2
No files matched your search
@@ -678,7 +678,7 @@ impl Halign {
|
||||
let start = rule.start.min(last);
|
||||
let end = rule.end.min(last).max(start);
|
||||
let x = self.column_offset(start) + rule.trim_left;
|
||||
let right = (self.column_offset(end + 1) - rule.trim_right).min(self.width - self.margin);
|
||||
let right = self.column_offset(end + 1) - rule.trim_right;
|
||||
(x, (right - x).max(65_536))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user