Paint vertical rules from table column separators

This commit is contained in:
gloamxun committed 2026-10-25 02:29:23 +08:00
1 parent 8bd725e9ff
commit 6d0794ef3a
6 files changed
+74 -11

No files matched your search

+18
View File
@@ -401,6 +401,24 @@ impl Halign {
height: rule.width,
});
}
let rule_width = 26_214; // 0.4pt in scaled points.
for boundary in &self.vertical_rules {
let x = match *boundary {
0 => 0,
index if index >= self.column_widths.len() => (self.width - rule_width).max(0),
index => {
let left = self.column_offset(index - 1) + self.column_widths[index - 1];
let right = self.column_offset(index);
((left + right) / 2 - rule_width / 2).max(0)
}
};
list.push(DisplayItem::Rule {
x,
y: 0,
width: rule_width,
height: self.height,
});
}
list
}
}