update dear imgui from 1.92.6-docking to 1.92.7-docking

This commit is contained in:
Sven Balzer
2026-04-02 20:22:14 +02:00
parent b549728a24
commit 85d1832a0c
40 changed files with 1823 additions and 1130 deletions
+7 -5
View File
@@ -1,4 +1,4 @@
// dear imgui, v1.92.6
// dear imgui, v1.92.7
// (drawing and font code)
/*
@@ -1318,7 +1318,7 @@ void ImDrawList::PathArcTo(const ImVec2& center, float radius, float a_min, floa
{
const float arc_length = ImAbs(a_max - a_min);
const int circle_segment_count = _CalcCircleAutoSegmentCount(radius);
const int arc_segment_count = ImMax((int)ImCeil(circle_segment_count * arc_length / (IM_PI * 2.0f)), (int)(2.0f * IM_PI / arc_length));
const int arc_segment_count = ImMax((int)ImCeil(circle_segment_count * arc_length / (IM_PI * 2.0f)), 1);
_PathArcToN(center, radius, a_min, a_max, arc_segment_count);
}
}
@@ -3209,7 +3209,7 @@ ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels,
ImFontConfig font_cfg = font_cfg_template ? *font_cfg_template : ImFontConfig();
if (font_cfg.Name[0] == '\0')
{
// Store a short copy of filename into into the font name for convenience
// Store a short copy of filename into the font name for convenience
const char* p;
for (p = filename + ImStrlen(filename); p > filename && p[-1] != '/' && p[-1] != '\\'; p--) {}
ImFormatString(font_cfg.Name, IM_COUNTOF(font_cfg.Name), "%s", p);
@@ -3217,7 +3217,7 @@ ImFont* ImFontAtlas::AddFontFromFileTTF(const char* filename, float size_pixels,
return AddFontFromMemoryTTF(data, (int)data_size, size_pixels, &font_cfg, glyph_ranges);
}
// NB: Transfer ownership of 'ttf_data' to ImFontAtlas, unless font_cfg_template->FontDataOwnedByAtlas == false. Owned TTF buffer will be deleted after Build().
// NB: Transfer ownership of 'font_data' to ImFontAtlas, unless font_cfg_template->FontDataOwnedByAtlas == false. Owned TTF buffer will be deleted after Build().
ImFont* ImFontAtlas::AddFontFromMemoryTTF(void* font_data, int font_data_size, float size_pixels, const ImFontConfig* font_cfg_template, const ImWchar* glyph_ranges)
{
IM_ASSERT(!Locked && "Cannot modify a locked ImFontAtlas!");
@@ -3264,7 +3264,9 @@ void ImFontAtlasBuildNotifySetFont(ImFontAtlas* atlas, ImFont* old_font, ImFont*
shared_data->Font = new_font;
if (ImGuiContext* ctx = shared_data->Context)
{
if (ctx->FrameCount == 0 && old_font == NULL) // While this should work either way, we save ourselves the bother / debugging confusion of running ImGui code so early when it is not needed.
// While this should work either way, we save ourselves the bother / debugging confusion of running ImGui code so early when it is not needed.
// Also fixes erroneously rewriting style.FontSizeBase during init if adding default fonts.
if (old_font == NULL && ctx->Font == NULL && ctx->FontSizeBase == 0.0f)
continue;
if (ctx->IO.FontDefault == old_font)