mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-04 07:01:04 +01:00 
			
		
		
		
	Columns: Fixed Separator from creating an extraneous draw command. Fixed Selectable with SpanAllColumns flag from creating an extraneous draw command. (#125)
This commit is contained in:
		@@ -1216,7 +1216,7 @@ void ImGui::Separator()
 | 
			
		||||
 | 
			
		||||
    // Horizontal Separator
 | 
			
		||||
    if (window->DC.CurrentColumns)
 | 
			
		||||
        PopClipRect();
 | 
			
		||||
        PushColumnsBackground();
 | 
			
		||||
 | 
			
		||||
    float x1 = window->Pos.x;
 | 
			
		||||
    float x2 = window->Pos.x + window->Size.x;
 | 
			
		||||
@@ -1228,7 +1228,7 @@ void ImGui::Separator()
 | 
			
		||||
    if (!ItemAdd(bb, 0))
 | 
			
		||||
    {
 | 
			
		||||
        if (window->DC.CurrentColumns)
 | 
			
		||||
            PushColumnClipRect();
 | 
			
		||||
            PopColumnsBackground();
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -1239,7 +1239,7 @@ void ImGui::Separator()
 | 
			
		||||
 | 
			
		||||
    if (window->DC.CurrentColumns)
 | 
			
		||||
    {
 | 
			
		||||
        PushColumnClipRect();
 | 
			
		||||
        PopColumnsBackground();
 | 
			
		||||
        window->DC.CurrentColumns->LineMinY = window->DC.CursorPos.y;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -5311,7 +5311,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
 | 
			
		||||
    const ImGuiStyle& style = g.Style;
 | 
			
		||||
 | 
			
		||||
    if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.CurrentColumns) // FIXME-OPT: Avoid if vertically clipped.
 | 
			
		||||
        PopClipRect();
 | 
			
		||||
        PushColumnsBackground();
 | 
			
		||||
 | 
			
		||||
    ImGuiID id = window->GetID(label);
 | 
			
		||||
    ImVec2 label_size = CalcTextSize(label, NULL, true);
 | 
			
		||||
@@ -5355,7 +5355,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
 | 
			
		||||
    if (!item_add)
 | 
			
		||||
    {
 | 
			
		||||
        if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.CurrentColumns)
 | 
			
		||||
            PushColumnClipRect();
 | 
			
		||||
            PopColumnsBackground();
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -5401,7 +5401,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
 | 
			
		||||
 | 
			
		||||
    if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC.CurrentColumns)
 | 
			
		||||
    {
 | 
			
		||||
        PushColumnClipRect();
 | 
			
		||||
        PopColumnsBackground();
 | 
			
		||||
        bb.Max.x -= (GetContentRegionMax().x - max_x);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user