svg command can now specify an ID

This commit is contained in:
Andy Meneely
2014-07-23 09:35:10 -04:00
parent a59a3a5790
commit 9784d928d1
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -8,14 +8,14 @@ module Squib
cc.paint(alpha)
end
def svg(file, x, y, width, height)
def svg(file, id, x, y, width, height)
svg = RSVG::Handle.new_from_file(file)
width = svg.width if width == :native
height = svg.height if height == :native
tmp = Cairo::ImageSurface.new(width, height)
tmp_cc = Cairo::Context.new(tmp)
tmp_cc.scale(width.to_f / svg.width.to_f, height.to_f / svg.height.to_f)
tmp_cc.render_rsvg_handle(svg)
tmp_cc.render_rsvg_handle(svg, id)
cairo_context.set_source(tmp, x, y)
cairo_context.paint
end