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);
tabdef.cTabStops = es->tabs_count;
tabdef.iScale = 0;
tabdef.iScale = GdiGetCharDimensions(udc, NULL, NULL);
tabdef.pTabStops = es->tabs;
tabdef.iTabOrigin = 0;

View File

@ -1828,7 +1828,12 @@ static inline int getGivenTabWidth(ScriptCache *psc, SCRIPT_TABDEF *pTabdef, int
cTabStops = 0;
}
else
defWidth = 8 * psc->tm.tmAveCharWidth;
{
if (pTabdef->iScale)
defWidth = (32 * pTabdef->iScale) / 4;
else
defWidth = 8 * psc->tm.tmAveCharWidth;
}
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( *lpTabPos >= 0)
if( position >= 0)
{
/* a left aligned tab */
x = (nTabOrg + *lpTabPos) - current_x;
x = (nTabOrg + position) - current_x;
break;
}
else