508 | | g.setFont (text.font); |
509 | | g.drawString (name, |
510 | | (int)(centeredNBounds.getMinX() - nb.getMinX()), |
511 | | (int)(centeredNBounds.getMinY() - nb.getMinY())); |
| 508 | int x = (int)(centeredNBounds.getMinX() - nb.getMinX()); |
| 509 | int y = (int)(centeredNBounds.getMinY() - nb.getMinY()); |
| 510 | if (text.haloRadius != null) { |
| 511 | g.setStroke(new BasicStroke(2*text.haloRadius, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)); |
| 512 | g.setColor(text.haloColor); |
| 513 | FontRenderContext frc = g.getFontRenderContext(); |
| 514 | GlyphVector gv = text.font.createGlyphVector(frc, name); |
| 515 | Shape textOutline = gv.getOutline(x, y); |
| 516 | g.draw(textOutline); |
| 517 | g.setStroke(new BasicStroke()); |
| 518 | g.setColor(text.color); |
| 519 | g.fill(textOutline); |
| 520 | } else { |
| 521 | g.setFont (text.font); |
| 522 | g.drawString(name, x, y); |
| 523 | } |