Tim Worthington : user32: Fix rendering of tabs in edit control.
Module: wine Branch: master Commit: 4f96439ebfb007fdf121f0a6fd889bddff3c8c5b URL: http://source.winehq.org/git/wine.git/?a=commit;h=4f96439ebfb007fdf121f0a6fd... Author: Tim Worthington <tim(a)pcbelegance.org> Date: Sat Jul 22 01:34:37 2017 +1000 user32: Fix rendering of tabs in edit control. Signed-off-by: Tim Worthington <tim(a)pcbelegance.org> Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/edit.c | 2 +- dlls/usp10/usp10.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 78d78ea..00a7fba 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -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; diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index c1d9c1c..a6309ed 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -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
participants (1)
-
Alexandre Julliard