Module: UnderOs::UI::Dimensions
- Included in:
- View
- Defined in:
- lib/under_os/ui/utils/dimensions.rb
Overview
This module handles generic ui dimensions and positions of views
Instance Method Summary collapse
- #position(position = nil) ⇒ Object
- #position=(position) ⇒ Object
- #size(size = nil) ⇒ Object
- #size=(size) ⇒ Object
Instance Method Details
#position(position = nil) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/under_os/ui/utils/dimensions.rb', line 21 def position(position=nil) if position self.position = position self else @position ||= UnderOs::UI::Position.new(self) end end |
#position=(position) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/under_os/ui/utils/dimensions.rb', line 30 def position=(position) position = UnderOs::Point.new(position) # cleaning up self.position.x = position.x if position.x self.position.y = position.y if position.y end |