Class: RSVGR::Circle

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

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Circle

Returns a new instance of Circle.



69
70
71
72
73
74
# File 'lib/rsvgr.rb', line 69

def initialize *args
  @cx = 0.5
  @cy = 0.5
  @r = 0.5
  super
end

Instance Method Details

#to_sObject



75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/rsvgr.rb', line 75

def to_s
  "<circle"                                                   +
  " cx=\"#{DEFAULT_SIZE * @cx}\""                             +
  " cy=\"#{DEFAULT_SIZE * @cy}\""                             +
  " r=\"#{DEFAULT_SIZE * @r}\""                               +
  "#{" fill=\"#{@fill_color}\"" if @fill_color}"              +
  "#{" stroke=\"#{@stroke_color}\"" if @stroke_color}"        +
  "#{" stroke-width=\"#{@stroke_width}\"" if @stroke_width}"  +
  "#{" onmousemove=\"#{@onmousemove}\"" if @onmousemove}"     +
  "#{" onmouseout=\"#{@onmouseout}\"" if @onmouseout}"        +
  "/>\n"
end