Menu bar: better software clipping to handle small windows, in particular child window don't have the minimum constraint added in e9a7e73bba so we need to render clipped menus better.

This commit is contained in:
omar
2017-11-22 12:26:50 +01:00
parent 06a32a2b00
commit 7763ab3fcc
2 changed files with 15 additions and 9 deletions

View File

@ -746,6 +746,7 @@ public:
ImGuiID GetID(const void* ptr);
ImGuiID GetIDNoKeepAlive(const char* str, const char* str_end = NULL);
// We don't use g.FontSize because the window may be != g.CurrentWidow.
ImRect Rect() const { return ImRect(Pos.x, Pos.y, Pos.x+Size.x, Pos.y+Size.y); }
float CalcFontSize() const { return GImGui->FontBaseSize * FontWindowScale; }
float TitleBarHeight() const { return (Flags & ImGuiWindowFlags_NoTitleBar) ? 0.0f : CalcFontSize() + GImGui->Style.FramePadding.y * 2.0f; }