Removed unnecessary PushTextureId/PushClipRect/PopClipRect/PopTextureId on multiple Begin/End pairs

docking
ocornut 10 years ago
parent 8a6d543bc9
commit 7fbe6574c6

@ -3238,18 +3238,14 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
window->ClipRectStack.resize(0); window->ClipRectStack.resize(0);
window->LastFrameDrawn = current_frame; window->LastFrameDrawn = current_frame;
window->IDStack.resize(1); window->IDStack.resize(1);
}
window->BeginCount++;
// Setup texture, outer clipping rectangle // Setup texture, outer clipping rectangle
window->DrawList->PushTextureID(g.Font->ContainerAtlas->TexID); window->DrawList->PushTextureID(g.Font->ContainerAtlas->TexID);
if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_ComboBox)) if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_ComboBox))
PushClipRect(parent_window->ClipRectStack.back()); PushClipRect(parent_window->ClipRectStack.back());
else else
PushClipRect(GetVisibleRect()); PushClipRect(GetVisibleRect());
if (first_begin_of_the_frame)
{
// New windows appears in front // New windows appears in front
if (!window_was_visible) if (!window_was_visible)
{ {
@ -3601,6 +3597,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
ImGui::LogToClipboard(); ImGui::LogToClipboard();
*/ */
} }
window->BeginCount++;
// Inner clipping rectangle // Inner clipping rectangle
// We set this up after processing the resize grip so that our clip rectangle doesn't lag by a frame // We set this up after processing the resize grip so that our clip rectangle doesn't lag by a frame
@ -3645,8 +3642,6 @@ void ImGui::End()
ImGui::Columns(1, "#CloseColumns"); ImGui::Columns(1, "#CloseColumns");
PopClipRect(); // inner window clip rectangle PopClipRect(); // inner window clip rectangle
PopClipRect(); // outer window clip rectangle
window->DrawList->PopTextureID();
// Stop logging // Stop logging
if (!(window->Flags & ImGuiWindowFlags_ChildWindow)) // FIXME: add more options for scope of logging if (!(window->Flags & ImGuiWindowFlags_ChildWindow)) // FIXME: add more options for scope of logging

Loading…
Cancel
Save