From 8777a856306b9321b87837014d606b392ea87e2c Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 16 Feb 2025 11:40:09 +0100 Subject: [PATCH] fix: Make title bar backdrop stay where it is on resize --- plugins/builtin/source/content/window_decoration.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/builtin/source/content/window_decoration.cpp b/plugins/builtin/source/content/window_decoration.cpp index 3d85ed7f9..1941985e3 100644 --- a/plugins/builtin/source/content/window_decoration.cpp +++ b/plugins/builtin/source/content/window_decoration.cpp @@ -41,9 +41,9 @@ namespace hex::plugin::builtin { if (!s_showTitlebarBackDrop) return; - const auto size = ImHexApi::System::getMainWindowSize(); - const auto pos = ImHexApi::System::getMainWindowPosition() - ImVec2(0, size.y / 2 - 20_scaled); - ImGui::GetWindowDrawList()->AddShadowCircle(pos, size.x / 4, ImGui::GetColorU32(ImGuiCol_ButtonActive, 0.8), size.x / 4, ImVec2()); + const auto diameter = 800_scaled; + const auto pos = ImHexApi::System::getMainWindowPosition() - ImVec2(0, diameter / 2); + ImGui::GetWindowDrawList()->AddShadowCircle(pos, diameter / 2, ImGui::GetColorU32(ImGuiCol_ButtonActive, 0.8), diameter / 4, ImVec2()); } void createNestedMenu(std::span menuItems, const char *icon, const Shortcut &shortcut, View *view, const ContentRegistry::Interface::impl::MenuCallback &callback, const ContentRegistry::Interface::impl::EnabledCallback &enabledCallback, const ContentRegistry::Interface::impl::SelectedCallback &selectedCallback) {