@@ -6943,13 +6943,9 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
6943
6943
if (size_arg.x == 0.0f || (flags & ImGuiSelectableFlags_SpanAvailWidth))
6944
6944
size.x = ImMax(label_size.x, max_x - min_x);
6945
6945
6946
- // Text stays at the submission position, but bounding box may be extended on both sides
6947
- const ImVec2 text_min = pos;
6948
- const ImVec2 text_max(min_x + size.x, pos.y + size.y);
6949
-
6950
6946
// Selectables are meant to be tightly packed together with no click-gap, so we extend their box to cover spacing between selectable.
6951
6947
// FIXME: Not part of layout so not included in clipper calculation, but ItemSize currently doesn't allow offsetting CursorPos.
6952
- ImRect bb(min_x, pos.y, text_max .x, text_max .y);
6948
+ ImRect bb(min_x, pos.y, min_x + size .x, pos.y + size .y);
6953
6949
if ((flags & ImGuiSelectableFlags_NoPadWithHalfSpacing) == 0)
6954
6950
{
6955
6951
const float spacing_x = span_all_columns ? 0.0f : style.ItemSpacing.x;
@@ -7085,8 +7081,9 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
7085
7081
PopColumnsBackground();
7086
7082
}
7087
7083
7084
+ // Text stays at the submission position. Alignment/clipping extents ignore SpanAllColumns.
7088
7085
if (is_visible)
7089
- RenderTextClipped(text_min, text_max , label, NULL, &label_size, style.SelectableTextAlign, &bb);
7086
+ RenderTextClipped(pos, ImVec2(window->WorkRect.Max.x, pos.y + size.y) , label, NULL, &label_size, style.SelectableTextAlign, &bb);
7090
7087
7091
7088
// Automatically close popups
7092
7089
if (pressed && (window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiSelectableFlags_NoAutoClosePopups) && (g.LastItemData.ItemFlags & ImGuiItemFlags_AutoClosePopups))
0 commit comments