summaryrefslogtreecommitdiff
path: root/alf
diff options
context:
space:
mode:
authorJonas Kümmerlin <jonas@kuemmerlin.eu>2020-06-22 16:34:47 +0200
committerJonas Kümmerlin <jonas@kuemmerlin.eu>2020-06-22 16:34:47 +0200
commitfc8f7a0075818b650f0a2f6b555159e796e1d130 (patch)
tree88ae5db138db173ac30c450c2b5b752b2b9832a8 /alf
parentcdc67e80ac78d08aee04bbc55ece650579beba6c (diff)
fix oversight in fallback buffered paint implementation
and make label use it more efficiently how the fuck was this not noticed before?
Diffstat (limited to 'alf')
-rw-r--r--alf/alfcompat.cpp10
-rw-r--r--alf/alflabel.cpp6
2 files changed, 11 insertions, 5 deletions
diff --git a/alf/alfcompat.cpp b/alf/alfcompat.cpp
index 45f5f4a..31c3eaa 100644
--- a/alf/alfcompat.cpp
+++ b/alf/alfcompat.cpp
@@ -368,6 +368,11 @@ ALF_Compat_fallbackBeginBufferedPaint(HDC hdc, const RECT *prcTarget, DWORD dwFo
_alf_compatBufferedPaintPriv->rcTarget = *prcTarget;
*phdcTarget = _alf_compatBufferedPaintPriv->hdcBuffer;
+ OffsetViewportOrgEx(_alf_compatBufferedPaintPriv->hdcBuffer,
+ -_alf_compatBufferedPaintPriv->rcTarget.left,
+ -_alf_compatBufferedPaintPriv->rcTarget.top,
+ NULL);
+
return _alf_compatBufferedPaintPriv;
}
@@ -394,6 +399,11 @@ ALF_Compat_fallbackEndBufferedPaint(ALF_Compat_HPAINTBUFFER hpbBuffer, BOOL fUpd
if (hpbBuffer != _alf_compatBufferedPaintPriv)
return E_INVALIDARG;
+ OffsetViewportOrgEx(_alf_compatBufferedPaintPriv->hdcBuffer,
+ _alf_compatBufferedPaintPriv->rcTarget.left,
+ _alf_compatBufferedPaintPriv->rcTarget.top,
+ NULL);
+
if (fUpdateTarget)
BitBlt(_alf_compatBufferedPaintPriv->hdcTarget,
_alf_compatBufferedPaintPriv->rcTarget.left,
diff --git a/alf/alflabel.cpp b/alf/alflabel.cpp
index 0a47d58..4643c3f 100644
--- a/alf/alflabel.cpp
+++ b/alf/alflabel.cpp
@@ -222,12 +222,8 @@ ALF_Label_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
- 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);
+ ALF_Compat_HPAINTBUFFER hpb = ALF_Compat_BeginBufferedPaint(hdc, &ps.rcPaint, 0, NULL, &hdcBuffer);
if (hpb) {
ALF_Label_Paint(hwnd, priv, hdcBuffer, &ps.rcPaint);
ALF_Compat_EndBufferedPaint(hpb, TRUE);