Fix using addition instead of subtraction for right alignment of titlebar buttons.
Some checks failed
Build / build-deb (push) Blocked by required conditions
Build / build-appimage (push) Blocked by required conditions
Build / build-android (push) Blocked by required conditions
Build / build-windows (push) Blocked by required conditions
Build / build-gentoo (push) Successful in 2m15s
Build / download-system-deps (push) Successful in 5m49s
Build / get-source-code (push) Has been cancelled

This commit is contained in:
Zachary Hall 2025-01-15 12:45:17 -08:00
parent 553e8b58a5
commit 152ee66a04

View file

@ -508,11 +508,11 @@ void RendererBackend::EndMainMenuBar() {
float padding = ImGui::GetStyle().FramePadding.x; float padding = ImGui::GetStyle().FramePadding.x;
float spacing = ImGui::GetStyle().ItemSpacing.x; float spacing = ImGui::GetStyle().ItemSpacing.x;
for (size_t i = 0; i < titlebar_btn_count; i++) { 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. // No need to use the correct index, as long as this is hit only once.
if (i == 0) tmp += spacing / 2; if (i == 0) tmp -= spacing / 2.0f;
else tmp += spacing; else tmp -= spacing;
tmp += ImGui::CalcTextSize(titlebar_icons[i]).x; tmp -= ImGui::CalcTextSize(titlebar_icons[i]).x;
} }
title_btn_start = std::ceil(tmp); title_btn_start = std::ceil(tmp);
ImGui::SetCursorPosX(title_btn_start); ImGui::SetCursorPosX(title_btn_start);