1
0
mirror of https://github.com/ocornut/imgui.git synced 2024-11-28 09:30:56 +01:00

Internals: Exposed internal SetWindowPos to imgui_internal.h (for imgui-test)

This commit is contained in:
omar 2019-02-03 17:29:51 +01:00
parent ac6d474103
commit c23a19c26f
2 changed files with 6 additions and 6 deletions

View File

@ -990,9 +990,6 @@ static const float WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER = 0.04f; // Reduc
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
static void SetCurrentWindow(ImGuiWindow* window); static void SetCurrentWindow(ImGuiWindow* window);
static void SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond);
static void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond);
static void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond);
static void FindHoveredWindow(); static void FindHoveredWindow();
static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFlags flags); static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFlags flags);
static void CheckStacksSize(ImGuiWindow* window, bool write); static void CheckStacksSize(ImGuiWindow* window, bool write);
@ -6035,7 +6032,7 @@ void ImGui::SetWindowScrollY(ImGuiWindow* window, float new_scroll_y)
window->DC.CursorMaxPos.y -= window->Scroll.y; window->DC.CursorMaxPos.y -= window->Scroll.y;
} }
static void SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond) void ImGui::SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond)
{ {
// Test condition (NB: bit 0 is always true) and clear flags for next time // Test condition (NB: bit 0 is always true) and clear flags for next time
if (cond && (window->SetWindowPosAllowFlags & cond) == 0) if (cond && (window->SetWindowPosAllowFlags & cond) == 0)
@ -6070,7 +6067,7 @@ ImVec2 ImGui::GetWindowSize()
return window->Size; return window->Size;
} }
static void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond) void ImGui::SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond)
{ {
// Test condition (NB: bit 0 is always true) and clear flags for next time // Test condition (NB: bit 0 is always true) and clear flags for next time
if (cond && (window->SetWindowSizeAllowFlags & cond) == 0) if (cond && (window->SetWindowSizeAllowFlags & cond) == 0)
@ -6113,7 +6110,7 @@ void ImGui::SetWindowSize(const char* name, const ImVec2& size, ImGuiCond cond)
SetWindowSize(window, size, cond); SetWindowSize(window, size, cond);
} }
static void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond) void ImGui::SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond)
{ {
// Test condition (NB: bit 0 is always true) and clear flags for next time // Test condition (NB: bit 0 is always true) and clear flags for next time
if (cond && (window->SetWindowCollapsedAllowFlags & cond) == 0) if (cond && (window->SetWindowCollapsedAllowFlags & cond) == 0)

View File

@ -1321,6 +1321,9 @@ namespace ImGui
IMGUI_API float GetWindowScrollMaxX(ImGuiWindow* window); IMGUI_API float GetWindowScrollMaxX(ImGuiWindow* window);
IMGUI_API float GetWindowScrollMaxY(ImGuiWindow* window); IMGUI_API float GetWindowScrollMaxY(ImGuiWindow* window);
IMGUI_API ImRect GetWindowAllowedExtentRect(ImGuiWindow* window); IMGUI_API ImRect GetWindowAllowedExtentRect(ImGuiWindow* window);
IMGUI_API void SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond);
IMGUI_API void SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond cond);
IMGUI_API void SetWindowCollapsed(ImGuiWindow* window, bool collapsed, ImGuiCond cond);
IMGUI_API void SetCurrentFont(ImFont* font); IMGUI_API void SetCurrentFont(ImFont* font);
inline ImFont* GetDefaultFont() { ImGuiContext& g = *GImGui; return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; } inline ImFont* GetDefaultFont() { ImGuiContext& g = *GImGui; return g.IO.FontDefault ? g.IO.FontDefault : g.IO.Fonts->Fonts[0]; }