class HexaPDF::Layout::InlineBox

Parent

An InlineBox wraps a regular Box so that it can be used as an item for a Line. This enables inline graphics.

The wrapped box must have a fixed size!

Attributes

box[R]

The wrapped Box object.

valign[R]

The vertical alignment of the box.

Can be any supported value except :text - see Line for all possible values.

Public Class Methods

create(valign: :baseline, **args, &block)

Creates an InlineBox that wraps a basic Box. All arguments (except valign) and the block are passed to Box.create.

See ::new for the valign argument.

new(box, valign: :baseline)

Creates a new InlineBox object wrapping box.

The valign argument can be used to specify the vertical alignment of the box relative to other items in the Line.

Public Instance Methods

draw(canvas, x, y)

Draws the wrapped box. If the box has margins specified, the x and y offsets are correctly adjusted.

empty?()

Returns true if this inline box is just a placeholder without drawing operations.

height()

Returns the height of the wrapped box plus its top and bottom margins.

width()

Returns the width of the wrapped box plus its left and right margins.

x_max()

The maximum x-coordinate which is equivalent to the width of the inline box.

x_min()

The minimum x-coordinate which is always 0.