Skip to content

Commit 02704c9

Browse files
dmitshurgopherbot
authored andcommitted
shiny/text: drop panic when GlyphAdvance returns !ok
As the commit message of CL 474376 notes, the "TODO: is falling back on the U+FFFD glyph the responsibility of the Drawer or the Face?" was resolved. There's no need to panic anymore. Updates golang/go#58252. Change-Id: Ic4bcc3dfb8a463e7abcfccdbcf826644327f1aec Reviewed-on: https://go-review.googlesource.com/c/exp/+/552616 Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Nigel Tao (INACTIVE; USE @golang.org INSTEAD) <[email protected]> Reviewed-by: Nigel Tao <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 8ecfa16 commit 02704c9

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

shiny/text/caret.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -602,10 +602,7 @@ func layout(f *Frame, l int32) {
602602
if r == ' ' {
603603
breakPoint = reader.bAndK()
604604
}
605-
a, ok := f.face.GlyphAdvance(r)
606-
if !ok {
607-
panic("TODO: is falling back on the U+FFFD glyph the responsibility of the caller or the Face?")
608-
}
605+
a, _ := f.face.GlyphAdvance(r)
609606
advance += a
610607
if r != ' ' && advance > f.maxWidth && breakPoint.b != 0 {
611608
breakLine(f, l, breakPoint.b, breakPoint.k)

0 commit comments

Comments
 (0)