MCPcopy Create free account
hub / github.com/RenderKit/embree / EndComboPreview

Method EndComboPreview

tutorials/common/imgui/imgui_widgets.cpp:1772–1794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1770}
1771
1772void ImGui::EndComboPreview()
1773{
1774 ImGuiContext& g = *GImGui;
1775 ImGuiWindow* window = g.CurrentWindow;
1776 ImGuiComboPreviewData* preview_data = &g.ComboPreviewData;
1777
1778 // FIXME: Using CursorMaxPos approximation instead of correct AABB which we will store in ImDrawCmd in the future
1779 ImDrawList* draw_list = window->DrawList;
1780 if (window->DC.CursorMaxPos.x < preview_data->PreviewRect.Max.x && window->DC.CursorMaxPos.y < preview_data->PreviewRect.Max.y)
1781 if (draw_list->CmdBuffer.Size > 1) // Unlikely case that the PushClipRect() didn't create a command
1782 {
1783 draw_list->_CmdHeader.ClipRect = draw_list->CmdBuffer[draw_list->CmdBuffer.Size - 1].ClipRect = draw_list->CmdBuffer[draw_list->CmdBuffer.Size - 2].ClipRect;
1784 draw_list->_TryMergeDrawCmds();
1785 }
1786 PopClipRect();
1787 window->DC.CursorPos = preview_data->BackupCursorPos;
1788 window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, preview_data->BackupCursorMaxPos);
1789 window->DC.CursorPosPrevLine = preview_data->BackupCursorPosPrevLine;
1790 window->DC.PrevLineTextBaseOffset = preview_data->BackupPrevLineTextBaseOffset;
1791 window->DC.LayoutType = preview_data->BackupLayout;
1792 window->DC.IsSameLine = false;
1793 preview_data->PreviewRect = ImRect();
1794}
1795
1796// Getter for the old Combo() API: const char*[]
1797static bool Items_ArrayGetter(void* data, int idx, const char** out_text)

Callers

nothing calls this directly

Calls 3

ImMaxFunction · 0.85
_TryMergeDrawCmdsMethod · 0.80
ImRectFunction · 0.70

Tested by

no test coverage detected