compositor: round off fractions

Round off fractions from non-transformed surface position coordinates.

Transformed surface moved by a client may have non-integer position
coordinates. That is required to prevent drifting on continuous
resizing.

We can round the position to integers when the surface is not (anymore)
transformed.

This change may fix a rounding inconsistency in the opaque region setup,
where the rectangle is initialised from the coordinates without explicit
rounding operation.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
dev
Pekka Paalanen 13 years ago
parent fc6d91a568
commit cc2f868b2e
  1. 4
      src/compositor.c

@ -312,6 +312,10 @@ weston_surface_update_transform_disable(struct weston_surface *surface)
{
surface->transform.enabled = 0;
/* round off fractions when not transformed */
surface->geometry.x = roundf(surface->geometry.x);
surface->geometry.y = roundf(surface->geometry.y);
pixman_region32_init_rect(&surface->transform.boundingbox,
surface->geometry.x,
surface->geometry.y,

Loading…
Cancel
Save