Set a minimum height for Buffer of size * 1.2
This avoids text from misteriously disappearing, even if the user uses a `height` that isn't enough to fit the text.
This commit is contained in:
parent
15d257a52a
commit
dd80772da9
1 changed files with 4 additions and 1 deletions
|
|
@ -344,7 +344,10 @@ impl<'a> Cache<'a> {
|
|||
let metrics = glyphon::Metrics::new(key.size, key.size * 1.2);
|
||||
let mut buffer = glyphon::Buffer::new(fonts, metrics);
|
||||
|
||||
buffer.set_size(key.bounds.width, key.bounds.height);
|
||||
buffer.set_size(
|
||||
key.bounds.width,
|
||||
key.bounds.height.max(key.size * 1.2),
|
||||
);
|
||||
buffer.set_text(
|
||||
key.content,
|
||||
glyphon::Attrs::new().family(to_family(key.font)).color({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue