Skip to content

Commit

Permalink
BeginComboPreview: fix when part of preview rect is clipped by parent…
Browse files Browse the repository at this point in the history
… window. (#6501, #1658)
  • Loading branch information
ocornut committed Jun 9, 2023
1 parent 666b93e commit a134892
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1829,7 +1829,7 @@ bool ImGui::BeginComboPreview()
if (window->SkipItems || !(g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Visible))
return false;
IM_ASSERT(g.LastItemData.Rect.Min.x == preview_data->PreviewRect.Min.x && g.LastItemData.Rect.Min.y == preview_data->PreviewRect.Min.y); // Didn't call after BeginCombo/EndCombo block or forgot to pass ImGuiComboFlags_CustomPreview flag?
if (!window->ClipRect.Contains(preview_data->PreviewRect)) // Narrower test (optional)
if (!window->ClipRect.Overlaps(preview_data->PreviewRect)) // Narrower test (optional)
return false;

// FIXME: This could be contained in a PushWorkRect() api
Expand Down

0 comments on commit a134892

Please sign in to comment.