fix: error scale offset affter apply clip_to_hide

This commit is contained in:
DreamMaoMao 2025-05-26 12:50:39 +08:00
parent b56a99770f
commit 940ff0c1cc

View file

@ -1274,8 +1274,8 @@ void client_apply_clip(Client *c) {
scale_data.should_scale = true;
scale_data.width = clip_box.width - 2 * c->bw;
scale_data.height = clip_box.height - 2 * c->bw;
scale_data.width_scale = (float)scale_data.width / geometry.width;
scale_data.height_scale = (float)scale_data.height / geometry.height;
scale_data.width_scale = (float)scale_data.width / (geometry.width - offset.x);
scale_data.height_scale = (float)scale_data.height / (geometry.height - offset.y);
buffer_set_effect(c, scale_data);
}
@ -4917,6 +4917,16 @@ void scene_buffer_apply_effect(struct wlr_scene_buffer *buffer, int sx, int sy,
surface_height = scale_data->height;
}
if (surface_width > scale_data->width &&
wlr_subsurface_try_from_wlr_surface(surface) != NULL) {
return;
}
if (surface_height > scale_data->height &&
wlr_subsurface_try_from_wlr_surface(surface) != NULL) {
return;
}
if (surface_height > 0 && surface_width > 0) {
wlr_scene_buffer_set_dest_size(buffer, surface_width, surface_height);
}