[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

@@ -20,6 +20,7 @@
#include "overlay_utils.h"
#include <math.h>
#include <string.h>
#include "common/open.h"
@@ -41,13 +42,19 @@
void overlayGetImGuiRect(struct Rect * rect)
{
ImVec2 pos = igGetWindowPos();
ImVec2 size = igGetWindowSize();
const ImVec2 pos = igGetWindowPos();
const ImVec2 size = igGetWindowSize();
const float border = igGetStyle()->WindowBorderSize;
const float margin = border > 1.0f ? border : 1.0f;
const int left = (int)floorf(pos.x - margin);
const int top = (int)floorf(pos.y - margin);
const int right = (int)ceilf(pos.x + size.x + margin);
const int bottom = (int)ceilf(pos.y + size.y + margin);
rect->x = pos.x;
rect->y = pos.y;
rect->w = size.x;
rect->h = size.y;
rect->x = left;
rect->y = top;
rect->w = right - left;
rect->h = bottom - top;
}
ImVec2 * overlayGetScreenSize(void)