Merge branch 'rsvg-handle-render-document'
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Closes #32
authored by Daniel Eklöf · committed by Daniel Eklöf · parents 050bb60, 9d47d76 · Browse files · 2 files·+30 added−0 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+30 added−0 removed
- other:+30 added−0 removed
Provenance
- Commit
952b44a- Tree
37b0326- Author
Daniel Eklöf <daniel@ekloef.se>- Committer
Daniel Eklöf <daniel@ekloef.se>- Parent 1
050bb60- Parent 2
9d47d76
2 files changed+30 added−0 removed
modified:CHANGELOG.md+6 added
14 unmodified lines1516171819202122232425262728135 unmodified linesExpand all14 unmodified lines
## Unreleased### Added### Changed
* Use `rsvg_handle_render_document()` instead of `rsvg_handle_render_cairo()` on libsrvg >= 2.46, since the latter has been deprecated (https://codeberg.org/dnkl/fuzzel/issues/32).
### Deprecated### Removed### Fixed### Security135 unmodified linesExpand allmodified:render.c+24 added
334 unmodified lines335 336 cairo_rectangle(buf->cairo, img_x, img_y, height, width);337 cairo_clip(buf->cairo);338 339+#if LIBRSVG_CHECK_VERSION(2, 46, 0)340+ if (cairo_status(buf->cairo) == CAIRO_STATUS_SUCCESS) {341+ RsvgRectangle viewport = {342+ .x = img_x,343+ .y = img_y,344+ .width = width,345+ .height = height,346+ };347+ rsvg_handle_render_document(svg, buf->cairo, &viewport, NULL);348+ }349+#else350 /* Translate + scale. Note: order matters! */351 cairo_translate(buf->cairo, img_x, img_y);352 cairo_scale(buf->cairo, scale, scale);353 354 if (cairo_status(buf->cairo) == CAIRO_STATUS_SUCCESS)355 rsvg_handle_render_cairo(svg, buf->cairo);356+#endif357 cairo_restore(buf->cairo);358 }359 #endif /* FUZZEL_ENABLE_SVG */360 }105 unmodified lines466 467 cairo_rectangle(buf->cairo, img_x, img_y, img_width, img_height);468 cairo_clip(buf->cairo);469 470+#if LIBRSVG_CHECK_VERSION(2, 46, 0)471+ if (cairo_status(buf->cairo) == CAIRO_STATUS_SUCCESS) {472+ RsvgRectangle viewport = {473+ .x = cur_x,474+ .y = first_row + i * row_height + (row_height - height) / 2,475+ .width = img_width,476+ .height = img_height,477+ };478+ rsvg_handle_render_document(icon->svg, buf->cairo, &viewport, NULL);479+ }480+#else481 /* Translate + scale. Note: order matters! */482 cairo_translate(483 buf->cairo, cur_x,484 first_row + i * row_height + (row_height - height) / 2);485 cairo_scale(buf->cairo, scale, scale);486 487 if (cairo_status(buf->cairo) == CAIRO_STATUS_SUCCESS)488 rsvg_handle_render_cairo(icon->svg, buf->cairo);489+#endif490 cairo_restore(buf->cairo);491 #endif /* FUZZEL_ENABLE_SVG */492 break;493 }117 unmodified lines