Canvas: pass fill+stroke for drawing text

This commit is contained in:
Hannes Janetzek
2014-09-30 02:55:21 +02:00
parent a8641ce535
commit fa62602826
7 changed files with 54 additions and 59 deletions

View File

@@ -36,8 +36,9 @@ public interface Canvas {
* @param x
* @param y
* @param stroke the stroke
* @param
*/
void drawText(String string, float x, float y, Paint stroke);
void drawText(String string, float x, float y, Paint fill, Paint stroke);
/**
* Draw Bitmap to Canvas.

View File

@@ -127,13 +127,9 @@ public class TextBucket extends TextureBucket {
}
}
//yy = y + (height - 1) - it.text.fontDescent - mFontPadY;
yy = y + height - it.text.fontDescent; // - mFontPadY;
yy = y + height - it.text.fontDescent;
if (it.text.stroke != null)
mCanvas.drawText(it.string, x, yy, it.text.stroke);
mCanvas.drawText(it.string, x, yy, it.text.paint);
mCanvas.drawText(it.string, x, yy, it.text.paint, it.text.stroke);
// FIXME !!!
if (width > TEXTURE_WIDTH)