Fixed minor text clipping issue in window title for when using font straying above usual line (#699)

This commit is contained in:
ocornut 2016-06-15 23:09:40 +02:00
parent c4db79f34b
commit 9cb271f4c8

View File

@ -4265,7 +4265,8 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us
if (style.WindowTitleAlign & ImGuiAlign_Center) pad_right = pad_left;
if (pad_left) text_min.x += g.FontSize + style.ItemInnerSpacing.x;
if (pad_right) text_max.x -= g.FontSize + style.ItemInnerSpacing.x;
RenderTextClipped(text_min, text_max, name, NULL, &text_size, style.WindowTitleAlign, NULL, &clip_max);
ImVec2 clip_min = ImVec2(text_min.x, window->Pos.y);
RenderTextClipped(text_min, text_max, name, NULL, &text_size, style.WindowTitleAlign, &clip_min, &clip_max);
}
// Save clipped aabb so we can access it in constant-time in FindHoveredWindow()