mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-12-02 22:28:14 +00:00
[client] imgui: support high DPI by scaling framebuffer
This allows overlays to render at correct positions on high DPI displays.
This commit is contained in:
@@ -677,6 +677,14 @@ int app_renderOverlay(struct Rect * rects, int maxRects)
|
||||
const int written =
|
||||
overlay->ops->render(overlay->udata, false, buffer, MAX_OVERLAY_RECTS);
|
||||
|
||||
for (int i = 0; i < written; ++i)
|
||||
{
|
||||
buffer[i].x *= g_state.windowScale;
|
||||
buffer[i].y *= g_state.windowScale;
|
||||
buffer[i].w *= g_state.windowScale;
|
||||
buffer[i].h *= g_state.windowScale;
|
||||
}
|
||||
|
||||
// It is an error to run out of rectangles, because we will not be able to
|
||||
// correctly calculate the damage of the next frame.
|
||||
assert(written >= 0);
|
||||
|
||||
Reference in New Issue
Block a user