diff options
author | Kenny Levinsen <kl@kl.wtf> | 2021-02-08 00:51:10 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-02-09 09:37:10 +0100 |
commit | cf1e3be22813d343ec177d48a926d7d9104230dd (patch) | |
tree | e2c47101f4db1aa439951dbefa10ea0dcb006881 /sway/tree/view.c | |
parent | 63420a2caa728dd52121fc4b9a3d6d7a4f2c3444 (diff) |
view: Save surface x and y on saved buffers
We need to use surface_x and surface_y when rendering and damaging saved
buffers as these compensate for views that have been centered due to
being smaller than their container.
Add them to the surface positions on the saved buffer so we have the
values from the time the buffer was saved.
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index c1ce4e6b..3b1e67ea 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -1350,8 +1350,8 @@ static void view_save_buffer_iterator(struct wlr_surface *surface, saved_buffer->buffer = surface->buffer; saved_buffer->width = surface->current.width; saved_buffer->height = surface->current.height; - saved_buffer->x = sx; - saved_buffer->y = sy; + saved_buffer->x = view->container->surface_x + sx; + saved_buffer->y = view->container->surface_y + sy; saved_buffer->transform = surface->current.transform; wlr_surface_get_buffer_source_box(surface, &saved_buffer->source_box); wl_list_insert(&view->saved_buffers, &saved_buffer->link); |