Fix text wrapping issue
This commit is contained in:
parent
1e73c01845
commit
62c4cc8f26
1 changed files with 6 additions and 0 deletions
|
|
@ -111,6 +111,12 @@ impl<C: HasFontStuff> Widget<C> for Text {
|
|||
.max_by(|a, b| a.partial_cmp(b).unwrap())
|
||||
.unwrap_or(0.0);
|
||||
|
||||
// If we don't round up here, the layout rounding may round down our
|
||||
// size slightly. This may lead to more line breaks, moving some words
|
||||
// below our visible area.
|
||||
let width = width.ceil();
|
||||
let height = height.ceil();
|
||||
|
||||
Size { width, height }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue