Skip to content

Commit

Permalink
shiny/text: drop panic when GlyphAdvance returns !ok
Browse files Browse the repository at this point in the history
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 <dmitshur@golang.org>
Reviewed-by: Nigel Tao (INACTIVE; USE @golang.org INSTEAD) <nigeltao@google.com>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
  • Loading branch information
dmitshur authored and gopherbot committed Dec 26, 2023
1 parent 8ecfa16 commit 02704c9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions shiny/text/caret.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,7 @@ func layout(f *Frame, l int32) {
if r == ' ' {
breakPoint = reader.bAndK()
}
a, ok := f.face.GlyphAdvance(r)
if !ok {
panic("TODO: is falling back on the U+FFFD glyph the responsibility of the caller or the Face?")
}
a, _ := f.face.GlyphAdvance(r)
advance += a
if r != ' ' && advance > f.maxWidth && breakPoint.b != 0 {
breakLine(f, l, breakPoint.b, breakPoint.k)
Expand Down

0 comments on commit 02704c9

Please sign in to comment.