(Graphics g, float w, float h)
| 427 | } |
| 428 | |
| 429 | private void drawText(Graphics g, float w, float h) { |
| 430 | float diff = h - renderedFont.getCapHeight(); |
| 431 | if (diff > 0 && Math.round(diff) % 2 == 1) { |
| 432 | h++; //if odd difference between height and font height, increment height so text favors displaying closer to bottom |
| 433 | } |
| 434 | if (!text.isEmpty()) { |
| 435 | g.drawText(text, renderedFont, getForeColor(), getLeftPadding(), 0, w - getLeftPadding() - getRightPadding(), h, false, alignment, true); |
| 436 | } |
| 437 | else if (!ghostText.isEmpty()) { |
| 438 | g.drawText(ghostText, renderedFont, getGhostTextColor(), getLeftPadding(), 0, w - getLeftPadding() - getRightPadding(), h, false, alignment, true); |
| 439 | } |
| 440 | } |
| 441 | |
| 442 | protected float getTextLeft() { |
| 443 | switch (alignment) { |
no test coverage detected