mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
Fixed GDI brush origin
Fixes splash window background alignment in Star Trek: Armada. See issue #94.
This commit is contained in:
parent
83143589ee
commit
9fa1a8a047
@ -90,7 +90,7 @@ namespace
|
|||||||
|
|
||||||
POINT brushOrg = {};
|
POINT brushOrg = {};
|
||||||
GetBrushOrgEx(origDc, &brushOrg);
|
GetBrushOrgEx(origDc, &brushOrg);
|
||||||
SetBrushOrgEx(compatDc.dc, brushOrg.x, brushOrg.y, nullptr);
|
SetBrushOrgEx(compatDc.dc, origin.x + brushOrg.x, origin.y + brushOrg.y, nullptr);
|
||||||
|
|
||||||
POINT currentPos = {};
|
POINT currentPos = {};
|
||||||
GetCurrentPositionEx(origDc, ¤tPos);
|
GetCurrentPositionEx(origDc, ¤tPos);
|
||||||
|
@ -156,6 +156,19 @@ namespace
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WM_ERASEBKGND:
|
||||||
|
{
|
||||||
|
HBRUSH brush = reinterpret_cast<HBRUSH>(GetClassLong(hwnd, GCL_HBRBACKGROUND));
|
||||||
|
if (!brush)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
RECT rect = {};
|
||||||
|
GetClientRect(hwnd, &rect);
|
||||||
|
FillRect(Gdi::CompatDc(reinterpret_cast<HDC>(wParam)), &rect, brush);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
case WM_NCACTIVATE:
|
case WM_NCACTIVATE:
|
||||||
return onNcActivate(hwnd, wParam, lParam);
|
return onNcActivate(hwnd, wParam, lParam);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user