Skip to content

Commit

Permalink
fix: viewport position retrieval [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffstadt committed Jan 20, 2022
1 parent 79ebdb6 commit 313cca8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions DearPyGui/src/platform/Windows/mvViewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,13 @@ namespace Marvel {
}

case WM_MOVING:
viewport->xpos = (int)(short)LOWORD(lParam); // horizontal position
viewport->ypos = (int)(short)HIWORD(lParam); // vertical position
{
int horizontal_shift = get_horizontal_shift(ghandle);
RECT rect = *(RECT*)(lParam);
viewport->xpos = rect.left + horizontal_shift;
viewport->ypos = rect.top;
break;
}

case WM_SIZE:
if (gdevice != nullptr && wParam != SIZE_MINIMIZED)
Expand Down

0 comments on commit 313cca8

Please sign in to comment.