1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 12:50:04 -04:00

[style] Tweak vertical text alignment

This commit is contained in:
Emil Ernerfeldt
2021-01-12 21:01:03 +01:00
parent 6d8a766614
commit b10dcf5012
2 changed files with 5 additions and 4 deletions

View File

@@ -322,13 +322,14 @@ impl FontImplCache {
}
let y_offset = if font_name == "emoji-icon-font" {
1.0 // TODO: remove font alignment hack
scale_in_points * 0.235 // TODO: remove font alignment hack
} else {
-3.0 // TODO: remove font alignment hack
0.0
};
let y_offset = y_offset - 3.0; // Tweaked to make text look centered in buttons and text edit fields
let scale_in_points = if font_name == "emoji-icon-font" {
scale_in_points - 2.0 // TODO: remove HACK!
scale_in_points * 0.8 // TODO: remove HACK!
} else {
scale_in_points
};