/** * Creates a text block with the supplied {@code lines}. */ public TextBlock (TextLayout[] lines) { this.lines = lines; this.bounds = getBounds(lines, new Rectangle()); }
/** * Creates a text block with the supplied {@code lines}. */ public TextBlock (TextLayout[] lines) { this.lines = lines; this.bounds = getBounds(lines, new Rectangle()); }
public Block (Graphics gfx, String text, TextStyle style, TextWrap wrap, TextBlock.Align align) { super(gfx, text, style); assert wrap != null && align != null; this.wrap = wrap; this.align = align; _layouts = gfx.layoutText(text, style, wrap); _bounds = TextBlock.getBounds(_layouts, new Rectangle()); _bounds.width = style.effect.adjustWidth(_bounds.width); _bounds.height = style.effect.adjustHeight(_bounds.height); }