Skip to content

Commit b4c9635

Browse files
committed
Merge branch 'master' into docking
# Conflicts: # imgui.cpp
2 parents 3293ef8 + cb16568 commit b4c9635

8 files changed

+92
-38
lines changed

docs/CHANGELOG.txt

+27-3
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,20 @@ HOW TO UPDATE?
3636
- Please report any issue!
3737

3838
-----------------------------------------------------------------------
39-
VERSION 1.91.3 WIP (In Progress)
39+
VERSION 1.91.3 (Released 2024-10-04)
4040
-----------------------------------------------------------------------
4141

42+
Decorated log and release notes: https://github.com/ocornut/imgui/releases/tag/v1.91.3
43+
4244
Breaking changes:
4345

46+
- Drags: treat v_min==v_max as a valid clamping range when != 0.0f. Zero is still a special
47+
value due to legacy reasons, unless using ImGuiSliderFlags_ClampZeroRange. (#7968, #3361, #76)
48+
- Drags: extended behavior of ImGuiSliderFlags_AlwaysClamp to include _ClampZeroRange.
49+
It considers v_min==v_max==0.0f as a valid clamping range (aka edits not allowed).
50+
Although unlikely, it you wish to only clamp on text input but want v_min==v_max==0.0f
51+
to mean unclamped drags, you can use _ClampOnInput instead of _AlwaysClamp. (#7968, #3361, #76)
52+
4453
Other changes:
4554

4655
- Error Handling: Enabled/improved error recovery systems. (#1651, #5654)
@@ -54,7 +63,7 @@ Other changes:
5463
- Functions that support error recovery are using IM_ASSERT_USER_ERROR() instead of IM_ASSERT().
5564
- By design, we do not allow error recovery to be 100% silent. One of the options needs to be enabled!
5665
- Possible usage: facilitate recovery from errors triggered from a scripting language or
57-
after specific exceptions handlers. Surface errors to programmers in less agressive ways.
66+
after specific exceptions handlers. Surface errors to programmers in less aggressive ways.
5867
- Always ensure that on programmers seats you have at minimum Asserts or Tooltips enabled
5968
when making direct imgui API calls! Otherwise it would severely hinder your ability to
6069
catch and correct mistakes!
@@ -71,12 +80,19 @@ Other changes:
7180
- Scrollbar: Shift+Click scroll to clicked location (pre-1.90.8 default). (#8002, #7328)
7281
- Scrollbar: added io.ConfigScrollbarScrollByPage setting (default to true). (#8002, #7328)
7382
Set io.ConfigScrollbarScrollByPage=false to enforce always scrolling to clicked location.
83+
- Drags: split ImGuiSliderFlags_AlwaysClamp into two distinct flags: (#7968, #3361, #76)
84+
- ImGuiSliderFlags_AlwaysClamp = ImGuiSliderFlags_ClampOnInput + ImGuiSliderFlags_ClampZeroRange.
85+
- Previously _AlwaysClamp only did the equivalent of _ClampOnInput.
86+
- Added ImGuiSliderFlags_ClampOnInput which is now a subset of AlwaysClamp.
87+
(note that it was the old name of AlwaysClamp, but we are reintroducing that name).
88+
- Added ImGuiSliderFlags_ClampZeroRange to enforce clamping even when v_min==v_max==0.0f
89+
in drag functions. Sliders are not affected.
7490
- Tooltips, Drag and Drop: Fixed an issue where the fallback drag and drop payload tooltip
7591
appeared during drag and drop release.
7692
- Tooltips, Drag and Drop: Stabilized name of drag and drop tooltip window so that
7793
transitioning from an item tooltip to a drag tooltip doesn't leak window auto-sizing
7894
info from one to the other. (#8036)
79-
- Tooltips: Tooltips triggered from touch inputs are positionned above the item. (#8036)
95+
- Tooltips: Tooltips triggered from touch inputs are positioned above the item. (#8036)
8096
- Backends: SDL3: Update for API changes: SDL_bool removal. SDL_INIT_TIMER removal.
8197
- Backends: WebGPU: Fixed DAWN api change using WGPUStringView in WGPUShaderSourceWGSL.
8298
(#8009, #8010) [@blitz-research]
@@ -94,6 +110,14 @@ Docking+Viewports Branch:
94110

95111
Decorated log and release notes: https://github.com/ocornut/imgui/releases/tag/v1.91.2
96112

113+
Breaking changes:
114+
115+
- Internals: using multiple overlayed ButtonBehavior() with same ID will now have the
116+
io.ConfigDebugHighlightIdConflicts=true feature emit a warning. (#8030)
117+
It was one of the rare case where using same ID is legal. Workarounds:
118+
- use single ButtonBehavior() call with multiple _MouseButton flags
119+
- or surround the calls with PushItemFlag(ImGuiItemFlags_AllowDuplicateId, true); ... PopItemFlag()
120+
97121
Other changes:
98122

99123
- Added io.ConfigDebugHighlightIdConflicts debug feature! (#7961, #7669)

imgui.cpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.91.3 WIP
1+
// dear imgui, v1.91.3
22
// (main code and documentation)
33

44
// Help:
@@ -438,6 +438,11 @@ CODE
438438
- likewise io.MousePos and GetMousePos() will use OS coordinates.
439439
If you query mouse positions to interact with non-imgui coordinates you will need to offset them, e.g. subtract GetWindowViewport()->Pos.
440440

441+
- 2024/10/03 (1.91.3) - drags: treat v_min==v_max as a valid clamping range when != 0.0f. Zero is a still special value due to legacy reasons, unless using ImGuiSliderFlags_ClampZeroRange. (#7968, #3361, #76)
442+
- drags: extended behavior of ImGuiSliderFlags_AlwaysClamp to include _ClampZeroRange. It considers v_min==v_max==0.0f as a valid clamping range (aka edits not allowed).
443+
although unlikely, it you wish to only clamp on text input but want v_min==v_max==0.0f to mean unclamped drags, you can use _ClampOnInput instead of _AlwaysClamp. (#7968, #3361, #76)
444+
- 2024/09/10 (1.91.2) - internals: using multiple overlayed ButtonBehavior() with same ID will now have io.ConfigDebugHighlightIdConflicts=true feature emit a warning. (#8030)
445+
it was one of the rare case where using same ID is legal. workarounds: (1) use single ButtonBehavior() call with multiple _MouseButton flags, or (2) surround the calls with PushItemFlag(ImGuiItemFlags_AllowDuplicateId, true); ... PopItemFlag()
441446
- 2024/08/23 (1.91.1) - renamed ImGuiChildFlags_Border to ImGuiChildFlags_Borders for consistency. kept inline redirection flag.
442447
- 2024/08/22 (1.91.1) - moved some functions from ImGuiIO to ImGuiPlatformIO structure:
443448
- io.GetClipboardTextFn -> platform_io.Platform_GetClipboardTextFn + changed 'void* user_data' to 'ImGuiContext* ctx'. Pull your user data from platform_io.ClipboardUserData.
@@ -11330,9 +11335,10 @@ void ImGui::ErrorCheckEndFrameFinalizeErrorTooltip()
1133011335
Text("Programmer error: %d visible items with conflicting ID!", g.DebugDrawIdConflictsCount);
1133111336
BulletText("Code should use PushID()/PopID() in loops, or append \"##xx\" to same-label identifiers!");
1133211337
BulletText("Empty label e.g. Button(\"\") == same ID as parent widget/node. Use Button(\"##xx\") instead!");
11338+
//BulletText("Code intending to use duplicate ID may use e.g. PushItemFlag(ImGuiItemFlags_AllowDuplicateId, true); ... PopItemFlag()"); // Not making this too visible for fear of it being abused.
1133311339
BulletText("Set io.ConfigDebugDetectIdConflicts=false to disable this warning in non-programmers builds.");
1133411340
Separator();
11335-
Text("(Hold CTRL and: use");
11341+
Text("(Hold CTRL to: use");
1133611342
SameLine();
1133711343
if (SmallButton("Item Picker"))
1133811344
DebugStartItemPicker();
@@ -11347,7 +11353,7 @@ void ImGui::ErrorCheckEndFrameFinalizeErrorTooltip()
1134711353
if (g.ErrorCountCurrentFrame > 0 && BeginErrorTooltip()) // Amend at end of frame
1134811354
{
1134911355
Separator();
11350-
Text("(Hold CTRL and:");
11356+
Text("(Hold CTRL to:");
1135111357
SameLine();
1135211358
if (SmallButton("Enable Asserts"))
1135311359
g.IO.ConfigErrorRecoveryEnableAssert = true;

imgui.h

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.91.3 WIP
1+
// dear imgui, v1.91.3
22
// (headers)
33

44
// Help:
@@ -28,8 +28,8 @@
2828

2929
// Library Version
3030
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
31-
#define IMGUI_VERSION "1.91.3 WIP"
32-
#define IMGUI_VERSION_NUM 19124
31+
#define IMGUI_VERSION "1.91.3"
32+
#define IMGUI_VERSION_NUM 19130
3333
#define IMGUI_HAS_TABLE
3434
#define IMGUI_HAS_VIEWPORT // Viewport WIP branch
3535
#define IMGUI_HAS_DOCK // Docking WIP branch
@@ -1865,19 +1865,18 @@ enum ImGuiColorEditFlags_
18651865

18661866
// Flags for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc.
18671867
// We use the same sets of flags for DragXXX() and SliderXXX() functions as the features are the same and it makes it easier to swap them.
1868-
// (Those are per-item flags. There are shared flags in ImGuiIO: io.ConfigDragClickToInputText)
1868+
// (Those are per-item flags. There is shared behavior flag too: ImGuiIO: io.ConfigDragClickToInputText)
18691869
enum ImGuiSliderFlags_
18701870
{
1871-
ImGuiSliderFlags_None = 0,
1872-
ImGuiSliderFlags_AlwaysClamp = 1 << 4, // Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.
1873-
ImGuiSliderFlags_Logarithmic = 1 << 5, // Make the widget logarithmic (linear otherwise). Consider using ImGuiSliderFlags_NoRoundToFormat with this if using a format-string with small amount of digits.
1874-
ImGuiSliderFlags_NoRoundToFormat = 1 << 6, // Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits).
1875-
ImGuiSliderFlags_NoInput = 1 << 7, // Disable CTRL+Click or Enter key allowing to input text directly into the widget.
1876-
ImGuiSliderFlags_WrapAround = 1 << 8, // Enable wrapping around from max to min and from min to max (only supported by DragXXX() functions for now.
1877-
ImGuiSliderFlags_InvalidMask_ = 0x7000000F, // [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast to this enum, and will trigger an assert if needed.
1878-
1879-
// Obsolete names
1880-
//ImGuiSliderFlags_ClampOnInput = ImGuiSliderFlags_AlwaysClamp, // [renamed in 1.79]
1871+
ImGuiSliderFlags_None = 0,
1872+
ImGuiSliderFlags_Logarithmic = 1 << 5, // Make the widget logarithmic (linear otherwise). Consider using ImGuiSliderFlags_NoRoundToFormat with this if using a format-string with small amount of digits.
1873+
ImGuiSliderFlags_NoRoundToFormat = 1 << 6, // Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits).
1874+
ImGuiSliderFlags_NoInput = 1 << 7, // Disable CTRL+Click or Enter key allowing to input text directly into the widget.
1875+
ImGuiSliderFlags_WrapAround = 1 << 8, // Enable wrapping around from max to min and from min to max. Only supported by DragXXX() functions for now.
1876+
ImGuiSliderFlags_ClampOnInput = 1 << 9, // Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.
1877+
ImGuiSliderFlags_ClampZeroRange = 1 << 10, // Clamp even if min==max==0.0f. Otherwise due to legacy reason DragXXX functions don't clamp with those values. When your clamping limits are dynamic you almost always want to use it.
1878+
ImGuiSliderFlags_AlwaysClamp = ImGuiSliderFlags_ClampOnInput | ImGuiSliderFlags_ClampZeroRange,
1879+
ImGuiSliderFlags_InvalidMask_ = 0x7000000F, // [Internal] We treat using those bits as being potentially a 'float power' argument from the previous API that has got miscast to this enum, and will trigger an assert if needed.
18811880
};
18821881

18831882
// Identify a mouse button.
@@ -3285,8 +3284,8 @@ struct ImDrawList
32853284
//inline void AddEllipse(const ImVec2& center, float radius_x, float radius_y, ImU32 col, float rot = 0.0f, int num_segments = 0, float thickness = 1.0f) { AddEllipse(center, ImVec2(radius_x, radius_y), col, rot, num_segments, thickness); } // OBSOLETED in 1.90.5 (Mar 2024)
32863285
//inline void AddEllipseFilled(const ImVec2& center, float radius_x, float radius_y, ImU32 col, float rot = 0.0f, int num_segments = 0) { AddEllipseFilled(center, ImVec2(radius_x, radius_y), col, rot, num_segments); } // OBSOLETED in 1.90.5 (Mar 2024)
32873286
//inline void PathEllipticalArcTo(const ImVec2& center, float radius_x, float radius_y, float rot, float a_min, float a_max, int num_segments = 0) { PathEllipticalArcTo(center, ImVec2(radius_x, radius_y), rot, a_min, a_max, num_segments); } // OBSOLETED in 1.90.5 (Mar 2024)
3288-
//inline void AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0) { AddBezierCubic(p1, p2, p3, p4, col, thickness, num_segments); } // OBSOLETED in 1.80 (Jan 2021)
3289-
//inline void PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0) { PathBezierCubicCurveTo(p2, p3, p4, num_segments); } // OBSOLETED in 1.80 (Jan 2021)
3287+
//inline void AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0) { AddBezierCubic(p1, p2, p3, p4, col, thickness, num_segments); } // OBSOLETED in 1.80 (Jan 2021)
3288+
//inline void PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0) { PathBezierCubicCurveTo(p2, p3, p4, num_segments); } // OBSOLETED in 1.80 (Jan 2021)
32903289

32913290
// [Internal helpers]
32923291
IMGUI_API void _ResetForNewFrame();

imgui_demo.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.91.3 WIP
1+
// dear imgui, v1.91.3
22
// (demo code)
33

44
// Help:
@@ -2325,7 +2325,10 @@ static void ShowDemoWindowWidgets(ImGuiDemoWindowData* demo_data)
23252325
// Demonstrate using advanced flags for DragXXX and SliderXXX functions. Note that the flags are the same!
23262326
static ImGuiSliderFlags flags = ImGuiSliderFlags_None;
23272327
ImGui::CheckboxFlags("ImGuiSliderFlags_AlwaysClamp", &flags, ImGuiSliderFlags_AlwaysClamp);
2328-
ImGui::SameLine(); HelpMarker("Always clamp value to min/max bounds (if any) when input manually with CTRL+Click.");
2328+
ImGui::CheckboxFlags("ImGuiSliderFlags_ClampOnInput", &flags, ImGuiSliderFlags_ClampOnInput);
2329+
ImGui::SameLine(); HelpMarker("Clamp value to min/max bounds when input manually with CTRL+Click. By default CTRL+Click allows going out of bounds.");
2330+
ImGui::CheckboxFlags("ImGuiSliderFlags_ClampZeroRange", &flags, ImGuiSliderFlags_ClampZeroRange);
2331+
ImGui::SameLine(); HelpMarker("Clamp even if min==max==0.0f. Otherwise DragXXX functions don't clamp.");
23292332
ImGui::CheckboxFlags("ImGuiSliderFlags_Logarithmic", &flags, ImGuiSliderFlags_Logarithmic);
23302333
ImGui::SameLine(); HelpMarker("Enable logarithmic editing (more precision for small values).");
23312334
ImGui::CheckboxFlags("ImGuiSliderFlags_NoRoundToFormat", &flags, ImGuiSliderFlags_NoRoundToFormat);
@@ -2343,6 +2346,8 @@ static void ShowDemoWindowWidgets(ImGuiDemoWindowData* demo_data)
23432346
ImGui::DragFloat("DragFloat (0 -> +inf)", &drag_f, 0.005f, 0.0f, FLT_MAX, "%.3f", flags);
23442347
ImGui::DragFloat("DragFloat (-inf -> 1)", &drag_f, 0.005f, -FLT_MAX, 1.0f, "%.3f", flags);
23452348
ImGui::DragFloat("DragFloat (-inf -> +inf)", &drag_f, 0.005f, -FLT_MAX, +FLT_MAX, "%.3f", flags);
2349+
//ImGui::DragFloat("DragFloat (0 -> 0)", &drag_f, 0.005f, 0.0f, 0.0f, "%.3f", flags); // To test ClampZeroRange
2350+
//ImGui::DragFloat("DragFloat (100 -> 100)", &drag_f, 0.005f, 100.0f, 100.0f, "%.3f", flags);
23462351
ImGui::DragInt("DragInt (0 -> 100)", &drag_i, 0.5f, 0, 100, "%d", flags);
23472352

23482353
// Sliders

imgui_draw.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.91.3 WIP
1+
// dear imgui, v1.91.3
22
// (drawing and font code)
33

44
/*

imgui_internal.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.91.3 WIP
1+
// dear imgui, v1.91.3
22
// (internal structures/api)
33

44
// You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility.
@@ -3701,6 +3701,7 @@ namespace ImGui
37013701
IMGUI_API bool DataTypeApplyFromText(const char* buf, ImGuiDataType data_type, void* p_data, const char* format, void* p_data_when_empty = NULL);
37023702
IMGUI_API int DataTypeCompare(ImGuiDataType data_type, const void* arg_1, const void* arg_2);
37033703
IMGUI_API bool DataTypeClamp(ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max);
3704+
IMGUI_API bool DataTypeIsZero(ImGuiDataType data_type, const void* p_data);
37043705

37053706
// InputText
37063707
IMGUI_API bool InputTextEx(const char* label, const char* hint, char* buf, int buf_size, const ImVec2& size_arg, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);

imgui_tables.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.91.3 WIP
1+
// dear imgui, v1.91.3
22
// (tables and columns code)
33

44
/*

0 commit comments

Comments
 (0)