From a3b4d2dfc9e0a53cdd3850bc5ae3528564cd10a8 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 18 Sep 2023 20:40:45 +0200 Subject: [PATCH] clutter/paint-volume: Avoid amplifying small floating-point errors In order to avoid adding whole pixels to paint boxes in case of small floating point errors. Part-of: --- clutter/clutter/clutter-paint-volume.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clutter/clutter/clutter-paint-volume.c b/clutter/clutter/clutter-paint-volume.c index cf725573a..a667ffd2d 100644 --- a/clutter/clutter/clutter-paint-volume.c +++ b/clutter/clutter/clutter-paint-volume.c @@ -1069,6 +1069,10 @@ _clutter_paint_volume_get_stage_paint_box (const ClutterPaintVolume *pv, * in this case. */ clutter_paint_volume_free (&projected_pv); + clutter_round_to_256ths (&box->x1); + clutter_round_to_256ths (&box->y1); + clutter_round_to_256ths (&box->x2); + clutter_round_to_256ths (&box->y2); box->x1 = floorf (box->x1); box->y1 = floorf (box->y1); box->x2 = ceilf (box->x2);