@@ -2479,11 +2479,9 @@ void ImGuiStorage::SetInt(ImGuiID key, int val)
2479
2479
{
2480
2480
ImGuiStoragePair* it = LowerBound(Data, key);
2481
2481
if (it == Data.end() || it->key != key)
2482
- {
2483
2482
Data.insert(it, ImGuiStoragePair(key, val));
2484
- return;
2485
- }
2486
- it->val_i = val;
2483
+ else
2484
+ it->val_i = val;
2487
2485
}
2488
2486
2489
2487
void ImGuiStorage::SetBool(ImGuiID key, bool val)
@@ -2495,22 +2493,18 @@ void ImGuiStorage::SetFloat(ImGuiID key, float val)
2495
2493
{
2496
2494
ImGuiStoragePair* it = LowerBound(Data, key);
2497
2495
if (it == Data.end() || it->key != key)
2498
- {
2499
2496
Data.insert(it, ImGuiStoragePair(key, val));
2500
- return;
2501
- }
2502
- it->val_f = val;
2497
+ else
2498
+ it->val_f = val;
2503
2499
}
2504
2500
2505
2501
void ImGuiStorage::SetVoidPtr(ImGuiID key, void* val)
2506
2502
{
2507
2503
ImGuiStoragePair* it = LowerBound(Data, key);
2508
2504
if (it == Data.end() || it->key != key)
2509
- {
2510
2505
Data.insert(it, ImGuiStoragePair(key, val));
2511
- return;
2512
- }
2513
- it->val_p = val;
2506
+ else
2507
+ it->val_p = val;
2514
2508
}
2515
2509
2516
2510
void ImGuiStorage::SetAllInt(int v)
@@ -5420,11 +5414,22 @@ ImVec2 ImGui::GetItemRectSize()
5420
5414
return g.LastItemData.Rect.GetSize();
5421
5415
}
5422
5416
5417
+ bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags)
5418
+ {
5419
+ ImGuiWindow* window = GetCurrentWindow();
5420
+ return BeginChildEx(str_id, window->GetID(str_id), size_arg, border, extra_flags);
5421
+ }
5422
+
5423
+ bool ImGui::BeginChild(ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags)
5424
+ {
5425
+ IM_ASSERT(id != 0);
5426
+ return BeginChildEx(NULL, id, size_arg, border, extra_flags);
5427
+ }
5428
+
5423
5429
bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags flags)
5424
5430
{
5425
5431
ImGuiContext& g = *GImGui;
5426
5432
ImGuiWindow* parent_window = g.CurrentWindow;
5427
-
5428
5433
flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_ChildWindow;
5429
5434
flags |= (parent_window->Flags & ImGuiWindowFlags_NoMove); // Inherit the NoMove flag
5430
5435
@@ -5473,18 +5478,6 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b
5473
5478
return ret;
5474
5479
}
5475
5480
5476
- bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags)
5477
- {
5478
- ImGuiWindow* window = GetCurrentWindow();
5479
- return BeginChildEx(str_id, window->GetID(str_id), size_arg, border, extra_flags);
5480
- }
5481
-
5482
- bool ImGui::BeginChild(ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags)
5483
- {
5484
- IM_ASSERT(id != 0);
5485
- return BeginChildEx(NULL, id, size_arg, border, extra_flags);
5486
- }
5487
-
5488
5481
void ImGui::EndChild()
5489
5482
{
5490
5483
ImGuiContext& g = *GImGui;
0 commit comments