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: PDF2.0 s7.9.5

Public Instance Methods

bottom()

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

bottom=(y)

Sets the y-coordinate of the bottom-left corner to the given value.

height()

Returns the height of the rectangle.

height=(val)

Sets the height of the rectangle to the given value.

left()

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

left=(x)

Sets the x-coordinate of the bottom-left corner to the given value.

right()

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

right=(x)

Sets the x-coordinate of the top-right corner to the given value.

top()

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

top=(y)

Sets the y-coordinate of the top-right corner to the given value.

width()

Returns the width of the rectangle.

width=(val)

Sets the width of the rectangle to the given value.