aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-06-28 18:01:15 +0200
committerPřemysl Eric Janouch <p@janouch.name>2023-06-29 03:36:34 +0200
commitf05e66bfc1aadb56538e4404836d1a1ea5f6720c (patch)
treeea5461e067838904599519c2a7c96bfbb3109209
parent6ee5f69bfef44e38dd695ed8242c1f44c846700e (diff)
downloadfiv-f05e66bfc1aadb56538e4404836d1a1ea5f6720c.tar.gz
fiv-f05e66bfc1aadb56538e4404836d1a1ea5f6720c.tar.xz
fiv-f05e66bfc1aadb56538e4404836d1a1ea5f6720c.zip
Fix compatibility with newer resvg versions
-rw-r--r--fiv-io.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fiv-io.c b/fiv-io.c
index bf97457..3c31a79 100644
--- a/fiv-io.c
+++ b/fiv-io.c
@@ -2291,11 +2291,16 @@ load_resvg_render_internal(FivIoRenderClosureResvg *self,
}
uint32_t *pixels = (uint32_t *) image->data;
+#if RESVG_MAJOR_VERSION == 0 && RESVG_MINOR_VERSION < 33
resvg_fit_to fit_to = {
scale == 1 ? RESVG_FIT_TO_TYPE_ORIGINAL : RESVG_FIT_TO_TYPE_ZOOM,
scale};
resvg_render(self->tree, fit_to, resvg_transform_identity(),
image->width, image->height, (char *) pixels);
+#else
+ resvg_render(self->tree, (resvg_transform) {.a = scale, .d = scale},
+ image->width, image->height, (char *) pixels);
+#endif
for (int i = 0; i < w * h; i++) {
uint32_t rgba = g_ntohl(pixels[i]);