mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 22:38:08 +00:00
fix(core): restore original Label bounds checking
so that if the text does not vertically fit into the provided bounds, it will only render part of itself (and an optional ellipse) and remain properly vertically centered
This commit is contained in:
parent
bd491bb2da
commit
a09c404359
@ -78,7 +78,11 @@ where
|
|||||||
type Msg = Never;
|
type Msg = Never;
|
||||||
|
|
||||||
fn place(&mut self, bounds: Rect) -> Rect {
|
fn place(&mut self, bounds: Rect) -> Rect {
|
||||||
let height = self.text_height(bounds.width());
|
let height = self
|
||||||
|
.layout
|
||||||
|
.with_bounds(bounds)
|
||||||
|
.fit_text(self.text.as_ref())
|
||||||
|
.height();
|
||||||
let diff = bounds.height() - height;
|
let diff = bounds.height() - height;
|
||||||
let insets = match self.vertical {
|
let insets = match self.vertical {
|
||||||
Alignment::Start => Insets::bottom(diff),
|
Alignment::Start => Insets::bottom(diff),
|
||||||
|
Loading…
Reference in New Issue
Block a user