class HexaPDF::Layout::Line::HeightCalculator

Parent

Helper class for calculating the needed vertical dimensions of a line.

Public Class Methods

new(items = [])

Creates a new calculator with the given initial items.

Public Instance Methods

<<(item)
Alias for: add
add(item)

Adds a new item to be considered when calculating the various dimensions.

Also aliased as: <<
reset()

Resets the calculation.

result()

Returns the result of the calculations, the array [y_min, y_max, text_y_min, text_y_max].

See Line for their meaning.

simulate_height(item)

Returns the height of the line as if item was part of it but doesn’t change the internal state.