class Prawn::SVG::Elements::Circle

Constants

USE_NEW_CIRCLE_CALL

Public Instance Methods

apply() click to toggle source
# File lib/prawn/svg/elements/circle.rb, line 14
def apply
  if USE_NEW_CIRCLE_CALL
    add_call "circle", [@x, @y], @r
  else
    add_call "circle_at", [@x, @y], radius: @r
  end
end
bounding_box() click to toggle source
# File lib/prawn/svg/elements/circle.rb, line 22
def bounding_box
  [@x - @r, @y + @r, @x + @r, @y - @r]
end
parse() click to toggle source
# File lib/prawn/svg/elements/circle.rb, line 4
def parse
  require_attributes 'r'

  @x = x(attributes['cx'] || "0")
  @y = y(attributes['cy'] || "0")
  @r = pixels(attributes['r'])

  require_positive_value @r
end