Class: Archimate::Svg::Extents
- Inherits:
-
Struct
- Object
- Struct
- Archimate::Svg::Extents
- Defined in:
- lib/archimate/svg/extents.rb
Instance Attribute Summary collapse
-
#max_x ⇒ Object
Returns the value of attribute max_x.
-
#max_y ⇒ Object
Returns the value of attribute max_y.
-
#min_x ⇒ Object
Returns the value of attribute min_x.
-
#min_y ⇒ Object
Returns the value of attribute min_y.
Instance Method Summary collapse
Instance Attribute Details
#max_x ⇒ Object
Returns the value of attribute max_x
5 6 7 |
# File 'lib/archimate/svg/extents.rb', line 5 def max_x @max_x end |
#max_y ⇒ Object
Returns the value of attribute max_y
5 6 7 |
# File 'lib/archimate/svg/extents.rb', line 5 def max_y @max_y end |
#min_x ⇒ Object
Returns the value of attribute min_x
5 6 7 |
# File 'lib/archimate/svg/extents.rb', line 5 def min_x @min_x end |
#min_y ⇒ Object
Returns the value of attribute min_y
5 6 7 |
# File 'lib/archimate/svg/extents.rb', line 5 def min_y @min_y end |
Instance Method Details
#expand(byval) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/archimate/svg/extents.rb', line 6 def (byval) self.min_x ||= 0 self.max_x ||= 0 self.min_y ||= 0 self.max_y ||= 0 self.min_x -= byval self.max_x += byval self.min_y -= byval self.max_y += byval self end |
#height ⇒ Object
22 23 24 |
# File 'lib/archimate/svg/extents.rb', line 22 def height max_y - min_y end |
#width ⇒ Object
18 19 20 |
# File 'lib/archimate/svg/extents.rb', line 18 def width max_x - min_x end |