From d43f10c5f2ab886d2d215b10efb050fda35a08d9 Mon Sep 17 00:00:00 2001 From: Shinichi TOYAMA Date: Sat, 8 Jul 2023 20:50:06 +0900 Subject: [PATCH] rsvg_handle_render_document() is not available before librsvg 2.46 https://gnome.pages.gitlab.gnome.org/librsvg/Rsvg-2.0/method.Handle.render_document.html --- src/tuxpaint.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 619eb80b2..b09de4cfa 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -20971,7 +20971,9 @@ static SDL_Surface *_load_svg(const char *file) int width, height, stride; float scale; int bpp = 32, btpp = 4; +#if !(LIBRSVG_MAJOR_VERSION < 2 || LIBRSVG_MINOR_VERSION < 46) RsvgRectangle viewport; +#endif SDL_Surface *sdl_surface, *sdl_surface_tmp; Uint32 rmask, gmask, bmask, amask; @@ -21075,6 +21077,9 @@ static SDL_Surface *_load_svg(const char *file) /* FIXME: We can use cairo_rotate() here to rotate stamps! -bjk 2007.06.21 */ +#if LIBRSVG_MAJOR_VERSION < 2 || LIBRSVG_MINOR_VERSION < 46 + rsvg_handle_render_cairo(rsvg_handle, cr); +#else viewport.x = 0; viewport.y = 0; viewport.width = width; @@ -21087,6 +21092,7 @@ static SDL_Surface *_load_svg(const char *file) &viewport, &gerr); /* FIXME: ignoring errors (gerr) for now -bjk 2023.06.18 */ +#endif cairo_surface_finish(cairo_surf);