diff --git a/backends/ui/imgui/RendererBackend.cpp b/backends/ui/imgui/RendererBackend.cpp index 4063f8a..bca0d1f 100644 --- a/backends/ui/imgui/RendererBackend.cpp +++ b/backends/ui/imgui/RendererBackend.cpp @@ -508,11 +508,11 @@ void RendererBackend::EndMainMenuBar() { float padding = ImGui::GetStyle().FramePadding.x; float spacing = ImGui::GetStyle().ItemSpacing.x; for (size_t i = 0; i < titlebar_btn_count; i++) { - tmp += padding; + tmp -= padding; // No need to use the correct index, as long as this is hit only once. - if (i == 0) tmp += spacing / 2; - else tmp += spacing; - tmp += ImGui::CalcTextSize(titlebar_icons[i]).x; + if (i == 0) tmp -= spacing / 2.0f; + else tmp -= spacing; + tmp -= ImGui::CalcTextSize(titlebar_icons[i]).x; } title_btn_start = std::ceil(tmp); ImGui::SetCursorPosX(title_btn_start);