Merge branch 'wip/otte/for-master' into 'master'

gtk-demo: Don't use deprecated librsvg API

See merge request GNOME/gtk!4141
This commit is contained in:
Benjamin Otte 2021-11-09 19:49:37 +00:00
commit 96f7e59832
2 changed files with 9 additions and 7 deletions

View File

@ -140,7 +140,7 @@ if os_unix
demos += files('pagesetup.c')
endif
librsvg_dep = dependency('librsvg-2.0', version: '>= 2.46.0', required: false)
librsvg_dep = dependency('librsvg-2.0', version: '>= 2.52.0', required: false)
if librsvg_dep.found()
demos += files('paintable_svg.c')

View File

@ -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