DrawString bug fix
This commit is contained in:
parent
928b874494
commit
4d5a250fb8
@ -585,9 +585,9 @@ func (dc *Context) DrawString(s string, x, y float64) {
|
|||||||
// text. Use ax=0.5, ay=0.5 to center the text at the specified point.
|
// text. Use ax=0.5, ay=0.5 to center the text at the specified point.
|
||||||
func (dc *Context) DrawStringAnchored(s string, x, y, ax, ay float64) {
|
func (dc *Context) DrawStringAnchored(s string, x, y, ax, ay float64) {
|
||||||
w, h := dc.MeasureString(s)
|
w, h := dc.MeasureString(s)
|
||||||
|
x, y = dc.TransformPoint(x, y)
|
||||||
x -= ax * w
|
x -= ax * w
|
||||||
y += ay * h
|
y += ay * h
|
||||||
x, y = dc.TransformPoint(x, y)
|
|
||||||
if dc.mask == nil {
|
if dc.mask == nil {
|
||||||
dc.drawString(dc.im, s, x, y)
|
dc.drawString(dc.im, s, x, y)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user