Move string anchor points to bottom left for consistency

This commit is contained in:
lordwelch 2018-05-17 12:39:42 -07:00
parent a9ff18eccd
commit eb53dad69b

View File

@ -698,7 +698,7 @@ func (dc *Context) DrawStringWrapped(s string, x, y, ax, ay, width, lineSpacing
h := float64(len(lines)) * dc.fontHeight * lineSpacing h := float64(len(lines)) * dc.fontHeight * lineSpacing
h -= (lineSpacing - 1) * dc.fontHeight h -= (lineSpacing - 1) * dc.fontHeight
x -= ax * width x -= ax * width
y -= ay * h y += ay * h
switch align { switch align {
case AlignLeft: case AlignLeft:
ax = 0 ax = 0
@ -709,7 +709,7 @@ func (dc *Context) DrawStringWrapped(s string, x, y, ax, ay, width, lineSpacing
ax = 1 ax = 1
x += width x += width
} }
ay = 1 ay = 0
for _, line := range lines { for _, line := range lines {
dc.DrawStringAnchored(line, x, y, ax, ay) dc.DrawStringAnchored(line, x, y, ax, ay)
y += dc.fontHeight * lineSpacing y += dc.fontHeight * lineSpacing