Class: Sangaku::AABB

Inherits:
Object
  • Object
show all
Defined in:
lib/sangaku-eyeball/drawable.rb

Instance Method Summary collapse

Instance Method Details

#draw(window, color = 0x885555FF) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/sangaku-eyeball/drawable.rb', line 29

def draw(window, color = 0x885555FF)
  x1, y1 = min.to_a
  x2, y2 = max.to_a
  window.draw_line(x1, y1, color, x2, y1, color)
  window.draw_line(x2, y1, color, x2, y2, color)
  window.draw_line(x2, y2, color, x1, y2, color)
  window.draw_line(x1, y2, color, x1, y1, color)
end