[client] round overlay damage outward

Expand ImGui window damage to include its border and round both logical
window bounds and framebuffer-scaled bounds outward.

This prevents a one-pixel strip of stale desktop content when an
overlay window is resized at fractional positions or display scales.
This commit is contained in:
Geoffrey McRae
2026-08-03 23:34:04 +10:00
parent fbe08d00ce
commit cb5b9ab292
4 changed files with 31 additions and 12 deletions

View File

@@ -22,6 +22,7 @@
#include "common/util.h"
#include "common/cpuinfo.h"
#include <math.h>
#include <stdlib.h>
#include <immintrin.h>
@@ -38,6 +39,19 @@ struct Edge
int delta;
};
void rectScaleOutward(struct Rect * rect, double scale)
{
const int left = (int)floor(rect->x * scale);
const int top = (int)floor(rect->y * scale);
const int right = (int)ceil(((double)rect->x + rect->w) * scale);
const int bottom = (int)ceil(((double)rect->y + rect->h) * scale);
rect->x = left;
rect->y = top;
rect->w = right - left;
rect->h = bottom - top;
}
inline static bool rectIntersects(const FrameDamageRect * r1,
const FrameDamageRect * r2)
{