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

This commit is contained in:
ocornut
2023-09-26 21:07:25 +02:00
parent 8175a47881
commit 9ece0bdc02
3 changed files with 5 additions and 0 deletions

View File

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