[NTGDI] Fix PatBlt with negative values (#6038)

When I am implementing the IME soft keyboard (#6021 and #6036),
I noticed an issue with PatBlt function.

- Fix the rectangle coordinates when the value was
  negative in NtGdiPatBlt function.
- Fix NC_DrawFrame function.
- Fix UserDrawWindowFrame function.

CORE-19334
This commit is contained in:
Katayama Hirofumi MZ 2023-11-26 11:46:42 +09:00 committed by GitHub
parent 90e17817fe
commit 0bfa0cd0d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View file

@ -858,26 +858,26 @@ IntPatBlt(
return TRUE;
}
if (Width > 0)
if (Width >= 0)
{
DestRect.left = XLeft;
DestRect.right = XLeft + Width;
}
else
{
DestRect.left = XLeft + Width + 1;
DestRect.right = XLeft + 1;
DestRect.left = XLeft + Width;
DestRect.right = XLeft;
}
if (Height > 0)
if (Height >= 0)
{
DestRect.top = YLeft;
DestRect.bottom = YLeft + Height;
}
else
{
DestRect.top = YLeft + Height + 1;
DestRect.bottom = YLeft + 1;
DestRect.top = YLeft + Height;
DestRect.bottom = YLeft;
}
IntLPtoDP(pdc, (LPPOINT)&DestRect, 2);