Skip to content

Commit

Permalink
Menus, Popups: fixed menus and popups with child window flag erroneou…
Browse files Browse the repository at this point in the history
…sly not displaying a scrollbar when contents is over parent viewport size. (#7287, #7063)

Amend f37f6f6
  • Loading branch information
ocornut committed Feb 12, 2024
1 parent 2af01ba commit 3af739a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ HOW TO UPDATE?

Other changes:

- Menus, Popups: fixed menus and popups with child window flag erroneously not displaying
a scrollbar when contents is over parent viewport size. (#7287, #7063) [@ZingBallyhoo]
- Backends: SDLRenderer3: query newly added SDL_RenderViewportSet() to not restore
a wrong viewport if none was initially set.

Expand Down
2 changes: 1 addition & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5755,7 +5755,7 @@ static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_cont
{
// Maximum window size is determined by the viewport size or monitor size
ImVec2 size_min = CalcWindowMinSize(window);
ImVec2 size_max = (window->Flags & ImGuiWindowFlags_ChildWindow) ? ImVec2(FLT_MAX, FLT_MAX) : ImGui::GetMainViewport()->WorkSize - style.DisplaySafeAreaPadding * 2.0f;
ImVec2 size_max = ((window->Flags & ImGuiWindowFlags_ChildWindow) && !(window->Flags & ImGuiWindowFlags_Popup)) ? ImVec2(FLT_MAX, FLT_MAX) : ImGui::GetMainViewport()->WorkSize - style.DisplaySafeAreaPadding * 2.0f;
ImVec2 size_auto_fit = ImClamp(size_desired, size_min, size_max);

// When the window cannot fit all contents (either because of constraints, either because screen is too small),
Expand Down

0 comments on commit 3af739a

Please sign in to comment.