mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Merge branch 'viewport' into docking
# Conflicts: # imgui.cpp # imgui_internal.h
This commit is contained in:
@ -7198,7 +7198,7 @@ bool ImGui::BeginPopupModal(const char* name, bool* p_open, ImGuiWindowFlags fla
|
||||
if (g.NextWindowData.PosCond == 0)
|
||||
SetNextWindowPos(window->Viewport->GetCenter(), ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
|
||||
|
||||
flags |= flags | ImGuiWindowFlags_Popup | ImGuiWindowFlags_Modal | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoDocking;
|
||||
flags |= ImGuiWindowFlags_Popup | ImGuiWindowFlags_Modal | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoDocking;
|
||||
const bool is_open = Begin(name, p_open, flags);
|
||||
if (!is_open || (p_open && !*p_open)) // NB: is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
|
||||
{
|
||||
@ -7981,9 +7981,13 @@ static int ImGui::FindPlatformMonitorForPos(const ImVec2& pos)
|
||||
static int ImGui::FindPlatformMonitorForRect(const ImRect& rect)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
float surface_threshold = rect.GetWidth() * rect.GetHeight() * 0.5f;
|
||||
|
||||
// Use a minimum threshold of 1.0f so a zero-sized rect will still find its monitor given its position.
|
||||
// This is necessary for tooltips which always resize down to zero at first.
|
||||
const float surface_threshold = ImMax(rect.GetWidth() * rect.GetHeight() * 0.5f, 1.0f);
|
||||
int best_monitor_n = -1;
|
||||
float best_monitor_surface = 0.001f;
|
||||
|
||||
for (int monitor_n = 0; monitor_n < g.PlatformIO.Monitors.Size && best_monitor_surface < surface_threshold; monitor_n++)
|
||||
{
|
||||
const ImGuiPlatformMonitor& monitor = g.PlatformIO.Monitors[monitor_n];
|
||||
|
Reference in New Issue
Block a user