class GD2::Canvas::Wedge

Constants

ARC

Arc styles

CHORD
EDGED
NO_FILL
PIE

Public Class Methods

new(center, width, height, range, chord = false) click to toggle source
Calls superclass method GD2::Canvas::Arc::new
# File lib/gd2/canvas.rb, line 123
def initialize(center, width, height, range, chord = false)
  super(center, width, height, range)
  @chord = chord
end

Public Instance Methods

draw(image, mode) click to toggle source
# File lib/gd2/canvas.rb, line 128
def draw(image, mode)
  ::GD2::GD2FFI.send(:gdImageFilledArc, image.image_ptr, @center.x.to_i, @center.y.to_i,
    @width.to_i, @height.to_i,
    @range.begin.to_degrees.round.to_i, @range.end.to_degrees.round.to_i,
    mode.to_i, style.to_i)
  nil
end
style() click to toggle source
# File lib/gd2/canvas.rb, line 136
def style
  (@chord ? CHORD : ARC) | NO_FILL | EDGED
end