Merge branch 'master' into docking

# Conflicts:
#	backends/imgui_impl_sdl3.cpp
#	docs/CHANGELOG.txt
#	imgui.cpp
#	imgui.h
#	imgui_internal.h
This commit is contained in:
ocornut
2024-09-04 16:58:44 +02:00
16 changed files with 123 additions and 63 deletions

View File

@@ -1,4 +1,4 @@
// dear imgui, v1.91.1 WIP
// dear imgui, v1.91.1
// (main code and documentation)
// Help:
@@ -4357,7 +4357,7 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
const float delay = CalcDelayFromHoveredFlags(flags);
if (delay > 0.0f || (flags & ImGuiHoveredFlags_Stationary))
{
ImGuiID hover_delay_id = (g.LastItemData.ID != 0) ? g.LastItemData.ID : window->GetIDFromRectangle(g.LastItemData.Rect);
ImGuiID hover_delay_id = (g.LastItemData.ID != 0) ? g.LastItemData.ID : window->GetIDFromPos(g.LastItemData.Rect.Min);
if ((flags & ImGuiHoveredFlags_NoSharedDelay) && (g.HoverItemDelayIdPreviousFrame != hover_delay_id))
g.HoverItemDelayTimer = 0.0f;
g.HoverItemDelayId = hover_delay_id;
@@ -8984,6 +8984,16 @@ ImGuiID ImGuiWindow::GetID(int n)
}
// This is only used in rare/specific situations to manufacture an ID out of nowhere.
// FIXME: Consider instead storing last non-zero ID + count of successive zero-ID, and combine those?
ImGuiID ImGuiWindow::GetIDFromPos(const ImVec2& p_abs)
{
ImGuiID seed = IDStack.back();
ImVec2 p_rel = ImGui::WindowPosAbsToRel(this, p_abs);
ImGuiID id = ImHashData(&p_rel, sizeof(p_rel), seed);
return id;
}
// "
ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs)
{
ImGuiID seed = IDStack.back();
@@ -12041,6 +12051,9 @@ void ImGui::ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_
ImGuiContext& g = *GImGui;
IMGUI_DEBUG_LOG_POPUP("[popup] ClosePopupToLevel(%d), restore_under=%d\n", remaining, restore_focus_to_window_under_popup);
IM_ASSERT(remaining >= 0 && remaining < g.OpenPopupStack.Size);
if (g.DebugLogFlags & ImGuiDebugLogFlags_EventPopup)
for (int n = remaining; n < g.OpenPopupStack.Size; n++)
IMGUI_DEBUG_LOG_POPUP("[popup] - Closing PopupID 0x%08X Window \"%s\"\n", g.OpenPopupStack[n].PopupId, g.OpenPopupStack[n].Window ? g.OpenPopupStack[n].Window->Name : NULL);
// Trim open popup stack
ImGuiPopupData prev_popup = g.OpenPopupStack[remaining];
@@ -20406,7 +20419,7 @@ void ImGui::UpdateDebugToolFlashStyleColor()
ImGuiContext& g = *GImGui;
if (g.DebugFlashStyleColorTime <= 0.0f)
return;
ColorConvertHSVtoRGB(cosf(g.DebugFlashStyleColorTime * 6.0f) * 0.5f + 0.5f, 0.5f, 0.5f, g.Style.Colors[g.DebugFlashStyleColorIdx].x, g.Style.Colors[g.DebugFlashStyleColorIdx].y, g.Style.Colors[g.DebugFlashStyleColorIdx].z);
ColorConvertHSVtoRGB(ImCos(g.DebugFlashStyleColorTime * 6.0f) * 0.5f + 0.5f, 0.5f, 0.5f, g.Style.Colors[g.DebugFlashStyleColorIdx].x, g.Style.Colors[g.DebugFlashStyleColorIdx].y, g.Style.Colors[g.DebugFlashStyleColorIdx].z);
g.Style.Colors[g.DebugFlashStyleColorIdx].w = 1.0f;
if ((g.DebugFlashStyleColorTime -= g.IO.DeltaTime) <= 0.0f)
DebugFlashStyleColorStop();