mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-04 14:22:02 +00:00
[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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user