diff options
| author | 2023-09-04 23:47:44 -0400 | |
|---|---|---|
| committer | 2023-09-04 23:47:44 -0400 | |
| commit | bdf18554feadb631fdae5b427ac7a92a5546ade1 (patch) | |
| tree | facb92220b25ed1d8c2b92461d8243a9bccdaa55 /wgpu/src | |
| parent | 20681b4777a1954e6b7f659d5bc1817f7924f40d (diff) | |
| download | iced-bdf18554feadb631fdae5b427ac7a92a5546ade1.tar.gz iced-bdf18554feadb631fdae5b427ac7a92a5546ade1.tar.bz2 iced-bdf18554feadb631fdae5b427ac7a92a5546ade1.zip | |
Check LineHeight > 0.0 before allocating text
Diffstat (limited to '')
| -rw-r--r-- | wgpu/src/text.rs | 14 | 
1 files changed, 7 insertions, 7 deletions
| diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index 08a32b5e..9c42be0e 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -96,8 +96,7 @@ impl Pipeline {                              section                                  .line_height                                  .to_absolute(Pixels(section.size)), -                        ) -                        .max(f32::MIN_POSITIVE), +                        ),                          font: section.font,                          bounds: Size {                              width: section.bounds.width, @@ -239,8 +238,7 @@ impl Pipeline {      ) -> Size {          let mut cache = self.cache.borrow_mut(); -        let line_height = f32::from(line_height.to_absolute(Pixels(size))) -            .max(f32::MIN_POSITIVE); +        let line_height = f32::from(line_height.to_absolute(Pixels(size)));          let (_, entry) = cache.allocate(              &mut self.font_system.borrow_mut(), @@ -271,8 +269,7 @@ impl Pipeline {      ) -> Option<Hit> {          let mut cache = self.cache.borrow_mut(); -        let line_height = f32::from(line_height.to_absolute(Pixels(size))) -            .max(f32::MIN_POSITIVE); +        let line_height = f32::from(line_height.to_absolute(Pixels(size)));          let (_, entry) = cache.allocate(              &mut self.font_system.borrow_mut(), @@ -417,7 +414,10 @@ impl Cache {          }          if let hash_map::Entry::Vacant(entry) = self.entries.entry(hash) { -            let metrics = glyphon::Metrics::new(key.size, key.line_height); +            let metrics = glyphon::Metrics::new( +                key.size, +                key.line_height.max(f32::MIN_POSITIVE), +            );              let mut buffer = glyphon::Buffer::new(font_system, metrics);              buffer.set_size( | 
