class HexaPDF::Rectangle

Parent

Implementation of the PDF rectangle data structure.

Rectangles are used for describing page and bounding boxes. They are represented by arrays of four numbers specifying the (x,y) coordinates of any diagonally opposite corners.

This class simplifies the usage of rectangles by automatically normalizing the coordinates so that they are in the order:

[left, bottom, right, top]

where left is the bottom left x-coordinate, bottom is the bottom left y-coordinate, right is the top right x-coordinate and top is the top right y-coordinate.

See: PDF1.7 s7.9.5

Public Instance Methods

==(other)

Compares this rectangle to other like in Object#== but also allows comparison to simple arrays if the rectangle is a direct object.

Calls superclass method HexaPDF::Object#==
bottom()

Returns the y-coordinate of the bottom-left corner.

height()

Returns the height of the rectangle.

left()

Returns the x-coordinate of the bottom-left corner.

right()

Returns the x-coordinate of the top-right corner.

top()

Returns the y-coordinate of the top-right corner.

width()

Returns the width of the rectangle.