We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9696809 commit 442c737Copy full SHA for 442c737
lib/rabbit/renderer/scene.rb
@@ -443,6 +443,23 @@ def draw_arc_by_radius(filled,
443
end
444
445
446
+ def draw_rsvg_handle(handle, x, y, params={})
447
+ x, y = adjust_xy(x, y)
448
+ dim = handle.dimensions
449
+ w = dim.width
450
+ h = dim.height
451
+ width = (params[:width] || w).to_f
452
+ height = (params[:height] || h).to_f
453
+
454
+ snapshot = current_snapshot
455
+ snapshot.save do
456
+ # TODO: clip
457
+ snapshot.scale(width / w, height / h)
458
+ context = snapshot.append_cairo([x, y, w, h])
459
+ context.render_rsvg_handle(handle)
460
+ end
461
462
463
def draw_poppler_page(page, x, y, params={})
464
x, y = adjust_xy(x, y)
465
w, h = page.size
0 commit comments