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:
Héctor Ramón Jiménez 2023-02-05 18:31:53 +01:00
parent 15d257a52a
commit dd80772da9
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -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({