oops: fix centered text drawing.

This commit is contained in:
Eric House 2012-07-11 06:17:36 -07:00
parent bad6c599f8
commit 11bd4a73fe

View file

@ -965,11 +965,11 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
drawScaled( text, rect, m_boundsScratch, descent ); drawScaled( text, rect, m_boundsScratch, descent );
} else { } else {
int bottom = rect.bottom - descent; int bottom = rect.bottom - descent;
int origin = rect.left + (extra / 5); int origin = rect.left;
if ( Paint.Align.CENTER == align ) { if ( Paint.Align.CENTER == align ) {
origin += rect.width() / 2; origin += rect.width() / 2;
} else { } else {
origin -= m_boundsScratch.left; origin += (extra / 5) - m_boundsScratch.left;
} }
m_fillPaint.setTextAlign( align ); m_fillPaint.setTextAlign( align );
m_canvas.drawText( text, origin, bottom, m_fillPaint ); m_canvas.drawText( text, origin, bottom, m_fillPaint );