Skip to content

Commit

Permalink
round positions of SnapsToPartyWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
DubbleClick committed Jun 26, 2024
1 parent eb45cdc commit 521e94c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion GWToolboxdll/Widgets/SnapsToPartyWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 521e94c

Please sign in to comment.