Skip to content

Commit

Permalink
Ensure LineHeight > 0.0 for the WGPU renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuamegnauth54 committed Sep 4, 2023
1 parent a56b25b commit ef429fb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions wgpu/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit ef429fb

Please sign in to comment.