Skip to content

Commit

Permalink
Columns: Fixed another form of shearing made visible by the PreserveW…
Browse files Browse the repository at this point in the history
…idth option. The code was initially added in c46d563 to fix because we've fixed in e42aaede42eb6d8a47cf104f3afd6057b13a61ee. (#913, #125)
  • Loading branch information
ocornut committed Aug 20, 2017
1 parent 1c83b07 commit 7ff1c14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9958,17 +9958,19 @@ static float GetDraggedColumnOffset(int column_index)

float ImGui::GetColumnOffset(int column_index)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = GetCurrentWindowRead();
if (column_index < 0)
column_index = window->DC.ColumnsCurrent;

/*
if (g.ActiveId)
{
ImGuiContext& g = *GImGui;
const ImGuiID column_id = window->DC.ColumnsSetId + ImGuiID(column_index);
if (g.ActiveId == column_id)
return GetDraggedColumnOffset(column_index);
}
*/

IM_ASSERT(column_index < window->DC.ColumnsData.Size);
const float t = window->DC.ColumnsData[column_index].OffsetNorm;
Expand Down Expand Up @@ -10148,6 +10150,7 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
EndColumns();

ImGuiColumnsFlags flags = (border ? 0 : ImGuiColumnsFlags_NoBorder);
//flags |= ImGuiColumnsFlags_NoPreserveWidths | ImGuiColumnsFlags_NoForceWithinWindow; // NB: Legacy behavior
if (columns_count != 1)
BeginColumns(id, columns_count, flags);
}
Expand Down

0 comments on commit 7ff1c14

Please sign in to comment.