Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
alexheretic committed Aug 14, 2022
1 parent 9378517 commit f397ef8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/title/ab_glyph_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@ impl AbGlyphTitleText {
let font = self.font.as_scaled(self.size);

let glyphs = self.layout();
if glyphs.is_empty() {
return None;
}

let last_glyph = glyphs.last().unwrap();
let last_glyph = glyphs.last()?;
let width = (last_glyph.position.x.ceil() + font.h_advance(last_glyph.id)).ceil() as u32;
let height = font.height().ceil() as u32;

Expand Down

0 comments on commit f397ef8

Please sign in to comment.