Allow for undefined buffer width and/or height, fixes #70

This commit is contained in:
Jeremy Soller 2024-06-12 09:04:04 -06:00
parent cd1cd0a337
commit 93a7df859a
15 changed files with 99 additions and 72 deletions

View file

@ -852,7 +852,7 @@ impl ShapeLine {
for span in spans.iter_mut() {
for word in span.words.iter_mut() {
for glyph in word.glyphs.iter_mut() {
if &line[glyph.start..glyph.end] == "\t" {
if line.get(glyph.start..glyph.end) == Some("\t") {
//TODO: better fallback for width
let space_x_advance =
glyph.font_monospace_em_width.unwrap_or(glyph.x_advance);