mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-01-06 10:50:18 +01:00
Use the correct width/height when transforming surfaces with viewports.
Previously, because of the wrong width/height, weston_surface_to_buffer_* would return the wrong values when wl_viewport was used in combination with wl_surface.set_buffer_transform. Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com> Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
a212cbb0e6
commit
d0cebc36fb
1 changed files with 4 additions and 2 deletions
|
|
@ -675,7 +675,8 @@ weston_surface_to_buffer_float(struct weston_surface *surface,
|
|||
/* first transform coordinates if the scaler is set */
|
||||
scaler_surface_to_buffer(surface, sx, sy, bx, by);
|
||||
|
||||
weston_transformed_coord(surface->width, surface->height,
|
||||
weston_transformed_coord(surface->width_from_buffer,
|
||||
surface->height_from_buffer,
|
||||
vp->buffer.transform, vp->buffer.scale,
|
||||
*bx, *by, bx, by);
|
||||
}
|
||||
|
|
@ -709,7 +710,8 @@ weston_surface_to_buffer_rect(struct weston_surface *surface,
|
|||
rect.x2 = floorf(xf);
|
||||
rect.y2 = floorf(yf);
|
||||
|
||||
return weston_transformed_rect(surface->width, surface->height,
|
||||
return weston_transformed_rect(surface->width_from_buffer,
|
||||
surface->height_from_buffer,
|
||||
vp->buffer.transform, vp->buffer.scale,
|
||||
rect);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue