rsvg246: Fix build against librsvg 2.48

The version of librsvg is used on Ubuntu 20.04TLS.
This commit is contained in:
Michael Drake 2022-12-13 12:45:52 +00:00 committed by Michael Drake
parent 68a4cd39cd
commit f30f869ea4

View File

@ -147,6 +147,7 @@ rsvg_cache_convert(struct content *c)
static void rsvg__get_demensions(const rsvg_content *svgc, static void rsvg__get_demensions(const rsvg_content *svgc,
int *width, int *height) int *width, int *height)
{ {
#if LIBRSVG_MAJOR_VERSION >= 2 && LIBRSVG_MINOR_VERSION >= 52
gdouble rwidth; gdouble rwidth;
gdouble rheight; gdouble rheight;
gboolean gotsize; gboolean gotsize;
@ -168,7 +169,13 @@ static void rsvg__get_demensions(const rsvg_content *svgc,
*width = ink_rect.width; *width = ink_rect.width;
*height = ink_rect.height; *height = ink_rect.height;
} }
#else
RsvgDimensionData rsvgsize;
rsvg_handle_get_dimensions(svgc->rsvgh, &rsvgsize);
*width = rsvgsize.width;
*height = rsvgsize.height;
#endif
NSLOG(netsurf, DEBUG, "rsvg width:%d height:%d.", *width, *height); NSLOG(netsurf, DEBUG, "rsvg width:%d height:%d.", *width, *height);
} }