From 2e26196aba66dc0fa304043764aa6f6499beee0f Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 26 Mar 2015 21:13:03 +0000 Subject: [PATCH] Selectable() fixed misuage of GetContentRegionMax().x --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index b179ed92ac14..b6119acfc224 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -6603,7 +6603,7 @@ bool ImGui::Selectable(const char* label, bool selected, const ImVec2& size_arg) const ImGuiID id = window->GetID(label); const ImVec2 label_size = CalcTextSize(label, NULL, true); - const float w = ImMax(label_size.x, window->Pos.x + ImGui::GetContentRegionMax().x - window->DC.CursorPos.x); + const float w = ImMax(label_size.x, window->Pos.x + ImGui::GetContentRegionMax().x - style.AutoFitPadding.x - window->DC.CursorPos.x); const ImVec2 size(size_arg.x != 0.0f ? size_arg.x : w, size_arg.y != 0.0f ? size_arg.y : label_size.y); const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size); ItemSize(bb);