1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

Change default text centering to BOTTOM

This commit is contained in:
Emil Ernerfeldt
2024-09-19 09:46:05 +02:00
parent 098032eb05
commit 44714285b0
3 changed files with 8 additions and 4 deletions

View File

@@ -604,7 +604,12 @@ fn galley_from_rows(
glyph.pos.y = cursor_y
+ glyph.font_impl_ascent
+ format.valign.to_factor() * (row_height - glyph.font_impl_height);
+ format.valign.to_factor() * (row_height - glyph.font_impl_height)
// When mixing different `FontImpl` (e.g. latin and emojis),
// we always center the difference:
+ 0.5 * (glyph.font_impl_height - glyph.size.y);
glyph.pos.y = point_scale.round_to_pixel(glyph.pos.y);
}

View File

@@ -301,7 +301,7 @@ impl Default for TextFormat {
italics: false,
underline: Stroke::NONE,
strikethrough: Stroke::NONE,
valign: Align::Center,
valign: Align::BOTTOM,
}
}
}