summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-01-23 12:43:33 +0000
committerJens Arnold <amiconn@rockbox.org>2005-01-23 12:43:33 +0000
commit2e41950fcf98b4f5eee95e2e5e72681557eca585 (patch)
treec6ca9547a45686c8b52a30c9c35db01be77b869c /uisimulator
parent424d50563732341180c7f931c10b02b89f830651 (diff)
Fixes: (1) Properly redraw display on window resize & putting into foreground. (2) No more jumpy resizing when pulling the window corners.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5640 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/win32/uisw32.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/uisimulator/win32/uisw32.c b/uisimulator/win32/uisw32.c
index 8fb2ae1d9d..39ab709a20 100644
--- a/uisimulator/win32/uisw32.c
+++ b/uisimulator/win32/uisw32.c
@@ -124,7 +124,7 @@ LRESULT CALLBACK GUIWndProc (
break;
case WMSZ_BOTTOMRIGHT:
GetWindowRect (hWnd, &r2);
- if (abs(r2.right - r->right) > abs(r2.bottom - r->bottom))
+ if (r2.right - r->right > r2.bottom - r->bottom)
v = (r->right - r->left) / (UI_WIDTH / 5);
else
v = (r->bottom - r->top) / (UI_HEIGHT / 5);
@@ -135,7 +135,7 @@ LRESULT CALLBACK GUIWndProc (
break;
case WMSZ_BOTTOMLEFT:
GetWindowRect (hWnd, &r2);
- if (abs(r2.left - r->left) > abs(r2.bottom - r->bottom))
+ if (-(r2.left - r->left) > r2.bottom - r->bottom)
v = (r->right - r->left) / (UI_WIDTH / 5);
else
v = (r->bottom - r->top) / (UI_HEIGHT / 5);
@@ -146,7 +146,7 @@ LRESULT CALLBACK GUIWndProc (
break;
case WMSZ_TOPRIGHT:
GetWindowRect (hWnd, &r2);
- if (abs(r2.right - r->right) > abs(r2.top - r->top))
+ if (r2.right - r->right > -(r2.top - r->top))
v = (r->right - r->left) / (UI_WIDTH / 5);
else
v = (r->bottom - r->top) / (UI_HEIGHT / 5);
@@ -157,7 +157,7 @@ LRESULT CALLBACK GUIWndProc (
break;
case WMSZ_TOPLEFT:
GetWindowRect (hWnd, &r2);
- if (abs(r2.left - r->left) > abs(r2.top - r->top))
+ if (-(r2.left - r->left) > -(r2.top - r->top))
v = (r->right - r->left) / (UI_WIDTH / 5);
else
v = (r->bottom - r->top) / (UI_HEIGHT / 5);
@@ -168,7 +168,7 @@ LRESULT CALLBACK GUIWndProc (
break;
}
- wsprintf (s, UI_TITLE " @%d%%",
+ wsprintf (s, UI_TITLE " @%d%%",
(r->right - r->left - GetSystemMetrics (SM_CXSIZEFRAME) * 2 -4)
* 100 / UI_WIDTH);
SetWindowText (hWnd, s);
@@ -177,15 +177,13 @@ LRESULT CALLBACK GUIWndProc (
}
case WM_ERASEBKGND:
{
- PAINTSTRUCT ps;
- HDC hDc = BeginPaint (hWnd, &ps);
+ HDC hDc = (HDC) wParam;
RECT r;
GetClientRect (hWnd, &r);
// blit background image to screen
StretchBlt (hDc, 0, 0, r.right, r.bottom,
hMemDc, 0, 0, UI_WIDTH, UI_HEIGHT, SRCCOPY);
- EndPaint (hWnd, &ps);
return TRUE;
}
case WM_PAINT: