From d948341536a9c757dc0b637bc318624959e90248 Mon Sep 17 00:00:00 2001 From: lightmanLP <50497969+lightmanLP@users.noreply.github.com> Date: Wed, 18 Dec 2024 09:55:06 +0000 Subject: [PATCH] clang-format --- src/graphic/Fast3D/Fast3dWindow.cpp | 5 +++-- src/window/gui/Gui.cpp | 16 ++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/graphic/Fast3D/Fast3dWindow.cpp b/src/graphic/Fast3D/Fast3dWindow.cpp index 28c86279f..0cee39af6 100644 --- a/src/graphic/Fast3D/Fast3dWindow.cpp +++ b/src/graphic/Fast3D/Fast3dWindow.cpp @@ -270,7 +270,8 @@ bool Fast3dWindow::KeyUp(int32_t scancode) { Ship::Context::GetInstance()->GetWindow()->ToggleFullscreen(); } - if (scancode == Ship::Context::GetInstance()->GetConfig()->GetInt("Shortcuts.MouseCapture", Ship::KbScancode::LUS_KB_F2)) { + if (scancode == + Ship::Context::GetInstance()->GetConfig()->GetInt("Shortcuts.MouseCapture", Ship::KbScancode::LUS_KB_F2)) { bool captureState = Ship::Context::GetInstance()->GetWindow()->IsMouseCaptured(); if (captureState || !Ship::Context::GetInstance()->GetWindow()->GetGui()->GetMenuOrMenubarVisible()) { Ship::Context::GetInstance()->GetWindow()->SetMouseCapture(!captureState); @@ -312,7 +313,7 @@ void Fast3dWindow::OnFullscreenChanged(bool isNowFullscreen) { if (isNowFullscreen) { auto menuBar = wnd->GetGui()->GetMenuBar(); wnd->SetMouseCapture(!(menuBar && menuBar->IsVisible() || wnd->ShouldForceCursorVisibility() || - CVarGetInteger("gWindows.Menu", 0))); + CVarGetInteger("gWindows.Menu", 0))); } else { wnd->SetMouseCapture(false); } diff --git a/src/window/gui/Gui.cpp b/src/window/gui/Gui.cpp index 18903683a..aa6b8edb4 100644 --- a/src/window/gui/Gui.cpp +++ b/src/window/gui/Gui.cpp @@ -494,8 +494,8 @@ void Gui::DrawMenu() { GetMenuBar()->ToggleVisibility(); } if (wnd->IsFullscreen()) { - Context::GetInstance()->GetWindow()->SetMouseCapture(!(GetMenuOrMenubarVisible() || - wnd->ShouldForceCursorVisibility())); + Context::GetInstance()->GetWindow()->SetMouseCapture( + !(GetMenuOrMenubarVisible() || wnd->ShouldForceCursorVisibility())); } if (CVarGetInteger(CVAR_IMGUI_CONTROLLER_NAV, 0) && GetMenuOrMenubarVisible()) { mImGuiIo->ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; @@ -962,9 +962,9 @@ void Gui::SetMenuBar(std::shared_ptr menuBar) { } if (Context::GetInstance()->GetWindow()->IsFullscreen()) { - Context::GetInstance()->GetWindow()->SetMouseCapture(!( - (GetMenuBar() && GetMenuBar()->IsVisible()) || - Context::GetInstance()->GetWindow()->ShouldForceCursorVisibility())); + Context::GetInstance()->GetWindow()->SetMouseCapture( + !((GetMenuBar() && GetMenuBar()->IsVisible()) || + Context::GetInstance()->GetWindow()->ShouldForceCursorVisibility())); } } @@ -976,9 +976,9 @@ void Gui::SetMenu(std::shared_ptr menu) { } if (Context::GetInstance()->GetWindow()->IsFullscreen()) { - Context::GetInstance()->GetWindow()->SetMouseCapture(!( - (GetMenu() && GetMenu()->IsVisible()) || - Context::GetInstance()->GetWindow()->ShouldForceCursorVisibility())); + Context::GetInstance()->GetWindow()->SetMouseCapture( + !((GetMenu() && GetMenu()->IsVisible()) || + Context::GetInstance()->GetWindow()->ShouldForceCursorVisibility())); } }