diff options
author | Benjamin Otte <otte@redhat.com> | 2021-11-09 20:28:53 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2021-11-09 20:29:49 +0100 |
commit | 061026f21f61882441f28d6797565a181671e7a9 (patch) | |
tree | 878bf57b48a00aea23d4fc2d024db2f182272ec8 /demos/gtk-demo/svgpaintable.c | |
parent | 330e9a8424b1af387bb818251667ea41046d60eb (diff) | |
download | gtk+-061026f21f61882441f28d6797565a181671e7a9.tar.gz |
gtk-demo: Don't use deprecated librsvg API
New API requires a newer librsvg version, so require that one.
Diffstat (limited to 'demos/gtk-demo/svgpaintable.c')
-rw-r--r-- | demos/gtk-demo/svgpaintable.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/demos/gtk-demo/svgpaintable.c b/demos/gtk-demo/svgpaintable.c index 21879ed0d9..2779ac63e6 100644 --- a/demos/gtk-demo/svgpaintable.c +++ b/demos/gtk-demo/svgpaintable.c @@ -47,22 +47,24 @@ static int svg_paintable_get_intrinsic_width (GdkPaintable *paintable) { SvgPaintable *self = SVG_PAINTABLE (paintable); - RsvgDimensionData data; + double width; - rsvg_handle_get_dimensions (self->handle, &data); + if (!rsvg_handle_get_intrinsic_size_in_pixels (self->handle, &width, NULL)) + return 0; - return data.width; + return ceil (width); } static int svg_paintable_get_intrinsic_height (GdkPaintable *paintable) { SvgPaintable *self = SVG_PAINTABLE (paintable); - RsvgDimensionData data; + double height; - rsvg_handle_get_dimensions (self->handle, &data); + if (!rsvg_handle_get_intrinsic_size_in_pixels (self->handle, NULL, &height)) + return 0; - return data.height; + return ceil (height); } static void |