If ETO_PDY is specified, Dx is a pair of INTs, make sure we access the correct index.

based on aspotashev's patch. Should fix bug #3958
See issue #3958 for more details.

svn path=/trunk/; revision=38262
This commit is contained in:
Timo Kreuzer 2008-12-22 04:26:51 +00:00
parent 766c25b7e3
commit a4e64ebf0e

View file

@ -3132,6 +3132,7 @@ GreExtTextOutW(
POINT Start;
BOOL DoBreak = FALSE;
HPALETTE hDestPalette;
USHORT DxShift;
// TODO: Write test-cases to exactly match real Windows in different
// bad parameters (e.g. does Windows check the DC or the RECT first?).
@ -3158,6 +3159,8 @@ GreExtTextOutW(
goto fail;
}
DxShift = fuOptions & ETO_PDY ? 1 : 0;
if (PATH_IsPathOpen(dc->DcLevel))
{
if (!PATH_ExtTextOut( dc,
@ -3364,7 +3367,7 @@ GreExtTextOutW(
if (NULL != Dx)
{
Start = Count < 2 ? 0 : Count - 2;
TextWidth = Count < 2 ? 0 : (Dx[Count - 2] << 6);
TextWidth = Count < 2 ? 0 : (Dx[(Count-2)<<DxShift] << 6);
}
else
{
@ -3597,7 +3600,7 @@ GreExtTextOutW(
}
else
{
TextLeft += Dx[i] << 6;
TextLeft += Dx[i<<DxShift] << 6;
// DbgPrint("new TextLeft2: %d\n", TextLeft);
}
previous = glyph_index;