gstreamer: Use G_APPROX_VALUE to compare floats

Mainly to silence compiler warnings.
This commit is contained in:
Robert Mader 2024-03-03 14:32:33 +01:00
parent 4060c43ae7
commit 465446430e

View File

@ -265,10 +265,13 @@ gtk_gst_paintable_set_paintable (GtkGstPaintable *self,
return;
if (self->image == NULL ||
self->pixel_aspect_ratio * gdk_paintable_get_intrinsic_width (self->image) !=
pixel_aspect_ratio * gdk_paintable_get_intrinsic_width (paintable) ||
gdk_paintable_get_intrinsic_height (self->image) != gdk_paintable_get_intrinsic_height (paintable) ||
gdk_paintable_get_intrinsic_aspect_ratio (self->image) != gdk_paintable_get_intrinsic_aspect_ratio (paintable) ||
!G_APPROX_VALUE (self->pixel_aspect_ratio * gdk_paintable_get_intrinsic_width (self->image),
pixel_aspect_ratio * gdk_paintable_get_intrinsic_width (paintable),
FLT_EPSILON) ||
!G_APPROX_VALUE (gdk_paintable_get_intrinsic_aspect_ratio (self->image),
gdk_paintable_get_intrinsic_aspect_ratio (paintable),
FLT_EPSILON) ||
!graphene_rect_equal (viewport, &self->viewport))
size_changed = TRUE;
else