Sha256: 5fc7dbdb632262bd7ae3871e9169c734380e5e6fb30b3f479c810da7449072b4

Contents?: true

Size: 736 Bytes

Versions: 6

Compression:

Stored size: 736 Bytes

Contents

#
# This module handles generic ui dimensions and positions of views
#
module UnderOs::UI::Dimensions
  def size(size=nil)
    if size
      self.size = size
      self
    else
      @size ||= UnderOs::UI::Size.new(self)
    end
  end

  def size=(size)
    size = UnderOs::Point.new(size) # cleaning up

    self.size.x = size.x if size.x
    self.size.y = size.y if size.y
  end

  def position(position=nil)
    if position
      self.position = position
      self
    else
      @position ||= UnderOs::UI::Position.new(self)
    end
  end

  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

end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
under-os-ui-1.4.0 lib/under_os/ui/utils/dimensions.rb
under-os-1.3.0 lib/under_os/ui/utils/dimensions.rb
under-os-1.2.1 lib/under_os/ui/utils/dimensions.rb
under-os-1.2.0 lib/under_os/ui/utils/dimensions.rb
under-os-1.1.0 lib/under_os/ui/utils/dimensions.rb
under-os-1.0.0 lib/under_os/ui/utils/dimensions.rb