Class: GD2::Canvas::Ellipse

Inherits:
Object
  • Object
show all
Defined in:
lib/gd2/canvas.rb

Direct Known Subclasses

FilledEllipse

Instance Method Summary collapse

Constructor Details

#initialize(center, width, height) ⇒ Ellipse

Returns a new instance of Ellipse.



166
167
168
# File 'lib/gd2/canvas.rb', line 166

def initialize(center, width, height)
  @center, @width, @height = center, width, height
end

Instance Method Details

#draw(image, mode) ⇒ Object



170
171
172
173
174
# File 'lib/gd2/canvas.rb', line 170

def draw(image, mode)
  SYM[:gdImageArc].call(image.image_ptr, @center.x, @center.y,
    @width, @height, 0, 360, mode)
  nil
end