From 027861074c3e73aaeaec231e38fd3b03eb1dc50c Mon Sep 17 00:00:00 2001 From: Seth Kingsley Date: Wed, 14 Nov 2018 01:57:55 -0800 Subject: [PATCH] BeginGroup() and Tooltip don't have return values --- misc/cpp/extract_scoped.rb | 5 ++++- misc/cpp/imgui_scoped.h | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/misc/cpp/extract_scoped.rb b/misc/cpp/extract_scoped.rb index 48a7277c7..5422036b0 100644 --- a/misc/cpp/extract_scoped.rb +++ b/misc/cpp/extract_scoped.rb @@ -60,7 +60,10 @@ EOT when 'BeginChild' then 'ImGui::EndChild();' when 'BeginChildFrame' then 'ImGui::EndChildFrame();' when /^BeginPopup/ then "if (#{@state_var}) ImGui::EndPopup();" - when /^Begin(.*)/ then "if (#{@state_var}) ImGui::End#{$1}();" + when /^Begin(.*)/ + body = "ImGui::End#{$1}();" + body = "if (#{@state_var}) " + body if @state_var + body when /^TreeNode/ then "if (#{@state_var}) ImGui::TreePop();" when 'TreePush' then 'ImGui::TreePop();' when /^Push(.*)/ then "ImGui::Pop#{$1}();" diff --git a/misc/cpp/imgui_scoped.h b/misc/cpp/imgui_scoped.h index 4e7eb6cea..163fb301d 100644 --- a/misc/cpp/imgui_scoped.h +++ b/misc/cpp/imgui_scoped.h @@ -96,7 +96,7 @@ namespace ImScoped struct Group { Group() { ImGui::BeginGroup(); } - ~Group() { if () ImGui::EndGroup(); } + ~Group() { ImGui::EndGroup(); } IMGUI_DELETE_MOVE_COPY(Group); }; @@ -217,7 +217,7 @@ namespace ImScoped struct Tooltip { Tooltip() { ImGui::BeginTooltip(); } - ~Tooltip() { if () ImGui::EndTooltip(); } + ~Tooltip() { ImGui::EndTooltip(); } IMGUI_DELETE_MOVE_COPY(Tooltip); };