97 cairo_surface_t *surface;
102 surface = cairo_svg_surface_create(
NULL, us->
w, us->
h);
104 cairo_surface_reference(surface);
106 cairo_set_source_surface(cr, surface, 0, 0);
107 cairo_translate(cr, b.
LL.
x, -b.
UR.
y);
108 cairo_scale(cr, (b.
UR.
x - b.
LL.
x) / us->
w, (b.
UR.
y - b.
LL.
y) / us->
h);
109#if LIBRSVG_MAJOR_VERSION > 2 || (LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION >= 46)
110 const RsvgRectangle viewport = {.width = b.
UR.
x - b.
LL.
x,
111 .height = b.
UR.
y - b.
LL.
y};
112 rsvg_handle_render_document(rsvgh, cr, &viewport,
NULL);
114 rsvg_handle_render_cairo(rsvgh, cr);