提交 71662538 编写于 作者: N Nigel Tao

Fix rounding up for 26.6 fixed point, not 24.8.

上级 071d96ed
......@@ -167,8 +167,8 @@ func (c *Context) rasterize(glyph truetype.Index, fx, fy fixed.Int26_6) (
// Calculate the integer-pixel bounds for the glyph.
xmin := int(fx+fixed.Int26_6(c.glyphBuf.B.XMin)) >> 6
ymin := int(fy-fixed.Int26_6(c.glyphBuf.B.YMax)) >> 6
xmax := int(fx+fixed.Int26_6(c.glyphBuf.B.XMax)+0xff) >> 6
ymax := int(fy-fixed.Int26_6(c.glyphBuf.B.YMin)+0xff) >> 6
xmax := int(fx+fixed.Int26_6(c.glyphBuf.B.XMax)+0x3f) >> 6
ymax := int(fy-fixed.Int26_6(c.glyphBuf.B.YMin)+0x3f) >> 6
if xmin > xmax || ymin > ymax {
return 0, nil, image.Point{}, errors.New("freetype: negative sized glyph")
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册