Browse Source

BeginGroup(): Fixed a bug pushing line lower extent too far down when called after a call to SameLine() followed by manual cursor manipulation.

ocornut 1 year ago
parent
commit
9ece0bdc02
3 changed files with 5 additions and 0 deletions
  1. 2 0
      docs/CHANGELOG.txt
  2. 2 0
      imgui.cpp
  3. 1 0
      imgui_internal.h

+ 2 - 0
docs/CHANGELOG.txt

@@ -93,6 +93,8 @@ Other changes:
   (regression from 1.89.2, only happened in some states). (#6783, #6000)
   (regression from 1.89.2, only happened in some states). (#6783, #6000)
 - InputTextMultiline: Fixed Tabbing cycle leading to a situation where Enter key wouldn't
 - InputTextMultiline: Fixed Tabbing cycle leading to a situation where Enter key wouldn't
   be accepted by the widget when navigation highlight is visible. (#6802, #3092, #5759, #787)
   be accepted by the widget when navigation highlight is visible. (#6802, #3092, #5759, #787)
+- BeginGroup(): Fixed a bug pushing line lower extent too far down when called after a call
+  to SameLine() followed by manual cursor manipulation.
 - BeginListBox(): Fixed not consuming SetNextWindowXXX data when returning false.
 - BeginListBox(): Fixed not consuming SetNextWindowXXX data when returning false.
 - MenuBar: Fixed an issue where layouting an item in the menu-bar would erroneously
 - MenuBar: Fixed an issue where layouting an item in the menu-bar would erroneously
   register contents size in a way that would affect the scrolling layer.
   register contents size in a way that would affect the scrolling layer.

+ 2 - 0
imgui.cpp

@@ -9854,6 +9854,7 @@ void ImGui::BeginGroup()
     group_data.BackupCurrLineTextBaseOffset = window->DC.CurrLineTextBaseOffset;
     group_data.BackupCurrLineTextBaseOffset = window->DC.CurrLineTextBaseOffset;
     group_data.BackupActiveIdIsAlive = g.ActiveIdIsAlive;
     group_data.BackupActiveIdIsAlive = g.ActiveIdIsAlive;
     group_data.BackupHoveredIdIsAlive = g.HoveredId != 0;
     group_data.BackupHoveredIdIsAlive = g.HoveredId != 0;
+    group_data.BackupIsSameLine = window->DC.IsSameLine;
     group_data.BackupActiveIdPreviousFrameIsAlive = g.ActiveIdPreviousFrameIsAlive;
     group_data.BackupActiveIdPreviousFrameIsAlive = g.ActiveIdPreviousFrameIsAlive;
     group_data.EmitItem = true;
     group_data.EmitItem = true;
 
 
@@ -9885,6 +9886,7 @@ void ImGui::EndGroup()
     window->DC.GroupOffset = group_data.BackupGroupOffset;
     window->DC.GroupOffset = group_data.BackupGroupOffset;
     window->DC.CurrLineSize = group_data.BackupCurrLineSize;
     window->DC.CurrLineSize = group_data.BackupCurrLineSize;
     window->DC.CurrLineTextBaseOffset = group_data.BackupCurrLineTextBaseOffset;
     window->DC.CurrLineTextBaseOffset = group_data.BackupCurrLineTextBaseOffset;
+    window->DC.IsSameLine = group_data.BackupIsSameLine;
     if (g.LogEnabled)
     if (g.LogEnabled)
         g.LogLinePosY = -FLT_MAX; // To enforce a carriage return
         g.LogLinePosY = -FLT_MAX; // To enforce a carriage return
 
 

+ 1 - 0
imgui_internal.h

@@ -1071,6 +1071,7 @@ struct IMGUI_API ImGuiGroupData
     ImGuiID     BackupActiveIdIsAlive;
     ImGuiID     BackupActiveIdIsAlive;
     bool        BackupActiveIdPreviousFrameIsAlive;
     bool        BackupActiveIdPreviousFrameIsAlive;
     bool        BackupHoveredIdIsAlive;
     bool        BackupHoveredIdIsAlive;
+    bool        BackupIsSameLine;
     bool        EmitItem;
     bool        EmitItem;
 };
 };