|
@@ -6943,13 +6943,9 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
|
|
|
if (size_arg.x == 0.0f || (flags & ImGuiSelectableFlags_SpanAvailWidth))
|
|
|
size.x = ImMax(label_size.x, max_x - min_x);
|
|
|
|
|
|
- // Text stays at the submission position, but bounding box may be extended on both sides
|
|
|
- const ImVec2 text_min = pos;
|
|
|
- const ImVec2 text_max(min_x + size.x, pos.y + size.y);
|
|
|
-
|
|
|
// Selectables are meant to be tightly packed together with no click-gap, so we extend their box to cover spacing between selectable.
|
|
|
// FIXME: Not part of layout so not included in clipper calculation, but ItemSize currently doesn't allow offsetting CursorPos.
|
|
|
- ImRect bb(min_x, pos.y, text_max.x, text_max.y);
|
|
|
+ ImRect bb(min_x, pos.y, min_x + size.x, pos.y + size.y);
|
|
|
if ((flags & ImGuiSelectableFlags_NoPadWithHalfSpacing) == 0)
|
|
|
{
|
|
|
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
|
|
|
PopColumnsBackground();
|
|
|
}
|
|
|
|
|
|
+ // Text stays at the submission position. Alignment/clipping extents ignore SpanAllColumns.
|
|
|
if (is_visible)
|
|
|
- RenderTextClipped(text_min, text_max, label, NULL, &label_size, style.SelectableTextAlign, &bb);
|
|
|
+ RenderTextClipped(pos, ImVec2(window->WorkRect.Max.x, pos.y + size.y), label, NULL, &label_size, style.SelectableTextAlign, &bb);
|
|
|
|
|
|
// Automatically close popups
|
|
|
if (pressed && (window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiSelectableFlags_NoAutoClosePopups) && (g.LastItemData.ItemFlags & ImGuiItemFlags_AutoClosePopups))
|