Updated ImGui.
This commit is contained in:
parent
b781fe4dff
commit
2b6a63c54b
12
3rdparty/ocornut-imgui/imgui.cpp
vendored
12
3rdparty/ocornut-imgui/imgui.cpp
vendored
@ -670,7 +670,7 @@ static void SaveIniSettingsToDisk(const char* ini_filename);
|
||||
static void SaveIniSettingsToMemory(ImVector<char>& out_buf);
|
||||
static void MarkIniSettingsDirty(ImGuiWindow* window);
|
||||
|
||||
static ImRect GetVisibleRect();
|
||||
static ImRect GetViewportRect();
|
||||
|
||||
static void CloseInactivePopups(ImGuiWindow* ref_window);
|
||||
static void ClosePopupToLevel(int remaining);
|
||||
@ -3688,7 +3688,7 @@ ImVec2 ImGui::GetItemRectSize()
|
||||
return window->DC.LastItemRect.GetSize();
|
||||
}
|
||||
|
||||
static ImRect GetVisibleRect()
|
||||
static ImRect GetViewportRect()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
if (g.IO.DisplayVisibleMin.x != g.IO.DisplayVisibleMax.x && g.IO.DisplayVisibleMin.y != g.IO.DisplayVisibleMax.y)
|
||||
@ -4107,7 +4107,7 @@ static ImVec2 FindBestWindowPosForPopup(const ImVec2& ref_pos, const ImVec2& siz
|
||||
// r_avoid = the rectangle to avoid (e.g. for tooltip it is a rectangle around the mouse cursor which we want to avoid. for popups it's a small point around the cursor.)
|
||||
// r_outer = the visible area rectangle, minus safe area padding. If our popup size won't fit because of safe area padding we ignore it.
|
||||
ImVec2 safe_padding = style.DisplaySafeAreaPadding;
|
||||
ImRect r_outer(GetVisibleRect());
|
||||
ImRect r_outer(GetViewportRect());
|
||||
r_outer.Expand(ImVec2((size.x - r_outer.GetWidth() > safe_padding.x*2) ? -safe_padding.x : 0.0f, (size.y - r_outer.GetHeight() > safe_padding.y*2) ? -safe_padding.y : 0.0f));
|
||||
ImVec2 base_pos_clamped = ImClamp(ref_pos, r_outer.Min, r_outer.Max - size);
|
||||
//GImGui->OverlayDrawList.AddRect(r_avoid.Min, r_avoid.Max, IM_COL32(255,0,0,255));
|
||||
@ -4782,15 +4782,15 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
window->DrawList->Clear();
|
||||
window->DrawList->Flags = (g.Style.AntiAliasedLines ? ImDrawListFlags_AntiAliasedLines : 0) | (g.Style.AntiAliasedFill ? ImDrawListFlags_AntiAliasedFill : 0);
|
||||
window->DrawList->PushTextureID(g.Font->ContainerAtlas->TexID);
|
||||
ImRect fullscreen_rect(GetVisibleRect());
|
||||
ImRect viewport_rect(GetViewportRect());
|
||||
if ((flags & ImGuiWindowFlags_ChildWindow) && !(flags & ImGuiWindowFlags_Popup) && !window_is_child_tooltip)
|
||||
PushClipRect(parent_window->ClipRect.Min, parent_window->ClipRect.Max, true);
|
||||
else
|
||||
PushClipRect(fullscreen_rect.Min, fullscreen_rect.Max, true);
|
||||
PushClipRect(viewport_rect.Min, viewport_rect.Max, true);
|
||||
|
||||
// Draw modal window background (darkens what is behind them)
|
||||
if ((flags & ImGuiWindowFlags_Modal) != 0 && window == GetFrontMostModalRootWindow())
|
||||
window->DrawList->AddRectFilled(fullscreen_rect.Min, fullscreen_rect.Max, GetColorU32(ImGuiCol_ModalWindowDarkening, g.ModalWindowDarkeningRatio));
|
||||
window->DrawList->AddRectFilled(viewport_rect.Min, viewport_rect.Max, GetColorU32(ImGuiCol_ModalWindowDarkening, g.ModalWindowDarkeningRatio));
|
||||
|
||||
// Draw window + handle manual resize
|
||||
const float window_rounding = window->WindowRounding;
|
||||
|
10
3rdparty/ocornut-imgui/imgui.h
vendored
10
3rdparty/ocornut-imgui/imgui.h
vendored
@ -8,9 +8,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(IMGUI_DISABLE_INCLUDE_IMCONFIG_H) || defined(IMGUI_INCLUDE_IMCONFIG_H)
|
||||
#include "imconfig.h" // User-editable configuration file
|
||||
// User-editable configuration files (edit stock imconfig.h or define IMGUI_USER_CONFIG to your own filename)
|
||||
#ifdef IMGUI_USER_CONFIG
|
||||
#include IMGUI_USER_CONFIG
|
||||
#endif
|
||||
#if !defined(IMGUI_DISABLE_INCLUDE_IMCONFIG_H) || defined(IMGUI_INCLUDE_IMCONFIG_H)
|
||||
#include "imconfig.h"
|
||||
#endif
|
||||
|
||||
#include <float.h> // FLT_MAX
|
||||
#include <stdarg.h> // va_list
|
||||
#include <stddef.h> // ptrdiff_t, NULL
|
||||
@ -1075,6 +1080,7 @@ public:
|
||||
Capacity = new_capacity;
|
||||
}
|
||||
|
||||
// NB: &v cannot be pointing inside the ImVector Data itself! e.g. v.push_back(v[10]) is forbidden.
|
||||
inline void push_back(const value_type& v) { if (Size == Capacity) reserve(_grow_capacity(Size + 1)); Data[Size++] = v; }
|
||||
inline void pop_back() { IM_ASSERT(Size > 0); Size--; }
|
||||
inline void push_front(const value_type& v) { if (Size == 0) push_back(v); else insert(Data, v); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user