Skip to content

Commit

Permalink
Don't try to resize the display if the window size didn't change.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jan 27, 2013
1 parent 336dffa commit cb67e04
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Windows/WndMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,13 @@ namespace MainWindow
void ResizeDisplay() {
RECT rc;
GetClientRect(hwndMain, &rc);
MoveWindow(hwndDisplay, 0, 0, PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight, TRUE);

if ((rc.right - rc.left) == PSP_CoreParameter().pixelWidth &&
(rc.bottom - rc.top) == PSP_CoreParameter().pixelHeight)
return;
PSP_CoreParameter().pixelWidth = rc.right - rc.left;
PSP_CoreParameter().pixelHeight = rc.bottom - rc.top;
MoveWindow(hwndDisplay, 0, 0, PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight, TRUE);

// round up to a zoom factor for the render size.
int zoom = (rc.right - rc.left + 479) / 480;
Expand Down

0 comments on commit cb67e04

Please sign in to comment.