forked from AuroraMiddleware/gtk
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:
commit
96f7e59832
@ -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')
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user