Columns: Fixed another form of shearing made visible by the PreserveWidth option. The code was initially added in c46d5634d4 to fix because we've fixed in e42aaede42eb6d8a47cf104f3afd6057b13a61ee. (#913, #125)

docking
omar 8 years ago
parent 1c83b073c6
commit 7ff1c149b5

@ -9958,17 +9958,19 @@ static float GetDraggedColumnOffset(int column_index)
float ImGui::GetColumnOffset(int column_index) float ImGui::GetColumnOffset(int column_index)
{ {
ImGuiContext& g = *GImGui;
ImGuiWindow* window = GetCurrentWindowRead(); ImGuiWindow* window = GetCurrentWindowRead();
if (column_index < 0) if (column_index < 0)
column_index = window->DC.ColumnsCurrent; column_index = window->DC.ColumnsCurrent;
/*
if (g.ActiveId) if (g.ActiveId)
{ {
ImGuiContext& g = *GImGui;
const ImGuiID column_id = window->DC.ColumnsSetId + ImGuiID(column_index); const ImGuiID column_id = window->DC.ColumnsSetId + ImGuiID(column_index);
if (g.ActiveId == column_id) if (g.ActiveId == column_id)
return GetDraggedColumnOffset(column_index); return GetDraggedColumnOffset(column_index);
} }
*/
IM_ASSERT(column_index < window->DC.ColumnsData.Size); IM_ASSERT(column_index < window->DC.ColumnsData.Size);
const float t = window->DC.ColumnsData[column_index].OffsetNorm; const float t = window->DC.ColumnsData[column_index].OffsetNorm;
@ -10148,6 +10150,7 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
EndColumns(); EndColumns();
ImGuiColumnsFlags flags = (border ? 0 : ImGuiColumnsFlags_NoBorder); ImGuiColumnsFlags flags = (border ? 0 : ImGuiColumnsFlags_NoBorder);
//flags |= ImGuiColumnsFlags_NoPreserveWidths | ImGuiColumnsFlags_NoForceWithinWindow; // NB: Legacy behavior
if (columns_count != 1) if (columns_count != 1)
BeginColumns(id, columns_count, flags); BeginColumns(id, columns_count, flags);
} }

Loading…
Cancel
Save