Skip to content

Commit

Permalink
texture off-by-one fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fogleman committed Apr 7, 2020
1 parent 265867c commit afb8cd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions texture.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ func (t *ImageTexture) BilinearSample(u, v float64) Color {
v = 1 - v
u -= math.Floor(u)
v -= math.Floor(v)
x := u * float64(t.Width)
y := v * float64(t.Height)
x := u * float64(t.Width-1)
y := v * float64(t.Height-1)
x0 := int(x)
y0 := int(y)
x1 := x0 + 1
Expand Down

0 comments on commit afb8cd7

Please sign in to comment.