Commit 11e3cf09 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

user32: Respect margins more in DrawTextExW().

parent 5dfacee5
......@@ -943,6 +943,7 @@ INT WINAPI DrawTextExW( HDC hdc, LPWSTR str, INT i_count,
{
lmargin = dtp->iLeftMargin;
rmargin = dtp->iRightMargin;
width -= lmargin + rmargin;
if (!(flags & (DT_CENTER | DT_RIGHT)))
x += lmargin;
dtp->uiLengthDrawn = 0; /* This param RECEIVES number of chars processed */
......@@ -978,9 +979,10 @@ INT WINAPI DrawTextExW( HDC hdc, LPWSTR str, INT i_count,
last_line = !(flags & DT_NOCLIP) && y + ((flags & DT_EDITCONTROL) ? 2*lh-1 : lh) > rect->bottom;
strPtr = TEXT_NextLineW(hdc, strPtr, &count, line, &len, width, flags, &size, last_line, retstr, tabwidth, &prefix_offset, &ellip);
if (flags & DT_CENTER) x = (rect->left + rect->right -
size.cx) / 2;
else if (flags & DT_RIGHT) x = rect->right - size.cx;
if (flags & DT_CENTER)
x = (rect->left + lmargin + rect->right - rmargin - size.cx) / 2;
else if (flags & DT_RIGHT)
x = rect->right - size.cx - rmargin;
if (flags & DT_SINGLELINE)
{
......
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