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