Method: GuiGeo::Rectangle#intersection

Defined in:
lib/gui_geometry/rectangle.rb

#intersection(b) ⇒ Object Also known as: |



107
108
109
110
111
112
113
# File 'lib/gui_geometry/rectangle.rb', line 107

def intersection(b)
  return self unless b
  l = loc.max(b.loc)
  s = br.min(b.br) - l
  return rect unless s>point
  rect l, s
end