mirror of
https://github.com/emilk/egui.git
synced 2026-06-27 15:13:12 -04:00
Fix valign/centering
This commit is contained in:
@@ -605,11 +605,12 @@ fn galley_from_rows(
|
||||
glyph.pos.y = cursor_y
|
||||
+ glyph.font_impl_ascent
|
||||
|
||||
+ format.valign.to_factor() * (row_height - glyph.font_impl_height)
|
||||
// Apply valign to the different in height of the entire row, and the height of this `Font`:
|
||||
+ format.valign.to_factor() * (row_height - glyph.size.y)
|
||||
|
||||
// When mixing different `FontImpl` (e.g. latin and emojis),
|
||||
// we always center the difference:
|
||||
+ 0.5 * (glyph.font_impl_height - glyph.size.y);
|
||||
+ 0.5 * (glyph.size.y - glyph.font_impl_height);
|
||||
|
||||
glyph.pos.y = point_scale.round_to_pixel(glyph.pos.y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user