From cef4e086ba5979987f7dbd9916291a0d20dbc4ff Mon Sep 17 00:00:00 2001 From: omar Date: Tue, 5 Feb 2019 18:10:33 +0100 Subject: [PATCH] Internals: Selectable: Fixed rendering width miscalculation when starting pos is not line start pos, which would generally be unnoticeable. Could affect group lock X with a smaller SetCursorPos value but that's unlikely to be used. --- imgui_widgets.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index f2b58c7c5..642f3e140 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -5016,7 +5016,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl // Fill horizontal space. ImVec2 window_padding = window->WindowPadding; float max_x = (flags & ImGuiSelectableFlags_SpanAllColumns) ? GetWindowContentRegionMax().x : GetContentRegionMax().x; - float w_draw = ImMax(label_size.x, window->Pos.x + max_x - window_padding.x - window->DC.CursorPos.x); + float w_draw = ImMax(label_size.x, window->Pos.x + max_x - window_padding.x - pos.x); 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); ImRect bb(pos, pos + size_draw); if (size_arg.x == 0.0f || (flags & ImGuiSelectableFlags_DrawFillAvailWidth))