summaryrefslogtreecommitdiff
path: root/alf/alflabel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alf/alflabel.cpp')
-rw-r--r--alf/alflabel.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/alf/alflabel.cpp b/alf/alflabel.cpp
index b3a87c4..0a47d58 100644
--- a/alf/alflabel.cpp
+++ b/alf/alflabel.cpp
@@ -222,16 +222,28 @@ ALF_Label_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
- ALF_Label_Paint(hwnd, priv, hdc, &ps.rcPaint);
+ RECT rcClient;
+ GetClientRect(hwnd, &rcClient);
+ RECT rcPaint = { 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top };
+
+ HDC hdcBuffer = NULL;
+ ALF_Compat_HPAINTBUFFER hpb = ALF_Compat_BeginBufferedPaint(hdc, &rcPaint, 0, NULL, &hdcBuffer);
+ if (hpb) {
+ ALF_Label_Paint(hwnd, priv, hdcBuffer, &ps.rcPaint);
+ ALF_Compat_EndBufferedPaint(hpb, TRUE);
+ } else {
+ ALF_Label_Paint(hwnd, priv, hdc, &ps.rcPaint);
+ }
EndPaint(hwnd, &ps);
return TRUE;
} else if (uMsg == WM_PRINTCLIENT) {
- RECT rc;
- GetClientRect(hwnd, &rc);
+ RECT rcClient;
+ GetClientRect(hwnd, &rcClient);
+ RECT rcPaint = { 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top };
- ALF_Label_Paint(hwnd, priv, (HDC)wParam, &rc);
+ ALF_Label_Paint(hwnd, priv, (HDC)wParam, &rcPaint);
} else if (uMsg == WM_NCHITTEST) {
return HTTRANSPARENT;
} else if (uMsg == ALF_WM_QUERYSIZE) {