text/v2: bug fix: fix a semantically wrong calculation

Updates #2454
This commit is contained in:
Hajime Hoshi 2023-11-12 21:04:29 +09:00
parent 3f180b2165
commit 7c40b5f922

View File

@ -85,7 +85,7 @@ func float64ToFixed26_6(x float64) fixed.Int26_6 {
const glyphVariationCount = 4
func adjustOffsetGranularity(x fixed.Int26_6) fixed.Int26_6 {
return x / (1 << glyphVariationCount) * (1 << glyphVariationCount)
return x / ((1 << 6) / glyphVariationCount) * ((1 << 6) / glyphVariationCount)
}
// Glyph represents one glyph to render.