mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-04-25 08:06:30 +00:00
[client] overlay/status: don't return damage rect if nothing was drawn
The renderer contains an optimization to skip ImGui if there is nothing to show, but the status overlay always returns a damage rect, even if it didn't draw anything, so the optimization can never take effect.
This commit is contained in:
parent
0fd6f59bbb
commit
7e9e38faa5
@ -89,6 +89,7 @@ static int status_render(void * udata, bool interactive, struct Rect * windowRec
|
||||
};
|
||||
|
||||
int xPos = screen->x - marginX;
|
||||
bool show = false;
|
||||
for(int i = 0; i < LG_USER_STATUS_MAX; ++i)
|
||||
{
|
||||
OverlayImage * img = &l_image[i];
|
||||
@ -99,6 +100,8 @@ static int status_render(void * udata, bool interactive, struct Rect * windowRec
|
||||
if (i == LG_USER_STATUS_RECORDING && !l_recordToggle)
|
||||
goto next;
|
||||
|
||||
show = true;
|
||||
|
||||
ImDrawList_AddImage(
|
||||
igGetBackgroundDrawList_Nil(),
|
||||
img->tex,
|
||||
@ -118,6 +121,9 @@ next:
|
||||
xPos -= ICON_SIZE + gapX;
|
||||
}
|
||||
|
||||
if (!show)
|
||||
return 0;
|
||||
|
||||
*windowRects = rect;
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user