Module: WindowBlessing::Window::Geometry

Included in:
WindowBlessing::Window
Defined in:
lib/window_blessing/window.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#areaObject

Returns the value of attribute area.



104
105
106
# File 'lib/window_blessing/window.rb', line 104

def area
  @area
end

Instance Method Details

#internal_areaObject



124
# File 'lib/window_blessing/window.rb', line 124

def internal_area; rect @area.size end

#locObject



126
# File 'lib/window_blessing/window.rb', line 126

def loc; area.loc; end

#loc=(new_loc) ⇒ Object



127
# File 'lib/window_blessing/window.rb', line 127

def loc=(new_loc) self.area = rect new_loc, area.size end

#move_onscreenObject



134
135
136
137
138
# File 'lib/window_blessing/window.rb', line 134

def move_onscreen
  return unless parent
  parent_area = rect(point, parent.area.size)
  self.area = parent_area.bound(area)
end

#pointer_inside?(loc) ⇒ Boolean

Returns:

  • (Boolean)


132
# File 'lib/window_blessing/window.rb', line 132

def pointer_inside?(loc) area.contains? loc end

#sizeObject



129
# File 'lib/window_blessing/window.rb', line 129

def size; area.size; end

#size=(new_size) ⇒ Object



130
# File 'lib/window_blessing/window.rb', line 130

def size=(new_size) self.area = rect area.loc, new_size end