Minor internal shortcuts not calling GetCurrentWindow()

This commit is contained in:
ocornut 2015-08-30 10:49:47 +01:00
parent aa35547f94
commit 0aa353868f
2 changed files with 6 additions and 9 deletions

View File

@ -3910,7 +3910,6 @@ 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
@ -3926,6 +3925,7 @@ bool ImGui::Begin(const char* name, bool* p_opened, const ImVec2& size_on_first_
// Clear 'accessed' flag last thing // Clear 'accessed' flag last thing
if (first_begin_of_the_frame) if (first_begin_of_the_frame)
window->Accessed = false; window->Accessed = false;
window->BeginCount++;
// Child window can be out of sight and have "negative" clip windows. // Child window can be out of sight and have "negative" clip windows.
// Mark them as collapsed so commands are skipped earlier (we can't manually collapse because they have no title bar). // Mark them as collapsed so commands are skipped earlier (we can't manually collapse because they have no title bar).
@ -4450,8 +4450,7 @@ static void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiSetCond
void ImGui::SetWindowSize(const ImVec2& size, ImGuiSetCond cond) void ImGui::SetWindowSize(const ImVec2& size, ImGuiSetCond cond)
{ {
ImGuiWindow* window = GetCurrentWindow(); SetWindowSize(GImGui->CurrentWindow, size, cond);
SetWindowSize(window, size, cond);
} }
void ImGui::SetWindowSize(const char* name, const ImVec2& size, ImGuiSetCond cond) void ImGui::SetWindowSize(const char* name, const ImVec2& size, ImGuiSetCond cond)
@ -4474,8 +4473,7 @@ static void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiSetCond
void ImGui::SetWindowCollapsed(bool collapsed, ImGuiSetCond cond) void ImGui::SetWindowCollapsed(bool collapsed, ImGuiSetCond cond)
{ {
ImGuiWindow* window = GetCurrentWindow(); SetWindowCollapsed(GImGui->CurrentWindow, collapsed, cond);
SetWindowCollapsed(window, collapsed, cond);
} }
bool ImGui::IsWindowCollapsed() bool ImGui::IsWindowCollapsed()
@ -4492,8 +4490,7 @@ void ImGui::SetWindowCollapsed(const char* name, bool collapsed, ImGuiSetCond co
void ImGui::SetWindowFocus() void ImGui::SetWindowFocus()
{ {
ImGuiWindow* window = GetCurrentWindow(); FocusWindow(GImGui->CurrentWindow);
FocusWindow(window);
} }
void ImGui::SetWindowFocus(const char* name) void ImGui::SetWindowFocus(const char* name)

View File

@ -136,7 +136,7 @@ namespace ImGui
IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiSetCond cond = 0); // set next window position. call before Begin() IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiSetCond cond = 0); // set next window position. call before Begin()
IMGUI_API void SetNextWindowPosCenter(ImGuiSetCond cond = 0); // set next window position to be centered on screen. call before Begin() IMGUI_API void SetNextWindowPosCenter(ImGuiSetCond cond = 0); // set next window position to be centered on screen. call before Begin()
IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiSetCond cond = 0); // set next window size. set to ImVec2(0,0) to force an auto-fit. call before Begin() IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiSetCond cond = 0); // set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin()
IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiSetCond cond = 0); // set next window collapsed state. call before Begin() IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiSetCond cond = 0); // set next window collapsed state. call before Begin()
IMGUI_API void SetNextWindowFocus(); // set next window to be focused / front-most. call before Begin() IMGUI_API void SetNextWindowFocus(); // set next window to be focused / front-most. call before Begin()
IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiSetCond cond = 0); // set current window position - call within Begin()/End(). may incur tearing IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiSetCond cond = 0); // set current window position - call within Begin()/End(). may incur tearing
@ -144,7 +144,7 @@ namespace ImGui
IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiSetCond cond = 0); // set current window collapsed state IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiSetCond cond = 0); // set current window collapsed state
IMGUI_API void SetWindowFocus(); // set current window to be focused / front-most IMGUI_API void SetWindowFocus(); // set current window to be focused / front-most
IMGUI_API void SetWindowPos(const char* name, const ImVec2& pos, ImGuiSetCond cond = 0); // set named window position - call within Begin()/End(). may incur tearing IMGUI_API void SetWindowPos(const char* name, const ImVec2& pos, ImGuiSetCond cond = 0); // set named window position - call within Begin()/End(). may incur tearing
IMGUI_API void SetWindowSize(const char* name, const ImVec2& size, ImGuiSetCond cond = 0); // set named window size. set to ImVec2(0,0) to force an auto-fit. may incur tearing IMGUI_API void SetWindowSize(const char* name, const ImVec2& size, ImGuiSetCond cond = 0); // set named window size. set axis to 0.0f to force an auto-fit on this axis. may incur tearing
IMGUI_API void SetWindowCollapsed(const char* name, bool collapsed, ImGuiSetCond cond = 0); // set named window collapsed state IMGUI_API void SetWindowCollapsed(const char* name, bool collapsed, ImGuiSetCond cond = 0); // set named window collapsed state
IMGUI_API void SetWindowFocus(const char* name); // set named window to be focused / front-most. use NULL to remove focus. IMGUI_API void SetWindowFocus(const char* name); // set named window to be focused / front-most. use NULL to remove focus.