Fixed EndGroup() not restoring offset properly. breaking SameLine() offset (caused by 954c890c67) (#829)

docking
ocornut 8 years ago
parent 612b17ef57
commit b397fb507e

@ -9142,6 +9142,7 @@ void ImGui::BeginGroup()
group_data.BackupCursorPos = window->DC.CursorPos; group_data.BackupCursorPos = window->DC.CursorPos;
group_data.BackupCursorMaxPos = window->DC.CursorMaxPos; group_data.BackupCursorMaxPos = window->DC.CursorMaxPos;
group_data.BackupIndentX = window->DC.IndentX; group_data.BackupIndentX = window->DC.IndentX;
group_data.BackupGroupOffsetX = window->DC.GroupOffsetX;
group_data.BackupCurrentLineHeight = window->DC.CurrentLineHeight; group_data.BackupCurrentLineHeight = window->DC.CurrentLineHeight;
group_data.BackupCurrentLineTextBaseOffset = window->DC.CurrentLineTextBaseOffset; group_data.BackupCurrentLineTextBaseOffset = window->DC.CurrentLineTextBaseOffset;
group_data.BackupLogLinePosY = window->DC.LogLinePosY; group_data.BackupLogLinePosY = window->DC.LogLinePosY;
@ -9172,7 +9173,7 @@ void ImGui::EndGroup()
window->DC.CurrentLineHeight = group_data.BackupCurrentLineHeight; window->DC.CurrentLineHeight = group_data.BackupCurrentLineHeight;
window->DC.CurrentLineTextBaseOffset = group_data.BackupCurrentLineTextBaseOffset; window->DC.CurrentLineTextBaseOffset = group_data.BackupCurrentLineTextBaseOffset;
window->DC.IndentX = group_data.BackupIndentX; window->DC.IndentX = group_data.BackupIndentX;
window->DC.GroupOffsetX = window->DC.IndentX; window->DC.GroupOffsetX = group_data.BackupGroupOffsetX;
window->DC.LogLinePosY = window->DC.CursorPos.y - 9999.0f; window->DC.LogLinePosY = window->DC.CursorPos.y - 9999.0f;
if (group_data.AdvanceCursor) if (group_data.AdvanceCursor)

@ -257,6 +257,7 @@ struct ImGuiGroupData
ImVec2 BackupCursorPos; ImVec2 BackupCursorPos;
ImVec2 BackupCursorMaxPos; ImVec2 BackupCursorMaxPos;
float BackupIndentX; float BackupIndentX;
float BackupGroupOffsetX;
float BackupCurrentLineHeight; float BackupCurrentLineHeight;
float BackupCurrentLineTextBaseOffset; float BackupCurrentLineTextBaseOffset;
float BackupLogLinePosY; float BackupLogLinePosY;

Loading…
Cancel
Save