This commit is contained in:
Will Charczuk 2016-07-29 18:40:43 -07:00
parent cbc0002d2a
commit a008ebe30e
5 changed files with 27 additions and 10 deletions

View file

@ -245,7 +245,7 @@ func (d draw) TextWithin(r Renderer, text string, box Box, style Style) {
lineBox := r.MeasureText(line)
switch style.GetTextHorizontalAlign() {
case TextHorizontalAlignCenter:
tx = box.Left + ((lineBox.Width() - box.Left) >> 1)
tx = box.Left + ((box.Width() - lineBox.Width()) >> 1)
case TextHorizontalAlignRight:
tx = box.Right - lineBox.Width()
default: