Class: Ucode::Glyphs::PathBbox::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/ucode/glyphs/path_bbox.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#max_xObject

Returns the value of attribute max_x

Returns:

  • (Object)

    the current value of max_x



21
22
23
# File 'lib/ucode/glyphs/path_bbox.rb', line 21

def max_x
  @max_x
end

#max_yObject

Returns the value of attribute max_y

Returns:

  • (Object)

    the current value of max_y



21
22
23
# File 'lib/ucode/glyphs/path_bbox.rb', line 21

def max_y
  @max_y
end

#min_xObject

Returns the value of attribute min_x

Returns:

  • (Object)

    the current value of min_x



21
22
23
# File 'lib/ucode/glyphs/path_bbox.rb', line 21

def min_x
  @min_x
end

#min_yObject

Returns the value of attribute min_y

Returns:

  • (Object)

    the current value of min_y



21
22
23
# File 'lib/ucode/glyphs/path_bbox.rb', line 21

def min_y
  @min_y
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/ucode/glyphs/path_bbox.rb', line 34

def empty?
  min_x.nil? || min_y.nil? || max_x.nil? || max_y.nil?
end

#heightObject



28
29
30
31
32
# File 'lib/ucode/glyphs/path_bbox.rb', line 28

def height
  return nil if empty?

  max_y - min_y
end

#widthObject



22
23
24
25
26
# File 'lib/ucode/glyphs/path_bbox.rb', line 22

def width
  return nil if empty?

  max_x - min_x
end