Skip to content

Commit

Permalink
Merge pull request #1389 from cracyc/transform
Browse files Browse the repository at this point in the history
clamp world transform coordinates to 16 bits.
#1380
  • Loading branch information
otya128 authored Mar 27, 2024
2 parents 14cc370 + 3ef3724 commit 1ad921b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions gdi/gdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -5012,8 +5012,12 @@ BOOL16 WINAPI DPtoLP16( HDC16 hdc, LPPOINT16 points, INT16 count )
{
for (i = 0; i < count; i++)
{
points[i].x = pt32[i].x;
points[i].y = pt32[i].y;
if (pt32[i].x >= 0x8000) points[i].x = 0x7fff;
else if (pt32[i].x < (LONG)0xffff8000) points[i].x = 0x8000;
else points[i].x = pt32[i].x;
if (pt32[i].y >= 0x8000) points[i].y = 0x7fff;
else if (pt32[i].y < (LONG)0xffff8000) points[i].y = 0x8000;
else points[i].y = pt32[i].y;
}
}
if (pt32 != points32) HeapFree( GetProcessHeap(), 0, pt32 );
Expand Down Expand Up @@ -5043,8 +5047,12 @@ BOOL16 WINAPI LPtoDP16( HDC16 hdc, LPPOINT16 points, INT16 count )
{
for (i = 0; i < count; i++)
{
points[i].x = pt32[i].x;
points[i].y = pt32[i].y;
if (pt32[i].x >= 0x8000) points[i].x = 0x7fff;
else if (pt32[i].x < (LONG)0xffff8000) points[i].x = 0x8000;
else points[i].x = pt32[i].x;
if (pt32[i].y >= 0x8000) points[i].y = 0x7fff;
else if (pt32[i].y < (LONG)0xffff8000) points[i].y = 0x8000;
else points[i].y = pt32[i].y;
}
}
if (pt32 != points32) HeapFree( GetProcessHeap(), 0, pt32 );
Expand Down

0 comments on commit 1ad921b

Please sign in to comment.