From 521e94cb02c94f138ff70e4e7a5ed0ebb3b69df0 Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Wed, 26 Jun 2024 20:50:47 +0200 Subject: [PATCH] round positions of SnapsToPartyWindow --- GWToolboxdll/Widgets/SnapsToPartyWindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/GWToolboxdll/Widgets/SnapsToPartyWindow.cpp b/GWToolboxdll/Widgets/SnapsToPartyWindow.cpp index 885d1b690..b1f09ef01 100644 --- a/GWToolboxdll/Widgets/SnapsToPartyWindow.cpp +++ b/GWToolboxdll/Widgets/SnapsToPartyWindow.cpp @@ -18,14 +18,18 @@ namespace { - bool GetFramePosition(GW::UI::Frame* frame, GW::UI::Frame* relative_to, ImVec2* top_left, ImVec2* bottom_right) { + bool GetFramePosition(const GW::UI::Frame* frame, const GW::UI::Frame* relative_to, ImVec2* top_left, ImVec2* bottom_right) { if (!(frame && relative_to && frame->IsVisible())) return false; if (top_left) { *top_left = frame->position.GetTopLeftOnScreen(relative_to); + top_left->x = std::round(top_left->x); + top_left->y = std::round(top_left->y); } if (bottom_right) { *bottom_right = frame->position.GetBottomRightOnScreen(relative_to); + bottom_right->x = std::round(bottom_right->x); + bottom_right->y = std::round(bottom_right->y); } return true; }