Remove unnecessary result in line shaping (#30721)

Updates #29879

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2025-05-16 23:48:36 +02:00 committed by GitHub
parent d791c6cdb1
commit ff0060aa36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 118 additions and 155 deletions

View file

@ -106,10 +106,7 @@ impl TableView {
for field in table.schema.fields.iter() {
runs[0].len = field.name.len();
let mut width = text_system
.layout_line(&field.name, font_size, &runs)
.map(|layout| layout.width)
.unwrap_or(px(0.));
let mut width = text_system.layout_line(&field.name, font_size, &runs).width;
let Some(data) = table.data.as_ref() else {
widths.push(width);
@ -122,8 +119,7 @@ impl TableView {
let cell_width = window
.text_system()
.layout_line(&content, font_size, &runs)
.map(|layout| layout.width)
.unwrap_or(px(0.));
.width;
width = width.max(cell_width)
}