summaryrefslogtreecommitdiffstats
path: root/wgpu
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-05 18:31:53 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-02-24 13:36:03 +0100
commitdd80772da9ce89230d5a96c96923837f9887befa (patch)
tree9aee44fff5570ed70c95a034f0cebb0efa81e930 /wgpu
parent15d257a52a994f0110d775eb49ca7e6100b0e1a8 (diff)
downloadiced-dd80772da9ce89230d5a96c96923837f9887befa.tar.gz
iced-dd80772da9ce89230d5a96c96923837f9887befa.tar.bz2
iced-dd80772da9ce89230d5a96c96923837f9887befa.zip
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.
Diffstat (limited to 'wgpu')
-rw-r--r--wgpu/src/text.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs
index 16eea234..f1171b5f 100644
--- a/wgpu/src/text.rs
+++ b/wgpu/src/text.rs
@@ -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({