graphics: Better texels adjusting for small textures (#317)

This commit is contained in:
Hajime Hoshi 2017-02-06 10:35:42 +09:00
parent bb993a481b
commit 06394680c1
2 changed files with 4 additions and 4 deletions

View File

@ -57,8 +57,8 @@ func vertices(parts ImageParts, width, height int, geo *affine.GeoM) []float32 {
}
u0, v0, u1, v1 := float64(sx0)/wf, float64(sy0)/hf, float64(sx1)/wf, float64(sy1)/hf
// Adjust texels to fix a problem that outside texels are used (#317).
u1 -= 1.0 / 16384.0
v1 -= 1.0 / 16384.0
u1 -= 1.0 / wf / 256.0
v1 -= 1.0 / hf / 256.0
vs.SetIndex(n, dx0)
vs.SetIndex(n+1, dy0)
vs.SetIndex(n+2, u0)

View File

@ -56,8 +56,8 @@ func vertices(parts ImageParts, width, height int, geo *affine.GeoM) []float32 {
}
u0, v0, u1, v1 := float32(sx0)/wf, float32(sy0)/hf, float32(sx1)/wf, float32(sy1)/hf
// Adjust texels to fix a problem that outside texels are used (#317).
u1 -= 1.0 / 16384.0
v1 -= 1.0 / 16384.0
u1 -= 1.0 / wf / 256.0
v1 -= 1.0 / hf / 256.0
vs[n] = x0
vs[n+1] = y0
vs[n+2] = u0