From 9a751da136a4667564c73d678a8ff08587f14d19 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 29 May 2016 19:14:19 +0200 Subject: [PATCH 01/16] Caving in to ignoring stupid pedantic Clang warnings for old-style-cast in header files --- imgui.h | 9 +++++++++ imgui_internal.h | 23 ++++++++++++----------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/imgui.h b/imgui.h index a3db5b064..a0a386ba0 100644 --- a/imgui.h +++ b/imgui.h @@ -36,6 +36,11 @@ #define IM_PRINTFARGS(FMT) #endif +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wold-style-cast" +#endif + // Forward declarations struct ImDrawChannel; // Temporary storage for outputting drawing commands out of order, used by ImDrawList::ChannelsSplit() struct ImDrawCmd; // A single draw command within a parent ImDrawList (generally maps to 1 GPU draw call) @@ -1385,6 +1390,10 @@ struct ImFont IMGUI_API void AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst = true); // Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built. }; +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + //---- Include imgui_user.h at the end of imgui.h //---- So you can include code that extends ImGui using any of the types declared above. //---- (also convenient for user to only explicitly include vanilla imgui.h) diff --git a/imgui_internal.h b/imgui_internal.h index c67eab928..fa7fa9807 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -19,6 +19,13 @@ #pragma warning (disable: 4251) // class 'xxx' needs to have dll-interface to be used by clients of struct 'xxx' // when IMGUI_API is set to__declspec(dllexport) #endif +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-function" // for stb_textedit.h +#pragma clang diagnostic ignored "-Wmissing-prototypes" // for stb_textedit.h +#pragma clang diagnostic ignored "-Wold-style-cast" +#endif + //----------------------------------------------------------------------------- // Forward Declarations //----------------------------------------------------------------------------- @@ -47,12 +54,6 @@ typedef int ImGuiSliderFlags; // enum ImGuiSliderFlags_ namespace ImGuiStb { -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-function" -#pragma clang diagnostic ignored "-Wmissing-prototypes" -#endif - #undef STB_TEXTEDIT_STRING #undef STB_TEXTEDIT_CHARTYPE #define STB_TEXTEDIT_STRING ImGuiTextEditState @@ -60,10 +61,6 @@ namespace ImGuiStb #define STB_TEXTEDIT_GETWIDTH_NEWLINE -1.0f #include "stb_textedit.h" -#ifdef __clang__ -#pragma clang diagnostic pop -#endif - } // namespace ImGuiStb //----------------------------------------------------------------------------- @@ -746,7 +743,11 @@ namespace ImGui IMGUI_API int ParseFormatPrecision(const char* fmt, int default_value); IMGUI_API float RoundScalar(float value, int decimal_precision); -} // namespace ImGuiP +} // namespace ImGui + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif #ifdef _MSC_VER #pragma warning (pop) From adb85d800d70d3ddc4548f0e8f184eede4568034 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 29 May 2016 19:16:44 +0200 Subject: [PATCH 02/16] Version 1.49 --- imgui.cpp | 2 +- imgui.h | 4 ++-- imgui_demo.cpp | 2 +- imgui_draw.cpp | 2 +- imgui_internal.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 90e6a24dc..89fac50db 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.49 WIP +// dear imgui, v1.49 // (main code and documentation) // See ImGui::ShowTestWindow() in imgui_demo.cpp for demo code. diff --git a/imgui.h b/imgui.h index a0a386ba0..50971f949 100644 --- a/imgui.h +++ b/imgui.h @@ -1,4 +1,4 @@ -// dear imgui, v1.49 WIP +// dear imgui, v1.49 // (headers) // See imgui.cpp file for documentation. @@ -16,7 +16,7 @@ #include // ptrdiff_t, NULL #include // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp -#define IMGUI_VERSION "1.49 WIP" +#define IMGUI_VERSION "1.49" // Define attributes of all API symbols declarations, e.g. for DLL under Windows. #ifndef IMGUI_API diff --git a/imgui_demo.cpp b/imgui_demo.cpp index d98b7fff9..6ec0018e9 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.49 WIP +// dear imgui, v1.49 // (demo code) // Don't remove this file from your project! It is useful reference code that you can execute. diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 9f3c265b0..63cf882a9 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.49 WIP +// dear imgui, v1.49 // (drawing and font code) // Contains implementation for diff --git a/imgui_internal.h b/imgui_internal.h index fa7fa9807..c641c45ea 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -1,4 +1,4 @@ -// dear imgui, v1.49 WIP +// dear imgui, v1.49 // (internals) // You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility! From 5d4cf1c3f35834f05469147fb0aef8174c638334 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 30 May 2016 19:38:36 +0200 Subject: [PATCH 03/16] Version 1.50 WIP --- imgui.cpp | 2 +- imgui.h | 4 ++-- imgui_demo.cpp | 2 +- imgui_draw.cpp | 2 +- imgui_internal.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 89fac50db..c551dcd5a 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.49 +// dear imgui, v1.50 WIP // (main code and documentation) // See ImGui::ShowTestWindow() in imgui_demo.cpp for demo code. diff --git a/imgui.h b/imgui.h index 50971f949..57e58b904 100644 --- a/imgui.h +++ b/imgui.h @@ -1,4 +1,4 @@ -// dear imgui, v1.49 +// dear imgui, v1.50 WIP // (headers) // See imgui.cpp file for documentation. @@ -16,7 +16,7 @@ #include // ptrdiff_t, NULL #include // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp -#define IMGUI_VERSION "1.49" +#define IMGUI_VERSION "1.50 WIP" // Define attributes of all API symbols declarations, e.g. for DLL under Windows. #ifndef IMGUI_API diff --git a/imgui_demo.cpp b/imgui_demo.cpp index 6ec0018e9..5117c7fc7 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.49 +// dear imgui, v1.50 WIP // (demo code) // Don't remove this file from your project! It is useful reference code that you can execute. diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 63cf882a9..037670960 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -1,4 +1,4 @@ -// dear imgui, v1.49 +// dear imgui, v1.50 WIP // (drawing and font code) // Contains implementation for diff --git a/imgui_internal.h b/imgui_internal.h index c641c45ea..a427a5fdb 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -1,4 +1,4 @@ -// dear imgui, v1.49 +// dear imgui, v1.50 WIP // (internals) // You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility! From 254a1a9e4c58dbc719cd8cc198ae6668a6aa8286 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 30 May 2016 20:00:20 +0200 Subject: [PATCH 04/16] InputText: Added support for CTRL+Backspace. --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index c551dcd5a..83a0ec5d0 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -7756,7 +7756,7 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2 else if (IsKeyPressedMap(ImGuiKey_Home)) { edit_state.OnKeyPressed(is_ctrl_down ? STB_TEXTEDIT_K_TEXTSTART | k_mask : STB_TEXTEDIT_K_LINESTART | k_mask); } else if (IsKeyPressedMap(ImGuiKey_End)) { edit_state.OnKeyPressed(is_ctrl_down ? STB_TEXTEDIT_K_TEXTEND | k_mask : STB_TEXTEDIT_K_LINEEND | k_mask); } else if (IsKeyPressedMap(ImGuiKey_Delete) && is_editable) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_DELETE | k_mask); } - else if (IsKeyPressedMap(ImGuiKey_Backspace) && is_editable) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_BACKSPACE | k_mask); } + else if (IsKeyPressedMap(ImGuiKey_Backspace) && is_editable) { if (is_ctrl_down && !edit_state.HasSelection()) edit_state.OnKeyPressed(STB_TEXTEDIT_K_WORDLEFT|STB_TEXTEDIT_K_SHIFT); edit_state.OnKeyPressed(STB_TEXTEDIT_K_BACKSPACE | k_mask); } else if (IsKeyPressedMap(ImGuiKey_Enter)) { bool ctrl_enter_for_new_line = (flags & ImGuiInputTextFlags_CtrlEnterForNewLine) != 0; From d1c073a19981aa6c1bd0064e951d4b180d5e19f5 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 31 May 2016 00:00:44 +0200 Subject: [PATCH 05/16] Comments, tweaks --- README.md | 2 +- imgui.cpp | 9 ++++----- imgui_demo.cpp | 2 +- imgui_internal.h | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9e32e9e26..8a9eab157 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ ImGui is very programmer centric and the immediate-mode GUI paradigm might requi Is ImGui fast? -Probably fast enough for most uses. Down to the fundation of its visual design, ImGui is engineered to be fairly performant both in term of CPU and GPU usage. Running elaborate code and creating elaborate UI will of course have a cost but ImGui aims to minimize it. +Probably fast enough for most uses. Down to the foundation of its visual design, ImGui is engineered to be fairly performant both in term of CPU and GPU usage. Running elaborate code and creating elaborate UI will of course have a cost but ImGui aims to minimize it. Mileage may vary but the following screenshot can give you a rough idea of the cost of running and rendering UI code (In the case of a trivial demo application like this one, your driver/os setup are likely to be the bottleneck. Testing performance as part of a real application is recommended). diff --git a/imgui.cpp b/imgui.cpp index 83a0ec5d0..3787d1b4f 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -610,7 +610,6 @@ #include "imgui_internal.h" #include // toupper, isprint -#include // sqrtf, fabsf, fmodf, powf, cosf, sinf, floorf, ceilf #include // NULL, malloc, free, qsort, atoi #include // vsnprintf, sscanf, printf #include // INT_MIN, INT_MAX @@ -9129,10 +9128,10 @@ void ImGui::EndGroup() } // Gets back to previous line and continue with horizontal layout -// pos_x == 0 : follow on previous item -// pos_x != 0 : align to specified column -// spacing_w < 0 : use default spacing if column_x==0, no spacing if column_x!=0 -// spacing_w >= 0 : enforce spacing +// pos_x == 0 : follow right after previous item +// pos_x != 0 : align to specified x position +// spacing_w < 0 : use default spacing if pos_x == 0, no spacing if pos_x != 0 +// spacing_w >= 0 : enforce spacing amount void ImGui::SameLine(float pos_x, float spacing_w) { ImGuiWindow* window = GetCurrentWindow(); diff --git a/imgui_demo.cpp b/imgui_demo.cpp index 5117c7fc7..e7487f6bb 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -11,7 +11,7 @@ #include "imgui.h" #include // toupper, isprint -#include // sqrtf, fabsf, fmodf, powf, cosf, sinf, floorf, ceilf +#include // sqrtf, powf, cosf, sinf, floorf, ceilf #include // vsnprintf, sscanf, printf #include // NULL, malloc, free, qsort, atoi #if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier diff --git a/imgui_internal.h b/imgui_internal.h index a427a5fdb..28fb93e98 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -12,7 +12,7 @@ #endif #include // FILE* -#include // sqrtf() +#include // sqrtf, fabsf, fmodf, powf, floorf, ceilf, cosf, sinf #ifdef _MSC_VER #pragma warning (push) From 8291d7dc7c3d17425462e7aaf8593a4465405968 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 31 May 2016 22:34:48 +0200 Subject: [PATCH 06/16] Fixed minor bug introduced in 45dacbf084e897c317d034275fbd070ed71c0709 (#682) Actually minor because nobody uses that value. Still a terrible bug. --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 3787d1b4f..55eb344c2 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4202,7 +4202,7 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us // Update ContentsRegionMax. All the variable it depends on are set above in this function. window->ContentsRegionRect.Min.x = -window->Scroll.x + window->WindowPadding.x; - window->ContentsRegionRect.Min.x = -window->Scroll.y + window->WindowPadding.y + window->TitleBarHeight() + window->MenuBarHeight(); + window->ContentsRegionRect.Min.y = -window->Scroll.y + window->WindowPadding.y + window->TitleBarHeight() + window->MenuBarHeight(); window->ContentsRegionRect.Max.x = -window->Scroll.x - window->WindowPadding.x + (window->SizeContentsExplicit.x != 0.0f ? window->SizeContentsExplicit.x : (window->Size.x - window->ScrollbarSizes.x)); window->ContentsRegionRect.Max.y = -window->Scroll.y - window->WindowPadding.y + (window->SizeContentsExplicit.y != 0.0f ? window->SizeContentsExplicit.y : (window->Size.y - window->ScrollbarSizes.y)); From 0f36ec9cb9c8a9ac192a2571f6dd9bfc9000b514 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sat, 4 Jun 2016 14:48:08 +0100 Subject: [PATCH 07/16] Fixed a crash bug in stb_textedit.h (#681) --- stb_textedit.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stb_textedit.h b/stb_textedit.h index 3c3003252..23f0f24ee 100644 --- a/stb_textedit.h +++ b/stb_textedit.h @@ -1,4 +1,5 @@ // [ImGui] this is a slightly modified version of stb_truetype.h 1.8 +// [ImGui] - fixed a crash bug in stb_textedit_discard_redo (#681) // [ImGui] - fixed some minor warnings // [ImGui] - added STB_TEXTEDIT_MOVEWORDLEFT/STB_TEXTEDIT_MOVEWORDRIGHT custom handler (#473) @@ -1095,7 +1096,7 @@ static void stb_textedit_discard_redo(StbUndoState *state) int n = state->undo_rec[k].insert_length, i; // delete n characters from all other records state->redo_char_point = state->redo_char_point + (short) n; // vsnet05 - STB_TEXTEDIT_memmove(state->undo_char + state->redo_char_point, state->undo_char + state->redo_char_point-n, (size_t) ((size_t)(STB_TEXTEDIT_UNDOSTATECOUNT - state->redo_char_point)*sizeof(STB_TEXTEDIT_CHARTYPE))); + STB_TEXTEDIT_memmove(state->undo_char + state->redo_char_point, state->undo_char + state->redo_char_point-n, (size_t) ((size_t)(STB_TEXTEDIT_UNDOCHARCOUNT - state->redo_char_point)*sizeof(STB_TEXTEDIT_CHARTYPE))); for (i=state->redo_point; i < k; ++i) if (state->undo_rec[i].char_storage >= 0) state->undo_rec[i].char_storage = state->undo_rec[i].char_storage + (short) n; // vsnet05 From d6a5fd06d7003568609042dd1df40b9457bafffb Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 7 Jun 2016 08:46:50 +0200 Subject: [PATCH 08/16] Demo: Added an extra 3-way columns demo --- imgui_demo.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/imgui_demo.cpp b/imgui_demo.cpp index e7487f6bb..c890d75a7 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -1312,7 +1312,22 @@ void ImGui::ShowTestWindow(bool* p_open) // Basic columns if (ImGui::TreeNode("Basic")) { - ImGui::Columns(4, "mycolumns"); + ImGui::Text("Without border:"); + ImGui::Columns(3, "mycolumns3", false); // 3-ways, no border + ImGui::Separator(); + for (int n = 0; n < 14; n++) + { + char label[32]; + sprintf(label, "Item %d", n); + if (ImGui::Selectable(label)) {} + //if (ImGui::Button(label, ImVec2(-1,0))) {} + ImGui::NextColumn(); + } + ImGui::Columns(1); + ImGui::Separator(); + + ImGui::Text("With border:"); + ImGui::Columns(4, "mycolumns"); // 4-ways, with border ImGui::Separator(); ImGui::Text("ID"); ImGui::NextColumn(); ImGui::Text("Name"); ImGui::NextColumn(); From 4fddfa4b5e27520ee8518e58af3cb53f26846943 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 7 Jun 2016 09:05:36 +0200 Subject: [PATCH 09/16] Demo: extra (somehow duplicate) Selectables+Columns demo --- imgui_demo.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/imgui_demo.cpp b/imgui_demo.cpp index c890d75a7..752cd42b6 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -442,6 +442,19 @@ void ImGui::ShowTestWindow(bool* p_open) ImGui::Selectable("Hello.h", &selected[2]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes"); ImGui::TreePop(); } + if (ImGui::TreeNode("In columns")) + { + ImGui::Columns(3, NULL, false); + static bool selected[16] = { 0 }; + for (int i = 0; i < 16; i++) + { + char label[32]; sprintf(label, "Item %d", i); + if (ImGui::Selectable(label, &selected[i])) {} + ImGui::NextColumn(); + } + ImGui::Columns(1); + ImGui::TreePop(); + } if (ImGui::TreeNode("Grid")) { static bool selected[16] = { true, false, false, false, false, true, false, false, false, false, true, false, false, false, false, true }; From 65a525550ecf48e14f20681b081b1d9c8c136563 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 7 Jun 2016 09:14:54 +0200 Subject: [PATCH 10/16] ImFont: Allowing to use up to 0xFFFE glyphs in same font (increased from previous 0x8000) --- imgui.h | 2 +- imgui_draw.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/imgui.h b/imgui.h index 57e58b904..f94423931 100644 --- a/imgui.h +++ b/imgui.h @@ -1357,7 +1357,7 @@ struct ImFont ImVec2 DisplayOffset; // = (0.f,1.f) // Offset font rendering by xx pixels ImVector Glyphs; // // All glyphs. ImVector IndexXAdvance; // // Sparse. Glyphs->XAdvance in a directly indexable way (more cache-friendly, for CalcTextSize functions which are often bottleneck in large UI). - ImVector IndexLookup; // // Sparse. Index glyphs by Unicode code-point. + ImVector IndexLookup; // // Sparse. Index glyphs by Unicode code-point. const Glyph* FallbackGlyph; // == FindGlyph(FontFallbackChar) float FallbackXAdvance; // == FallbackGlyph->XAdvance ImWchar FallbackChar; // = '?' // Replacement glyph if one isn't found. Only set via SetFallbackChar() diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 037670960..5f4854810 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -1695,7 +1695,7 @@ void ImFont::BuildLookupTable() for (int i = 0; i != Glyphs.Size; i++) max_codepoint = ImMax(max_codepoint, (int)Glyphs[i].Codepoint); - IM_ASSERT(Glyphs.Size < 32*1024); + IM_ASSERT(Glyphs.Size < 0xFFFF); // -1 is reserved IndexXAdvance.clear(); IndexLookup.clear(); GrowIndex(max_codepoint + 1); @@ -1703,7 +1703,7 @@ void ImFont::BuildLookupTable() { int codepoint = (int)Glyphs[i].Codepoint; IndexXAdvance[codepoint] = Glyphs[i].XAdvance; - IndexLookup[codepoint] = (short)i; + IndexLookup[codepoint] = (unsigned short)i; } // Create a glyph to handle TAB @@ -1717,7 +1717,7 @@ void ImFont::BuildLookupTable() tab_glyph.Codepoint = '\t'; tab_glyph.XAdvance *= 4; IndexXAdvance[(int)tab_glyph.Codepoint] = (float)tab_glyph.XAdvance; - IndexLookup[(int)tab_glyph.Codepoint] = (short)(Glyphs.Size-1); + IndexLookup[(int)tab_glyph.Codepoint] = (unsigned short)(Glyphs.Size-1); } FallbackGlyph = NULL; @@ -1745,7 +1745,7 @@ void ImFont::GrowIndex(int new_size) for (int i = old_size; i < new_size; i++) { IndexXAdvance[i] = -1.0f; - IndexLookup[i] = (short)-1; + IndexLookup[i] = (unsigned short)-1; } } @@ -1754,13 +1754,13 @@ void ImFont::AddRemapChar(ImWchar dst, ImWchar src, bool overwrite_dst) IM_ASSERT(IndexLookup.Size > 0); // Currently this can only be called AFTER the font has been built, aka after calling ImFontAtlas::GetTexDataAs*() function. int index_size = IndexLookup.Size; - if (dst < index_size && IndexLookup.Data[dst] == -1 && !overwrite_dst) // 'dst' already exists + if (dst < index_size && IndexLookup.Data[dst] == (unsigned short)-1 && !overwrite_dst) // 'dst' already exists return; if (src >= index_size && dst >= index_size) // both 'dst' and 'src' don't exist -> no-op return; GrowIndex(dst + 1); - IndexLookup[dst] = (src < index_size) ? IndexLookup.Data[src] : -1; + IndexLookup[dst] = (src < index_size) ? IndexLookup.Data[src] : (unsigned short)-1; IndexXAdvance[dst] = (src < index_size) ? IndexXAdvance.Data[src] : 1.0f; } @@ -1768,8 +1768,8 @@ const ImFont::Glyph* ImFont::FindGlyph(unsigned short c) const { if (c < IndexLookup.Size) { - const short i = IndexLookup[c]; - if (i != -1) + const unsigned short i = IndexLookup[c]; + if (i != (unsigned short)-1) return &Glyphs.Data[i]; } return FallbackGlyph; From 2da30e8702f9242a1af5a1e6c1bc2fa00170cd12 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sat, 11 Jun 2016 09:28:20 +0200 Subject: [PATCH 11/16] Comments (#691) --- imgui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.h b/imgui.h index f94423931..7f8d904b4 100644 --- a/imgui.h +++ b/imgui.h @@ -1268,7 +1268,7 @@ struct ImFontConfig int FontNo; // 0 // Index of font within TTF file float SizePixels; // // Size in pixels for rasterizer int OversampleH, OversampleV; // 3, 1 // Rasterize at higher quality for sub-pixel positioning. We don't use sub-pixel positions on the Y axis. - bool PixelSnapH; // false // Align every character to pixel boundary (if enabled, set OversampleH/V to 1) + bool PixelSnapH; // false // Align every glyph to pixel boundary. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1. ImVec2 GlyphExtraSpacing; // 0, 0 // Extra spacing (in pixels) between glyphs const ImWchar* GlyphRanges; // // Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list). THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE. bool MergeMode; // false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). From 3fd3eac3707550117f5c6f02987dd61704b3abe4 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sat, 11 Jun 2016 10:23:37 +0200 Subject: [PATCH 12/16] Fixed TextWrapped() override wrap position is one is already set (#690) --- imgui.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 55eb344c2..d71e611a5 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -460,7 +460,7 @@ - doc: add a proper documentation+regression testing system (#435) - window: add a way for very transient windows (non-saved, temporary overlay over hundreds of objects) to "clean" up from the global window list. perhaps a lightweight explicit cleanup pass. - - window: calling SetNextWindowSize() every frame with <= 0 doesn't do anything, may be useful to allow (particularly when used for a single axis). + - window: calling SetNextWindowSize() every frame with <= 0 doesn't do anything, may be useful to allow (particularly when used for a single axis) (#690) - window: auto-fit feedback loop when user relies on any dynamic layout (window width multiplier, column) appears weird to end-user. clarify. - window: allow resizing of child windows (possibly given min/max for each axis?) - window: background options for child windows, border option (disable rounding) @@ -5245,9 +5245,10 @@ void ImGui::TextDisabled(const char* fmt, ...) void ImGui::TextWrappedV(const char* fmt, va_list args) { - PushTextWrapPos(0.0f); + bool need_wrap = (GImGui->CurrentWindow->DC.TextWrapPos < 0.0f); // Keep existing wrap position is one ia already set + if (need_wrap) PushTextWrapPos(0.0f); TextV(fmt, args); - PopTextWrapPos(); + if (need_wrap) PopTextWrapPos(); } void ImGui::TextWrapped(const char* fmt, ...) From d79186931e663941f41aad7bb05c8b8f5f538ed9 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sat, 11 Jun 2016 15:42:10 +0200 Subject: [PATCH 13/16] ImDrawList: Fixed a (rarely occuring) bug with merging with previous command + unnecessary OverlayDrawList command --- imgui.cpp | 1 - imgui_draw.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index d71e611a5..9e392d30b 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2066,7 +2066,6 @@ void ImGui::NewFrame() g.OverlayDrawList.Clear(); g.OverlayDrawList.PushTextureID(g.IO.Fonts->TexID); g.OverlayDrawList.PushClipRectFullScreen(); - g.OverlayDrawList.AddDrawCmd(); // Mark rendering data as invalid to prevent user who may have a handle on it to use it g.RenderDrawData.Valid = false; diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 5f4854810..ba20abc87 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -196,7 +196,7 @@ void ImDrawList::UpdateClipRect() // Try to merge with previous command if it matches, else use current command ImDrawCmd* prev_cmd = CmdBuffer.Size > 1 ? curr_cmd - 1 : NULL; - if (prev_cmd && memcmp(&prev_cmd->ClipRect, &curr_clip_rect, sizeof(ImVec4)) == 0 && prev_cmd->TextureId == GetCurrentTextureId() && prev_cmd->UserCallback == NULL) + if (curr_cmd->ElemCount == 0 && prev_cmd && memcmp(&prev_cmd->ClipRect, &curr_clip_rect, sizeof(ImVec4)) == 0 && prev_cmd->TextureId == GetCurrentTextureId() && prev_cmd->UserCallback == NULL) CmdBuffer.pop_back(); else curr_cmd->ClipRect = curr_clip_rect; From 9f21c7189f92469809529b28ac4753caf31fed62 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 12 Jun 2016 12:23:16 +0200 Subject: [PATCH 14/16] TextUnformatted() fixed clipping bug in the large-text path when horizontal scroll has been applied (#692, #246) --- imgui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 9e392d30b..0c89bf3e1 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -5310,7 +5310,7 @@ void ImGui::TextUnformatted(const char* text, const char* text_end) // Lines to render if (line < text_end) { - ImRect line_rect(pos, pos + ImVec2(GetWindowWidth(), line_height)); + ImRect line_rect(pos, pos + ImVec2(FLT_MAX, line_height)); while (line < text_end) { const char* line_end = strchr(line, '\n'); @@ -9675,6 +9675,7 @@ void ImGui::ShowMetricsWindow(bool* p_open) if (!ImGui::TreeNode(window, "%s '%s', %d @ 0x%p", label, window->Name, window->Active || window->WasActive, window)) return; NodeDrawList(window->DrawList, "DrawList"); + ImGui::BulletText("Size: (%.1f,%.1f), SizeContents (%.1f,%.1f)", window->Size.x, window->Size.y, window->SizeContents.x, window->SizeContents.y); if (window->RootWindow != window) NodeWindow(window->RootWindow, "RootWindow"); if (window->DC.ChildWindows.Size > 0) NodeWindows(window->DC.ChildWindows, "ChildWindows"); ImGui::BulletText("Storage: %d bytes", window->StateStorage.Data.Size * (int)sizeof(ImGuiStorage::Pair)); From f83790dc5a241325cb54a048d53116e7fd1f884f Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 12 Jun 2016 12:23:20 +0200 Subject: [PATCH 15/16] Comments --- imgui.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/imgui.h b/imgui.h index 7f8d904b4..e806f498a 100644 --- a/imgui.h +++ b/imgui.h @@ -693,9 +693,9 @@ enum ImGuiMouseCursor_ enum ImGuiSetCond_ { ImGuiSetCond_Always = 1 << 0, // Set the variable - ImGuiSetCond_Once = 1 << 1, // Only set the variable on the first call per runtime session - ImGuiSetCond_FirstUseEver = 1 << 2, // Only set the variable if the window doesn't exist in the .ini file - ImGuiSetCond_Appearing = 1 << 3 // Only set the variable if the window is appearing after being inactive (or the first time) + ImGuiSetCond_Once = 1 << 1, // Set the variable once per runtime session (only the first call with succeed) + ImGuiSetCond_FirstUseEver = 1 << 2, // Set the variable if the window has no saved data (if doesn't exist in the .ini file) + ImGuiSetCond_Appearing = 1 << 3 // Set the variable if the window is appearing after being hidden/inactive (or the first time) }; struct ImGuiStyle From c4db79f34baab154df9882b67a1404be00d11fd5 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 12 Jun 2016 22:27:15 +0200 Subject: [PATCH 16/16] Member variable name renamed "ID" "Id" for casing consistency --- imgui.cpp | 46 +++++++++++++++++++++++----------------------- imgui_internal.h | 18 +++++++++--------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 0c89bf3e1..e0fca1011 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -1695,7 +1695,7 @@ ImGuiWindow::ImGuiWindow(const char* name) Name = ImStrdup(name); ID = ImHash(name, 0); IDStack.push_back(ID); - MoveID = GetID("#MOVE"); + MoveId = GetID("#MOVE"); Flags = 0; IndexWithinParent = 0; @@ -1714,7 +1714,7 @@ ImGuiWindow::ImGuiWindow(const char* name) Collapsed = false; SkipItems = false; BeginCount = 0; - PopupID = 0; + PopupId = 0; AutoFitFramesX = AutoFitFramesY = -1; AutoFitOnlyGrows = false; AutoPosLastDirection = -1; @@ -1839,7 +1839,7 @@ void ImGui::ItemSize(const ImRect& bb, float text_offset_y) bool ImGui::ItemAdd(const ImRect& bb, const ImGuiID* id) { ImGuiWindow* window = GetCurrentWindow(); - window->DC.LastItemID = id ? *id : 0; + window->DC.LastItemId = id ? *id : 0; window->DC.LastItemRect = bb; window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRect = false; if (IsClippedEx(bb, id, false)) @@ -1853,7 +1853,7 @@ bool ImGui::ItemAdd(const ImRect& bb, const ImGuiID* id) // So that clicking on items with no active id such as Text() still returns true with IsItemHovered() window->DC.LastItemHoveredRect = true; if (g.HoveredRootWindow == window->RootWindow) - if (g.ActiveId == 0 || (id && g.ActiveId == *id) || g.ActiveIdAllowOverlap || (g.ActiveId == window->MoveID)) + if (g.ActiveId == 0 || (id && g.ActiveId == *id) || g.ActiveIdAllowOverlap || (g.ActiveId == window->MoveId)) if (IsWindowContentHoverable(window)) window->DC.LastItemHoveredAndUsable = true; } @@ -2132,7 +2132,7 @@ void ImGui::NewFrame() { KeepAliveID(g.MovedWindowMoveId); IM_ASSERT(g.MovedWindow && g.MovedWindow->RootWindow); - IM_ASSERT(g.MovedWindow->RootWindow->MoveID == g.MovedWindowMoveId); + IM_ASSERT(g.MovedWindow->RootWindow->MoveId == g.MovedWindowMoveId); if (g.IO.MouseDown[0]) { if (!(g.MovedWindow->Flags & ImGuiWindowFlags_NoMove)) @@ -2337,7 +2337,7 @@ static ImGuiIniData* FindWindowSettings(const char* name) for (int i = 0; i != g.Settings.Size; i++) { ImGuiIniData* ini = &g.Settings[i]; - if (ini->ID == id) + if (ini->Id == id) return ini; } return NULL; @@ -2348,7 +2348,7 @@ static ImGuiIniData* AddWindowSettings(const char* name) GImGui->Settings.resize(GImGui->Settings.Size + 1); ImGuiIniData* ini = &GImGui->Settings.back(); ini->Name = ImStrdup(name); - ini->ID = ImHash(name, 0); + ini->Id = ImHash(name, 0); ini->Collapsed = false; ini->Pos = ImVec2(FLT_MAX,FLT_MAX); ini->Size = ImVec2(0,0); @@ -2579,7 +2579,7 @@ void ImGui::EndFrame() if (!(g.HoveredWindow->Flags & ImGuiWindowFlags_NoMove)) { g.MovedWindow = g.HoveredWindow; - g.MovedWindowMoveId = g.HoveredRootWindow->MoveID; + g.MovedWindowMoveId = g.HoveredRootWindow->MoveId; SetActiveID(g.MovedWindowMoveId, g.HoveredRootWindow); } } @@ -3211,7 +3211,7 @@ bool ImGui::IsItemActive() if (g.ActiveId) { ImGuiWindow* window = GetCurrentWindowRead(); - return g.ActiveId == window->DC.LastItemID; + return g.ActiveId == window->DC.LastItemId; } return false; } @@ -3242,9 +3242,9 @@ bool ImGui::IsItemVisible() void ImGui::SetItemAllowOverlap() { ImGuiContext& g = *GImGui; - if (g.HoveredId == g.CurrentWindow->DC.LastItemID) + if (g.HoveredId == g.CurrentWindow->DC.LastItemId) g.HoveredIdAllowOverlap = true; - if (g.ActiveId == g.CurrentWindow->DC.LastItemID) + if (g.ActiveId == g.CurrentWindow->DC.LastItemId) g.ActiveIdAllowOverlap = true; } @@ -3312,7 +3312,7 @@ void ImGui::EndTooltip() static bool IsPopupOpen(ImGuiID id) { ImGuiContext& g = *GImGui; - const bool is_open = g.OpenPopupStack.Size > g.CurrentPopupStack.Size && g.OpenPopupStack[g.CurrentPopupStack.Size].PopupID == id; + const bool is_open = g.OpenPopupStack.Size > g.CurrentPopupStack.Size && g.OpenPopupStack[g.CurrentPopupStack.Size].PopupId == id; return is_open; } @@ -3329,7 +3329,7 @@ void ImGui::OpenPopupEx(const char* str_id, bool reopen_existing) ImGuiPopupRef popup_ref = ImGuiPopupRef(id, window, window->GetID("##menus"), g.IO.MousePos); // Tagged as new ref because constructor sets Window to NULL (we are passing the ParentWindow info here) if (g.OpenPopupStack.Size < current_stack_size + 1) g.OpenPopupStack.push_back(popup_ref); - else if (reopen_existing || g.OpenPopupStack[current_stack_size].PopupID != id) + else if (reopen_existing || g.OpenPopupStack[current_stack_size].PopupId != id) { g.OpenPopupStack.resize(current_stack_size+1); g.OpenPopupStack[current_stack_size] = popup_ref; @@ -3405,7 +3405,7 @@ void ImGui::CloseCurrentPopup() { ImGuiContext& g = *GImGui; int popup_idx = g.CurrentPopupStack.Size - 1; - if (popup_idx < 0 || popup_idx > g.OpenPopupStack.Size || g.CurrentPopupStack[popup_idx].PopupID != g.OpenPopupStack[popup_idx].PopupID) + if (popup_idx < 0 || popup_idx > g.OpenPopupStack.Size || g.CurrentPopupStack[popup_idx].PopupId != g.OpenPopupStack[popup_idx].PopupId) return; while (popup_idx > 0 && g.OpenPopupStack[popup_idx].Window && (g.OpenPopupStack[popup_idx].Window->Flags & ImGuiWindowFlags_ChildMenu)) popup_idx--; @@ -3808,11 +3808,11 @@ bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_on_first_us if (flags & ImGuiWindowFlags_Popup) { ImGuiPopupRef& popup_ref = g.OpenPopupStack[g.CurrentPopupStack.Size]; - window_was_active &= (window->PopupID == popup_ref.PopupID); + window_was_active &= (window->PopupId == popup_ref.PopupId); window_was_active &= (window == popup_ref.Window); popup_ref.Window = window; g.CurrentPopupStack.push_back(popup_ref); - window->PopupID = popup_ref.PopupID; + window->PopupId = popup_ref.PopupId; } const bool window_appearing_after_being_hidden = (window->HiddenFrames == 1); @@ -9221,7 +9221,7 @@ static float GetDraggedColumnOffset(int column_index) ImGuiContext& g = *GImGui; ImGuiWindow* window = ImGui::GetCurrentWindowRead(); IM_ASSERT(column_index > 0); // We cannot drag column 0. If you get this assert you may have a conflict between the ID of your columns and another widgets. - IM_ASSERT(g.ActiveId == window->DC.ColumnsSetID + ImGuiID(column_index)); + IM_ASSERT(g.ActiveId == window->DC.ColumnsSetId + ImGuiID(column_index)); float x = g.IO.MousePos.x - g.ActiveIdClickOffset.x - window->Pos.x; x = ImClamp(x, ImGui::GetColumnOffset(column_index-1)+g.Style.ColumnsMinSpacing, ImGui::GetColumnOffset(column_index+1)-g.Style.ColumnsMinSpacing); @@ -9238,7 +9238,7 @@ float ImGui::GetColumnOffset(int column_index) if (g.ActiveId) { - const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(column_index); + const ImGuiID column_id = window->DC.ColumnsSetId + ImGuiID(column_index); if (g.ActiveId == column_id) return GetDraggedColumnOffset(column_index); } @@ -9259,7 +9259,7 @@ void ImGui::SetColumnOffset(int column_index, float offset) const float t = (offset - window->DC.ColumnsMinX) / (window->DC.ColumnsMaxX - window->DC.ColumnsMinX); window->DC.ColumnsData[column_index].OffsetNorm = t; - const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(column_index); + const ImGuiID column_id = window->DC.ColumnsSetId + ImGuiID(column_index); window->DC.StateStorage->SetFloat(column_id, t); } @@ -9310,7 +9310,7 @@ void ImGui::Columns(int columns_count, const char* id, bool border) for (int i = 1; i < window->DC.ColumnsCount; i++) { float x = window->Pos.x + GetColumnOffset(i); - const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(i); + const ImGuiID column_id = window->DC.ColumnsSetId + ImGuiID(i); const ImRect column_rect(ImVec2(x-4,y1),ImVec2(x+4,y2)); if (IsClippedEx(column_rect, &column_id, false)) continue; @@ -9338,7 +9338,7 @@ void ImGui::Columns(int columns_count, const char* id, bool border) // Differentiate column ID with an arbitrary prefix for cases where users name their columns set the same as another widget. // In addition, when an identifier isn't explicitly provided we include the number of columns in the hash to make it uniquer. PushID(0x11223347 + (id ? 0 : columns_count)); - window->DC.ColumnsSetID = window->GetID(id ? id : "columns"); + window->DC.ColumnsSetId = window->GetID(id ? id : "columns"); PopID(); // Set state for first column @@ -9360,7 +9360,7 @@ void ImGui::Columns(int columns_count, const char* id, bool border) window->DC.ColumnsData.resize(columns_count + 1); for (int column_index = 0; column_index < columns_count + 1; column_index++) { - const ImGuiID column_id = window->DC.ColumnsSetID + ImGuiID(column_index); + const ImGuiID column_id = window->DC.ColumnsSetId + ImGuiID(column_index); KeepAliveID(column_id); const float default_t = column_index / (float)window->DC.ColumnsCount; const float t = window->DC.StateStorage->GetFloat(column_id, default_t); // Cheaply store our floating point value inside the integer (could store an union into the map?) @@ -9696,7 +9696,7 @@ void ImGui::ShowMetricsWindow(bool* p_open) for (int i = 0; i < g.OpenPopupStack.Size; i++) { ImGuiWindow* window = g.OpenPopupStack[i].Window; - ImGui::BulletText("PopupID: %08x, Window: '%s'%s%s", g.OpenPopupStack[i].PopupID, window ? window->Name : "NULL", window && (window->Flags & ImGuiWindowFlags_ChildWindow) ? " ChildWindow" : "", window && (window->Flags & ImGuiWindowFlags_ChildMenu) ? " ChildMenu" : ""); + ImGui::BulletText("PopupID: %08x, Window: '%s'%s%s", g.OpenPopupStack[i].PopupId, window ? window->Name : "NULL", window && (window->Flags & ImGuiWindowFlags_ChildWindow) ? " ChildWindow" : "", window && (window->Flags & ImGuiWindowFlags_ChildMenu) ? " ChildMenu" : ""); } ImGui::TreePop(); } diff --git a/imgui_internal.h b/imgui_internal.h index 28fb93e98..e19f3e426 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -312,7 +312,7 @@ struct IMGUI_API ImGuiTextEditState struct ImGuiIniData { char* Name; - ImGuiID ID; + ImGuiID Id; ImVec2 Pos; ImVec2 Size; bool Collapsed; @@ -331,13 +331,13 @@ struct ImGuiMouseCursorData // Storage for current popup stack struct ImGuiPopupRef { - ImGuiID PopupID; // Set on OpenPopup() + ImGuiID PopupId; // Set on OpenPopup() ImGuiWindow* Window; // Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup() ImGuiWindow* ParentWindow; // Set on OpenPopup() ImGuiID ParentMenuSet; // Set on OpenPopup() ImVec2 MousePosOnOpen; // Copy of mouse position at the time of opening popup - ImGuiPopupRef(ImGuiID id, ImGuiWindow* parent_window, ImGuiID parent_menu_set, const ImVec2& mouse_pos) { PopupID = id; Window = NULL; ParentWindow = parent_window; ParentMenuSet = parent_menu_set; MousePosOnOpen = mouse_pos; } + ImGuiPopupRef(ImGuiID id, ImGuiWindow* parent_window, ImGuiID parent_menu_set, const ImVec2& mouse_pos) { PopupId = id; Window = NULL; ParentWindow = parent_window; ParentMenuSet = parent_menu_set; MousePosOnOpen = mouse_pos; } }; // Main state for ImGui @@ -522,7 +522,7 @@ struct IMGUI_API ImGuiDrawContext float PrevLineTextBaseOffset; float LogLinePosY; int TreeDepth; - ImGuiID LastItemID; + ImGuiID LastItemId; ImRect LastItemRect; bool LastItemHoveredAndUsable; // Item rectangle is hovered, and its window is currently interactable with (not blocked by a popup preventing access to the window) bool LastItemHoveredRect; // Item rectangle is hovered, but its window may or not be currently interactable with (might be blocked by a popup preventing access to the window) @@ -555,7 +555,7 @@ struct IMGUI_API ImGuiDrawContext float ColumnsCellMinY; float ColumnsCellMaxY; bool ColumnsShowBorders; - ImGuiID ColumnsSetID; + ImGuiID ColumnsSetId; ImVector ColumnsData; ImGuiDrawContext() @@ -565,7 +565,7 @@ struct IMGUI_API ImGuiDrawContext CurrentLineTextBaseOffset = PrevLineTextBaseOffset = 0.0f; LogLinePosY = -1.0f; TreeDepth = 0; - LastItemID = 0; + LastItemId = 0; LastItemRect = ImRect(0.0f,0.0f,0.0f,0.0f); LastItemHoveredAndUsable = LastItemHoveredRect = false; MenuBarAppending = false; @@ -587,7 +587,7 @@ struct IMGUI_API ImGuiDrawContext ColumnsStartPosY = 0.0f; ColumnsCellMinY = ColumnsCellMaxY = 0.0f; ColumnsShowBorders = true; - ColumnsSetID = 0; + ColumnsSetId = 0; } }; @@ -606,7 +606,7 @@ struct IMGUI_API ImGuiWindow ImVec2 SizeContentsExplicit; // Size of contents explicitly set by the user via SetNextWindowContentSize() ImRect ContentsRegionRect; // Maximum visible content position in window coordinates. ~~ (SizeContentsExplicit ? SizeContentsExplicit : Size - ScrollbarSizes) - CursorStartPos, per axis ImVec2 WindowPadding; // Window padding at the time of begin. We need to lock it, in particular manipulation of the ShowBorder would have an effect - ImGuiID MoveID; // == window->GetID("#MOVE") + ImGuiID MoveId; // == window->GetID("#MOVE") ImVec2 Scroll; ImVec2 ScrollTarget; // target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change) ImVec2 ScrollTargetCenterRatio; // 0.0f = scroll so that target position is at top, 0.5f = scroll so that target position is centered @@ -619,7 +619,7 @@ struct IMGUI_API ImGuiWindow bool Collapsed; // Set when collapsing window to become only title-bar bool SkipItems; // == Visible && !Collapsed int BeginCount; // Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs) - ImGuiID PopupID; // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling) + ImGuiID PopupId; // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling) int AutoFitFramesX, AutoFitFramesY; bool AutoFitOnlyGrows; int AutoPosLastDirection;