| 1770 | } |
| 1771 | |
| 1772 | void 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*[] |
| 1797 | static bool Items_ArrayGetter(void* data, int idx, const char** out_text) |
nothing calls this directly
no test coverage detected