Skip to content

clutter/actor: Round picking rectangles to pixel boundaries

The complexity of transformation matrices was causing some precision loss to creep in, first noticed on i386. We found that an actor at x=106 was ending up with vertices of x=106.000007629.

This kind of error in nontrivial floating point calculations is expected but our picking code requires something more precise. So we now round vertex coordinates to the nearest physical pixel boundary. This is low enough to maintain fractional scaling precision and high enough to remove the floating point precision errors.

Fixes test failures (and probably other bugs):

Clutter-Conform:ERROR:../src/tests/clutter/conform/actor-layout.c:85:actor_margin_layout: assertion failed (actor Yellow Flower at 106.00,50.00): found actor Vase

This is an alternative to !779 (closed).

Edited by Daniel van Vugt

Merge request reports