mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-26 09:58:20 +01:00
set default font height based on scale rather than assuming Paint's
defaults make sense.
This commit is contained in:
parent
bcac60b2d4
commit
0920eeb6b3
1 changed files with 4 additions and 1 deletions
|
@ -45,6 +45,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
|||
private static final int k_miniTextSize = 24;
|
||||
private static final int k_miniPaddingH = 2;
|
||||
private static final int k_miniPaddingV = 2;
|
||||
private static final float MIN_FONT_DIPS = 14.0f;
|
||||
|
||||
private Paint m_drawPaint;
|
||||
private Paint m_fillPaint;
|
||||
|
@ -173,9 +174,11 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
|||
|
||||
private void init( Context context )
|
||||
{
|
||||
final float scale = getResources().getDisplayMetrics().density;
|
||||
m_defaultFontHt = (int)(MIN_FONT_DIPS * scale + 0.5f);
|
||||
|
||||
m_drawPaint = new Paint();
|
||||
m_fillPaint = new Paint( Paint.ANTI_ALIAS_FLAG );
|
||||
m_defaultFontHt = (int)m_fillPaint.getTextSize();
|
||||
m_strokePaint = new Paint();
|
||||
m_strokePaint.setStyle( Paint.Style.STROKE );
|
||||
m_tileStrokePaint = new Paint();
|
||||
|
|
Loading…
Reference in a new issue