summaryrefslogtreecommitdiffstats
path: root/wgpu
diff options
context:
space:
mode:
authorLibravatar Josh Megnauth <jo.sh@tutanota.com>2023-09-04 02:58:54 -0400
committerLibravatar Josh Megnauth <jo.sh@tutanota.com>2023-09-04 02:58:54 -0400
commitef429fbea6e39efcfdc58fdd8a2fe365fd5314d9 (patch)
tree4184165d7753ffd130c68ed41c1f5d11f3b161e1 /wgpu
parenta56b25b9096d47ada3c4349f5b91110dfaa92bf6 (diff)
downloadiced-ef429fbea6e39efcfdc58fdd8a2fe365fd5314d9.tar.gz
iced-ef429fbea6e39efcfdc58fdd8a2fe365fd5314d9.tar.bz2
iced-ef429fbea6e39efcfdc58fdd8a2fe365fd5314d9.zip
Ensure LineHeight > 0.0 for the WGPU renderer
Diffstat (limited to 'wgpu')
-rw-r--r--wgpu/src/text.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs
index fb13545d..08a32b5e 100644
--- a/wgpu/src/text.rs
+++ b/wgpu/src/text.rs
@@ -96,7 +96,8 @@ impl Pipeline {
section
.line_height
.to_absolute(Pixels(section.size)),
- ),
+ )
+ .max(f32::MIN_POSITIVE),
font: section.font,
bounds: Size {
width: section.bounds.width,
@@ -238,7 +239,8 @@ impl Pipeline {
) -> Size {
let mut cache = self.cache.borrow_mut();
- let line_height = f32::from(line_height.to_absolute(Pixels(size)));
+ let line_height = f32::from(line_height.to_absolute(Pixels(size)))
+ .max(f32::MIN_POSITIVE);
let (_, entry) = cache.allocate(
&mut self.font_system.borrow_mut(),
@@ -269,7 +271,8 @@ impl Pipeline {
) -> Option<Hit> {
let mut cache = self.cache.borrow_mut();
- let line_height = f32::from(line_height.to_absolute(Pixels(size)));
+ let line_height = f32::from(line_height.to_absolute(Pixels(size)))
+ .max(f32::MIN_POSITIVE);
let (_, entry) = cache.allocate(
&mut self.font_system.borrow_mut(),