mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-03 22:51:06 +01:00 
			
		
		
		
	Columns: Fixed calling Columns() again with the same number of columns. (#125)
This commit is contained in:
		
							
								
								
									
										10
									
								
								imgui.cpp
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								imgui.cpp
									
									
									
									
									
								
							@@ -12705,11 +12705,15 @@ void ImGui::Columns(int columns_count, const char* id, bool border)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    ImGuiWindow* window = GetCurrentWindow();
 | 
					    ImGuiWindow* window = GetCurrentWindow();
 | 
				
			||||||
    IM_ASSERT(columns_count >= 1);
 | 
					    IM_ASSERT(columns_count >= 1);
 | 
				
			||||||
    if (window->DC.ColumnsSet != NULL && window->DC.ColumnsSet->Count != columns_count)
 | 
					
 | 
				
			||||||
        EndColumns();
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
    ImGuiColumnsFlags flags = (border ? 0 : ImGuiColumnsFlags_NoBorder);
 | 
					    ImGuiColumnsFlags flags = (border ? 0 : ImGuiColumnsFlags_NoBorder);
 | 
				
			||||||
    //flags |= ImGuiColumnsFlags_NoPreserveWidths; // NB: Legacy behavior
 | 
					    //flags |= ImGuiColumnsFlags_NoPreserveWidths; // NB: Legacy behavior
 | 
				
			||||||
 | 
					    if (window->DC.ColumnsSet != NULL && window->DC.ColumnsSet->Count == columns_count && window->DC.ColumnsSet->Flags == flags)
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (window->DC.ColumnsSet != NULL)
 | 
				
			||||||
 | 
					        EndColumns();
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    if (columns_count != 1)
 | 
					    if (columns_count != 1)
 | 
				
			||||||
        BeginColumns(id, columns_count, flags);
 | 
					        BeginColumns(id, columns_count, flags);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user