class HexaPDF::Layout::Frame::FitResult

Parent

Stores the result of fitting a box in a Frame.

Attributes

available_height[RW]

The available height in the frame for this particular box.

available_width[RW]

The available width in the frame for this particular box.

box[RW]

The box that was fitted into the frame.

frame[RW]

The frame into which the box was fitted.

mask[RW]

The rectangle (a Geom2D::Rectangle object) that will be removed from the frame when drawing the box.

x[RW]

The horizontal position where the box will be drawn.

y[RW]

The vertical position where the box will be drawn.

Public Class Methods

new(frame, box)

Initialize the result object for the given frame and box.

Public Instance Methods

draw(canvas, dx: 0, dy: 0)

Draws the box onto the canvas at (x + dx, y + dy).

The relative offset (dx, dy) is useful when rendering results that were accumulated and then need to be moved because the container holding them changes its position.

The configuration option “debug” can be used to add visual debug output with respect to box placement.

success!()

Marks the fitting status as success.

success?()

Returns true if fitting was successful.