mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-19 22:18:13 +00:00
fix(core/rust/ui): fix text baseline calculation
[no changelog]
This commit is contained in:
parent
4199d4ad41
commit
3623f966dc
@ -162,7 +162,9 @@ impl TextLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn initial_cursor(&self) -> Point {
|
pub fn initial_cursor(&self) -> Point {
|
||||||
self.bounds.top_left() + Offset::y(self.style.text_font.text_height() + self.padding_top)
|
let font = &self.style.text_font;
|
||||||
|
self.bounds.top_left()
|
||||||
|
+ Offset::y(font.text_max_height() - font.text_baseline() + self.padding_top)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fit_text(&self, text: &str) -> LayoutFit {
|
pub fn fit_text(&self, text: &str) -> LayoutFit {
|
||||||
|
Loading…
Reference in New Issue
Block a user