Skip to content

Commit

Permalink
fix textbox with maintain aspect ratio enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyFr3sh committed Jul 14, 2024
1 parent c850b0d commit d968d32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1163,8 +1163,8 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
real_SetWindowPos(
g_ddraw.textbox.hwnd,
0,
g_ddraw.textbox.x * g_ddraw.render.scale_w,
g_ddraw.textbox.y * g_ddraw.render.scale_h,
g_ddraw.render.viewport.x + (g_ddraw.textbox.x * g_ddraw.render.scale_w),
g_ddraw.render.viewport.y + (g_ddraw.textbox.y * g_ddraw.render.scale_h),
0,
0,
SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER
Expand Down
4 changes: 2 additions & 2 deletions src/winapi_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ BOOL WINAPI fake_MoveWindow(HWND hWnd, int X, int Y, int nWidth, int nHeight, BO
g_ddraw.textbox.x = X;
g_ddraw.textbox.y = Y;

X *= g_ddraw.render.scale_w;
Y *= g_ddraw.render.scale_h;
X = g_ddraw.render.viewport.x + (X * g_ddraw.render.scale_w);
Y = g_ddraw.render.viewport.y + (Y * g_ddraw.render.scale_h);
}
}
}
Expand Down

0 comments on commit d968d32

Please sign in to comment.