Skip to content

Commit

Permalink
font/plan9font: fix byteoffset for non-zero origin
Browse files Browse the repository at this point in the history
Updates golang/go#57258

Change-Id: I4c7305c8e61f2d2cc0227c0daf0b003bbc466497
Reviewed-on: https://go-review.googlesource.com/c/image/+/458035
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Nigel Tao (INACTIVE; USE @golang.org INSTEAD) <nigeltao@google.com>
  • Loading branch information
nigeltao committed Dec 16, 2022
1 parent 0888fdd commit c5235ae
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions font/plan9font/plan9font.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ type plan9Image struct {
}

func (m *plan9Image) byteoffset(x, y int) int {
x -= m.rect.Min.X
y -= m.rect.Min.Y
a := y * m.width
if m.depth < 8 {
// We need to always round down, but Go rounds toward zero.
Expand Down

0 comments on commit c5235ae

Please sign in to comment.