text/v2: refactoring

This commit is contained in:
Hajime Hoshi 2023-11-17 00:12:17 +09:00
parent 9fa60e1656
commit e7fa9d50de

View File

@ -117,7 +117,8 @@ func glyphVariationCount(face Face) int {
func adjustGranularity(x fixed.Int26_6, face Face) fixed.Int26_6 { func adjustGranularity(x fixed.Int26_6, face Face) fixed.Int26_6 {
c := glyphVariationCount(face) c := glyphVariationCount(face)
return x / ((1 << 6) / fixed.Int26_6(c)) * ((1 << 6) / fixed.Int26_6(c)) factor := (1 << 6) / fixed.Int26_6(c)
return x / factor * factor
} }
// Glyph represents one glyph to render. // Glyph represents one glyph to render.