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