@Override public void drawBackground(Graphics g) { renderer.drawText( g, text, font, FORE_COLOR, insets.x - getScrollLeft(), insets.y - getScrollTop(), getScrollWidth() - 2 * insets.x, getScrollHeight() - 2 * insets.y, 0, getHeight(), true, alignment, false); }
public float getPreferredHeight(float width) { return renderer.getWrappedBounds(text, font, width - 2 * insets.x).height + font.getLineHeight() - font.getCapHeight() // need to account for difference in line and cap height + 2 * insets.y; }