rasem
rasem copied to clipboard
Transform
can not use the transform "style" to do things like rotation and scaling. I forked and added code to "write_style(style)" It works with text but still need to test with other objects exp: File.open("test.svg", "w") do |f| Rasem::SVGImage.new(100, 100, f) do |f| text 50+(-10+(rand(20))), 50+(-10+(rand(20))), "O", :font_family=>"Akho Desire", "font-size"=>24 text 50+(-10+(rand(20))), 50+(-10+(rand(20))), "I", :font_family=>"Akho Will", "font-size"=>24 text 50+(-10+(rand(20))), 50+(-10+(rand(20))), "A", :font_family=>"Akho Believe", "font-size"=>24, :transform=>" matrix(0,1,-1,0,0,0)" end end
tested with other objects, and it was not working at all. updated the code to fix that bug in my code. transform now works with all objects, even groups. but everything, except text, losses the default_style, so you have to include stroke style: exp: File.open("test.svg", "w") do |f| Rasem::SVGImage.new(100, 100, f) do |f| group :stroke=>"black", :transform=>" matrix(0,1,-1,0,0,0)" do circle 20, 20, 5 circle 50, 50, 5 line 20, 20, 50, 50, :stroke=>"blue" end end end