vulkan: Round damage rectangles properly

We need to round outwards and a 1x1 rectangle with offset 0.5,0.5 should
end up as a 3x3 rectangle with offset 0,0 when rounded, not as a 2x2
rectangle.
This commit is contained in:
Benjamin Otte 2024-08-13 00:33:55 +02:00
parent b1995d0d77
commit 4e77667ab8

View File

@ -714,8 +714,8 @@ gdk_vulkan_context_end_frame (GdkDrawContext *draw_context,
.layer = 0,
.offset.x = (int) floor (r.x * scale),
.offset.y = (int) floor (r.y * scale),
.extent.width = (int) ceil (r.width * scale),
.extent.height = (int) ceil (r.height * scale),
.extent.width = (int) ceil ((r.x + r.width) * scale) - floor (r.x * scale),
.extent.height = (int) ceil ((r.y + r.height) * scale) - floor (r.y * scale),
};
}
}