mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-11 03:43:29 +00:00
gdi backend has bugs
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@351 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -337,8 +337,12 @@ MwLLPixmap MwLLCreatePixmap(MwLL handle, unsigned char* data, int width, int hei
|
||||
BITMAPINFOHEADER bmih;
|
||||
RGBQUAD* quad;
|
||||
int y, x;
|
||||
int w = (width + (16 - (width % 16))) / 8;
|
||||
WORD* words = malloc(w * height);
|
||||
int w = (width + (16 - (width % 16))) / 8;
|
||||
WORD* words;
|
||||
|
||||
if(16 * (width / 16) == width) w -= 2;
|
||||
|
||||
words = malloc(w * height);
|
||||
|
||||
r->width = width;
|
||||
r->height = height;
|
||||
@@ -478,18 +482,22 @@ void MwLLSetCursor(MwLL handle, MwCursor* image, MwCursor* mask) {
|
||||
}
|
||||
|
||||
void MwLLDetach(MwLL handle, MwPoint* point) {
|
||||
RECT rc, rc2;
|
||||
RECT rc, rc2;
|
||||
LPARAM lp = GetWindowLongPtr(handle->hWnd, GWL_STYLE);
|
||||
|
||||
lp &= WS_VISIBLE;
|
||||
|
||||
GetWindowRect(GetParent(handle->hWnd), &rc);
|
||||
|
||||
GetClientRect(handle->hWnd, &rc2);
|
||||
|
||||
SetWindowLongPtr(handle->hWnd, GWL_STYLE, (LPARAM)WS_OVERLAPPEDWINDOW);
|
||||
SetWindowLongPtr(handle->hWnd, GWL_STYLE, (LPARAM)WS_OVERLAPPEDWINDOW | lp);
|
||||
SetParent(handle->hWnd, NULL);
|
||||
|
||||
rc.left += point->x;
|
||||
rc.top += point->y;
|
||||
|
||||
AdjustWindowRect(&rc2, WS_OVERLAPPEDWINDOW, FALSE);
|
||||
AdjustWindowRect(&rc2, WS_OVERLAPPEDWINDOW | lp, FALSE);
|
||||
rc2.right -= rc2.left;
|
||||
rc2.bottom -= rc2.top;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user