Signed-off-by: Sven Baars <sbaars(a)codeweavers.com> --- dlls/d3dx9_36/font.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c index f5775384da3..13cffe4c514 100644 --- a/dlls/d3dx9_36/font.c +++ b/dlls/d3dx9_36/font.c @@ -512,7 +512,7 @@ static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite, } static void word_break(HDC hdc, const WCHAR *str, unsigned int *str_len, - unsigned int chars_fit, unsigned int *chars_used, DWORD format, SIZE *size) + unsigned int chars_fit, unsigned int *chars_used, SIZE *size) { SCRIPT_LOGATTR *sla; SCRIPT_ANALYSIS sa; @@ -535,7 +535,7 @@ static void word_break(HDC hdc, const WCHAR *str, unsigned int *str_len, --i; /* If the there is no word that fits put in all characters that do fit */ - if (!sla[i].fSoftBreak || (format & DT_SINGLELINE)) + if (!sla[i].fSoftBreak) i = chars_fit; *chars_used = i; @@ -571,20 +571,13 @@ static const WCHAR *read_line(HDC hdc, const WCHAR *str, unsigned int *count, num_fit = 0; GetTextExtentExPointW(hdc, dest, *dest_len, width, &num_fit, NULL, size); - if (num_fit < *dest_len) + if (num_fit < *dest_len && (format & DT_WORDBREAK)) { - if (format & DT_WORDBREAK) - { - unsigned int chars_used; + unsigned int chars_used; - word_break(hdc, dest, dest_len, num_fit, &chars_used, format, size); - *count = orig_count - chars_used; - i = chars_used; - } - else if (format & DT_SINGLELINE) - { - *count = 0; - } + word_break(hdc, dest, dest_len, num_fit, &chars_used, size); + *count = orig_count - chars_used; + i = chars_used; } if (*count && str[i] == '\n') -- 2.25.1