user32: Fix rendering of tabs in edit control.

Signed-off-by: Tim Worthington <tim@pcbelegance.org>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Tim Worthington 2017-07-22 01:34:37 +10:00 committed by Alexandre Julliard
parent 5bd636dc16
commit 4f96439ebf
2 changed files with 9 additions and 4 deletions

View File

@ -411,7 +411,7 @@ static SCRIPT_STRING_ANALYSIS EDIT_UpdateUniscribeData_linedef(EDITSTATE *es, HD
old_font = SelectObject(udc, es->font); old_font = SelectObject(udc, es->font);
tabdef.cTabStops = es->tabs_count; tabdef.cTabStops = es->tabs_count;
tabdef.iScale = 0; tabdef.iScale = GdiGetCharDimensions(udc, NULL, NULL);
tabdef.pTabStops = es->tabs; tabdef.pTabStops = es->tabs;
tabdef.iTabOrigin = 0; tabdef.iTabOrigin = 0;

View File

@ -1827,8 +1827,13 @@ static inline int getGivenTabWidth(ScriptCache *psc, SCRIPT_TABDEF *pTabdef, int
defWidth = (pTabdef->pTabStops[0])*psc->tm.tmAveCharWidth; defWidth = (pTabdef->pTabStops[0])*psc->tm.tmAveCharWidth;
cTabStops = 0; cTabStops = 0;
} }
else
{
if (pTabdef->iScale)
defWidth = (32 * pTabdef->iScale) / 4;
else else
defWidth = 8 * psc->tm.tmAveCharWidth; defWidth = 8 * psc->tm.tmAveCharWidth;
}
for (; cTabStops>0 ; lpTabPos++, cTabStops--) for (; cTabStops>0 ; lpTabPos++, cTabStops--)
{ {
@ -1842,10 +1847,10 @@ static inline int getGivenTabWidth(ScriptCache *psc, SCRIPT_TABDEF *pTabdef, int
if( nTabOrg + position > current_x) if( nTabOrg + position > current_x)
{ {
if( *lpTabPos >= 0) if( position >= 0)
{ {
/* a left aligned tab */ /* a left aligned tab */
x = (nTabOrg + *lpTabPos) - current_x; x = (nTabOrg + position) - current_x;
break; break;
} }
else else