G
grr ruby svg freek
So I found an excellent SVG class made by Yuya at
http://raa.ruby-lang.org/project/ruby-svg - Thank you Yuya!
Its very nice piece of work, but I have one problem with Style attributes
that contain the "-" character (minus), such as ":stroke-width" or
"fill-opacity". Attributes without "-" function ok (such as ":fill" or
":stroke"".
Could this be caused by my editors character set?
**Details:
**Error message:
MFriend-rubysvg-tst-v0.1.rb:41: undefined local variable or method `width' for #<SVG::Ellipse:0xb7cd5034> (NameError)
from ./svg/element.rb:23:in `initialize'
from ./svg/element.rb:176:in `initialize'
from MFriend-rubysvg-tst-v0.1.rb:37
from MFriend-rubysvg-tst-v0.1.rb:27
**Line 41 reads as:
self.style = SVG::Style.newstroke-width => wid)
If I read the Style.rb source code (thats a module loaded by element.rb),
I can clearly see the following definition for the stroke-width attribute:
**quote
Attributes = [
....
'stroke-opacity', #
'stroke-width', #
'fill', #
....
etc. etc.
What to do?!? Fill-attribute works fine...
Please help! Thank you.
Gir (please reply to newsgroup)
http://raa.ruby-lang.org/project/ruby-svg - Thank you Yuya!
Its very nice piece of work, but I have one problem with Style attributes
that contain the "-" character (minus), such as ":stroke-width" or
"fill-opacity". Attributes without "-" function ok (such as ":fill" or
":stroke"".
Could this be caused by my editors character set?
**Details:
**Error message:
MFriend-rubysvg-tst-v0.1.rb:41: undefined local variable or method `width' for #<SVG::Ellipse:0xb7cd5034> (NameError)
from ./svg/element.rb:23:in `initialize'
from ./svg/element.rb:176:in `initialize'
from MFriend-rubysvg-tst-v0.1.rb:37
from MFriend-rubysvg-tst-v0.1.rb:27
**Line 41 reads as:
self.style = SVG::Style.newstroke-width => wid)
If I read the Style.rb source code (thats a module loaded by element.rb),
I can clearly see the following definition for the stroke-width attribute:
**quote
Attributes = [
....
'stroke-opacity', #
'stroke-width', #
'fill', #
....
etc. etc.
What to do?!? Fill-attribute works fine...
Please help! Thank you.
Gir (please reply to newsgroup)