poly.addElement(new TinyPoint(daAnchorX + wH - triangleXBottom, daAnchorY + hH + triangleYBottom));
t2d.drawPolygon(poly);
}
void drawLabel(final Tile tile, boolean black, String label) {
Tiny2D t2d = getT2D(tile);
setT2DPureMark(t2d, tile, black);
t2d.fillColor = t2d.strokeColor;
t2d.strokeColor = TinyColor.NONE;
int wH = daWidth(tile) >> 1;
int hH = daHeight(tile) >> 1;
int stoneSize = daWidth(tile);
int fontSize = stoneSize;
TinyFont font = MyArial.getFont();
char[] text = label.toCharArray();
TinyRect cbox;
// calculate fontSize, so the number fits into stone
while (true) {
cbox = Tiny2D.charsBounds(font, fontSize, text, 0, text.length, Tiny2D.TEXT_DIR_LR);
// add one pixel from each side, so the number won't blent with stone border
if (cbox.xmax - cbox.xmin + ONE * 2 >= stoneSize)
fontSize -= HALF;
else
break;
}
t2d.drawChars(font, fontSize, text, 0, text.length,
daAnchorX + wH - (cbox.xmax - cbox.xmin) / 2,
// same baseline for any text
daAnchorY + hH + fontSize * (font.ascent + font.descent) / font.unitsPerEm / 2,
Tiny2D.TEXT_ANCHOR_START);
}