Merge branch 'master' into docking

# Conflicts:
#	backends/imgui_impl_sdl2.cpp
#	backends/imgui_impl_sdl3.cpp
#	imgui.h
#	imgui_demo.cpp
#	imgui_internal.h
This commit is contained in:
ocornut
2026-02-17 17:49:40 +01:00
19 changed files with 279 additions and 167 deletions

View File

@@ -1,4 +1,4 @@
// dear imgui, v1.92.6 WIP
// dear imgui, v1.92.6
// (widgets code)
/*
@@ -4258,7 +4258,7 @@ static void stb_textedit_replace(ImGuiInputTextState* str, STB_TexteditState* st
// We added an extra indirection where 'Stb' is heap-allocated, in order facilitate the work of bindings generators.
ImGuiInputTextState::ImGuiInputTextState()
{
memset(this, 0, sizeof(*this));
memset((void*)this, 0, sizeof(*this));
Stb = IM_NEW(ImStbTexteditState);
memset(Stb, 0, sizeof(*Stb));
}
@@ -4308,7 +4308,7 @@ void ImGuiInputTextState::ReloadUserBufAndMoveToEnd() { WantReloadUserBuf
ImGuiInputTextCallbackData::ImGuiInputTextCallbackData()
{
memset(this, 0, sizeof(*this));
memset((void*)this, 0, sizeof(*this));
}
// Public API to manipulate UTF-8 text from within a callback.
@@ -5407,7 +5407,6 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
}
ImVec2 draw_pos = is_multiline ? draw_window->DC.CursorPos : frame_bb.Min + style.FramePadding;
ImVec2 text_size(0.0f, 0.0f);
ImRect clip_rect(frame_bb.Min.x, frame_bb.Min.y, frame_bb.Min.x + inner_size.x, frame_bb.Min.y + inner_size.y); // Not using frame_bb.Max because we have adjusted size
if (is_multiline)
clip_rect.ClipWith(draw_window->ClipRect);
@@ -5465,7 +5464,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
line_visible_n1 = ImMin(line_visible_n1, line_count);
// Store text height (we don't need width)
text_size = ImVec2(inner_size.x, line_count * g.FontSize);
float text_size_y = line_count * g.FontSize;
//GetForegroundDrawList()->AddRect(draw_pos + ImVec2(0, line_visible_n0 * g.FontSize), draw_pos + ImVec2(frame_size.x, line_visible_n1 * g.FontSize), IM_COL32(255, 0, 0, 255));
// Calculate blinking cursor position
@@ -5525,7 +5524,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
}
if (new_scroll_y != scroll_y)
{
const float scroll_max_y = ImMax((text_size.y + style.FramePadding.y * 2.0f) - inner_size.y, 0.0f);
const float scroll_max_y = ImMax((text_size_y + style.FramePadding.y * 2.0f) - inner_size.y, 0.0f);
scroll_y = ImClamp(new_scroll_y, 0.0f, scroll_max_y);
draw_pos.y += (draw_window->Scroll.y - scroll_y); // Manipulate cursor pos immediately avoid a frame of lag
draw_window->Scroll.y = scroll_y;
@@ -5618,7 +5617,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (is_multiline)
{
// For focus requests to work on our multiline we need to ensure our child ItemAdd() call specifies the ImGuiItemFlags_Inputable (see #4761, #7870)...
Dummy(ImVec2(text_size.x, text_size.y + style.FramePadding.y));
Dummy(ImVec2(0.0f, text_size_y + style.FramePadding.y));
g.NextItemData.ItemFlags |= (ImGuiItemFlags)ImGuiItemFlags_Inputable | ImGuiItemFlags_NoTabStop;
EndChild();
item_data_backup.StatusFlags |= (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HoveredWindow);
@@ -9562,7 +9561,7 @@ struct ImGuiTabBarSection
float WidthAfterShrinkMinWidth;
float Spacing; // Horizontal spacing at the end of the section.
ImGuiTabBarSection() { memset(this, 0, sizeof(*this)); }
ImGuiTabBarSection() { memset((void*)this, 0, sizeof(*this)); }
};
namespace ImGui
@@ -9578,7 +9577,7 @@ namespace ImGui
ImGuiTabBar::ImGuiTabBar()
{
memset(this, 0, sizeof(*this));
memset((void*)this, 0, sizeof(*this));
CurrFrameVisible = PrevFrameVisible = -1;
LastTabItemIdx = -1;
}