From d268c51d8fe3bf90c5d4931be27076496777c1f0 Mon Sep 17 00:00:00 2001 From: narzoul Date: Sun, 21 Feb 2021 17:36:09 +0100 Subject: [PATCH] Fixed clipping of monitor-specific DCs --- DDrawCompat/Gdi/Dc.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/DDrawCompat/Gdi/Dc.cpp b/DDrawCompat/Gdi/Dc.cpp index 463f96b..d5cb73a 100644 --- a/DDrawCompat/Gdi/Dc.cpp +++ b/DDrawCompat/Gdi/Dc.cpp @@ -107,17 +107,13 @@ namespace void setClippingRegion(const CompatDc& compatDc, HWND hwnd, const POINT& origin, const RECT& virtualScreenBounds) { + Gdi::Region sysRgn; + GetRandomRgn(compatDc.origDc, sysRgn, SYSRGN); if (hwnd) { - Gdi::Region sysRgn; - GetRandomRgn(compatDc.origDc, sysRgn, SYSRGN); OffsetRgn(sysRgn, -virtualScreenBounds.left, -virtualScreenBounds.top); - SelectClipRgn(compatDc.dc, sysRgn); - } - else - { - SelectClipRgn(compatDc.dc, nullptr); } + SelectClipRgn(compatDc.dc, sysRgn); Gdi::Region clipRgn; if (1 == GetClipRgn(compatDc.origDc, clipRgn))