Commit 0da8c0d9 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Compute the extents of the whole string at once in ExtTextOut.

parent 718e2f25
......@@ -2232,46 +2232,49 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
if(char_extra || dc->breakExtra || breakRem || lpDx || lf.lfEscapement != 0)
{
UINT i;
SIZE tmpsz;
POINT total = {0, 0}, desired[2];
deltas = HeapAlloc(GetProcessHeap(), 0, count * sizeof(*deltas));
for(i = 0; i < count; i++)
if (lpDx)
{
if(lpDx)
if (flags & ETO_PDY)
{
if(flags & ETO_PDY)
for (i = 0; i < count; i++)
{
deltas[i].x = lpDx[i * 2] + char_extra;
deltas[i].y = -lpDx[i * 2 + 1];
}
}
else
{
for (i = 0; i < count; i++)
{
deltas[i].x = lpDx[i] + char_extra;
deltas[i].y = 0;
}
}
}
else
{
if(flags & ETO_GLYPH_INDEX)
GetTextExtentPointI(hdc, glyphs + i, 1, &tmpsz);
INT *dx = HeapAlloc( GetProcessHeap(), 0, count * sizeof(*dx) );
if (flags & ETO_GLYPH_INDEX)
GetTextExtentExPointI( hdc, glyphs, count, -1, NULL, dx, &sz );
else
GetTextExtentPointW(hdc, reordered_str + i, 1, &tmpsz);
GetTextExtentExPointW( hdc, reordered_str, count, -1, NULL, dx, &sz );
deltas[i].x = tmpsz.cx;
deltas[0].x = dx[0];
deltas[0].y = 0;
for (i = 1; i < count; i++)
{
deltas[i].x = dx[i] - dx[i - 1];
deltas[i].y = 0;
}
HeapFree( GetProcessHeap(), 0, dx );
}
if (!(flags & ETO_GLYPH_INDEX) && (dc->breakExtra || breakRem) && reordered_str[i] == tm.tmBreakChar)
{
deltas[i].x = deltas[i].x + dc->breakExtra;
if (breakRem > 0)
for(i = 0; i < count; i++)
{
breakRem--;
deltas[i].x++;
}
}
total.x += deltas[i].x;
total.y += deltas[i].y;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment