Class: RustPdf::PdfRect

Inherits:
Struct
  • Object
show all
Defined in:
lib/rustpdf.rb

Overview

A rectangle in PDF user space (points, origin lower-left). Used for a page's MediaBox/CropBox. #width / #height are the (non-negative) extents.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#x0Object

Returns the value of attribute x0

Returns:

  • (Object)

    the current value of x0



204
205
206
# File 'lib/rustpdf.rb', line 204

def x0
  @x0
end

#x1Object

Returns the value of attribute x1

Returns:

  • (Object)

    the current value of x1



204
205
206
# File 'lib/rustpdf.rb', line 204

def x1
  @x1
end

#y0Object

Returns the value of attribute y0

Returns:

  • (Object)

    the current value of y0



204
205
206
# File 'lib/rustpdf.rb', line 204

def y0
  @y0
end

#y1Object

Returns the value of attribute y1

Returns:

  • (Object)

    the current value of y1



204
205
206
# File 'lib/rustpdf.rb', line 204

def y1
  @y1
end

Instance Method Details

#heightObject



209
210
211
# File 'lib/rustpdf.rb', line 209

def height
  (y1 - y0).abs
end

#widthObject



205
206
207
# File 'lib/rustpdf.rb', line 205

def width
  (x1 - x0).abs
end