Class: Gruff::Line::DotRenderers::Square

Inherits:
Object
  • Object
show all
Defined in:
lib/gruff/line.rb

Instance Method Summary collapse

Instance Method Details

#render(d, new_x, new_y, circle_radius) ⇒ Object



347
348
349
350
351
352
353
354
# File 'lib/gruff/line.rb', line 347

def render(d, new_x, new_y, circle_radius)
  offset = (circle_radius * 0.8).to_i
  corner_1 = new_x - offset
  corner_2 = new_y - offset
  corner_3 = new_x + offset
  corner_4 = new_y + offset
  d.rectangle(corner_1, corner_2, corner_3, corner_4)
end