@@ -2476,7 +2476,7 @@ bool ImGuiListClipper::Step()
2476
2476
IM_ASSERT(table->RowPosY1 == StartPosY && table->RowPosY2 == window->DC.CursorPos.y);
2477
2477
2478
2478
ItemsHeight = (window->DC.CursorPos.y - StartPosY) / (float)(DisplayEnd - DisplayStart);
2479
- float affected_by_floating_point_precision = ImIsFloatAboveGuaranteedIntegerPrecision(StartPosY) || ImIsFloatAboveGuaranteedIntegerPrecision(window->DC.CursorPos.y);
2479
+ bool affected_by_floating_point_precision = ImIsFloatAboveGuaranteedIntegerPrecision(StartPosY) || ImIsFloatAboveGuaranteedIntegerPrecision(window->DC.CursorPos.y);
2480
2480
if (affected_by_floating_point_precision)
2481
2481
ItemsHeight = window->DC.PrevLineSize.y + g.Style.ItemSpacing.y; // FIXME: Technically wouldn't allow multi-line entries.
2482
2482
@@ -4456,13 +4456,13 @@ static void ImGui::RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32
4456
4456
// Draw behind window by moving the draw command at the FRONT of the draw list
4457
4457
{
4458
4458
ImDrawList* draw_list = window->RootWindow->DrawList;
4459
- draw_list->AddDrawCmd();
4460
4459
draw_list->PushClipRect(viewport_rect.Min - ImVec2(1, 1), viewport_rect.Max + ImVec2(1, 1), false); // Ensure ImDrawCmd are not merged
4461
4460
draw_list->AddRectFilled(viewport_rect.Min, viewport_rect.Max, col);
4462
4461
ImDrawCmd cmd = draw_list->CmdBuffer.back();
4463
4462
IM_ASSERT(cmd.ElemCount == 6);
4464
4463
draw_list->CmdBuffer.pop_back();
4465
4464
draw_list->CmdBuffer.push_front(cmd);
4465
+ draw_list->PopClipRect();
4466
4466
}
4467
4467
}
4468
4468
@@ -4608,6 +4608,10 @@ void ImGui::Render()
4608
4608
AddDrawListToDrawData(&viewport->DrawDataBuilder.Layers[0], GetBackgroundDrawList(viewport));
4609
4609
}
4610
4610
4611
+ // Draw modal/window whitening backgrounds
4612
+ if (first_render_of_frame)
4613
+ RenderDimmedBackgrounds();
4614
+
4611
4615
// Add ImDrawList to render
4612
4616
ImGuiWindow* windows_to_render_top_most[2];
4613
4617
windows_to_render_top_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL;
@@ -4623,10 +4627,6 @@ void ImGui::Render()
4623
4627
if (windows_to_render_top_most[n] && IsWindowActiveAndVisible(windows_to_render_top_most[n])) // NavWindowingTarget is always temporarily displayed as the top-most window
4624
4628
AddRootWindowToDrawData(windows_to_render_top_most[n]);
4625
4629
4626
- // Draw modal/window whitening backgrounds
4627
- if (first_render_of_frame)
4628
- RenderDimmedBackgrounds();
4629
-
4630
4630
// Setup ImDrawData structures for end-user
4631
4631
g.IO.MetricsRenderVertices = g.IO.MetricsRenderIndices = 0;
4632
4632
for (int n = 0; n < g.Viewports.Size; n++)
0 commit comments