@@ -5580,14 +5580,14 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
5580
5580
5581
5581
// Fill horizontal space.
5582
5582
ImVec2 window_padding = window->WindowPadding ;
5583
- float max_x = (flags & ImGuiSelectableFlags_SpanAllColumns) ? GetWindowContentRegionMax ().x : GetContentRegionMax ().x ;
5584
- float w_draw = ImMax (label_size.x , window-> Pos . x + max_x - window_padding.x - pos.x );
5585
- ImVec2 size_draw ((size_arg.x != 0 && !(flags & ImGuiSelectableFlags_DrawFillAvailWidth)) ? size_arg.x : w_draw, size_arg. y != 0 . 0f ? size_arg. y : size.y );
5583
+ float max_x = (flags & ImGuiSelectableFlags_SpanAllColumns) ? GetWindowContentRegionMax ().x + window-> Pos . x : GetContentRegionMaxAbs ().x ;
5584
+ float w_draw = ImMax (label_size.x , max_x - window_padding.x - pos.x );
5585
+ ImVec2 size_draw ((size_arg.x != 0 && !(flags & ImGuiSelectableFlags_DrawFillAvailWidth)) ? size_arg.x : w_draw, size.y );
5586
5586
ImRect bb (pos, pos + size_draw);
5587
5587
if (size_arg.x == 0 .0f || (flags & ImGuiSelectableFlags_DrawFillAvailWidth))
5588
5588
bb.Max .x += window_padding.x ;
5589
5589
5590
- // Selectables are tightly packed together so we extend the box to cover spacing between selectable.
5590
+ // Selectables are meant to be tightly packed together with no click-gap, so we extend the box to cover spacing between selectable.
5591
5591
const float spacing_x = style.ItemSpacing .x ;
5592
5592
const float spacing_y = style.ItemSpacing .y ;
5593
5593
const float spacing_L = IM_FLOOR (spacing_x * 0 .50f );
@@ -5662,10 +5662,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
5662
5662
}
5663
5663
5664
5664
if ((flags & ImGuiSelectableFlags_SpanAllColumns) && window->DC .CurrentColumns )
5665
- {
5666
5665
PopColumnsBackground ();
5667
- bb.Max .x -= (GetContentRegionMax ().x - max_x);
5668
- }
5669
5666
5670
5667
if (flags & ImGuiSelectableFlags_Disabled) PushStyleColor (ImGuiCol_Text, style.Colors [ImGuiCol_TextDisabled]);
5671
5668
RenderTextClipped (bb_inner.Min , bb_inner.Max , label, NULL , &label_size, style.SelectableTextAlign , &bb);
0 commit comments