From 478ffa8c12d6c2635ff5493b0be40f9eac736376 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Bernon?= Date: Tue, 9 May 2023 15:44:19 +0200 Subject: [PATCH] imm32: Use DrawTextW to wrap IME composition string. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53860 --- dlls/imm32/ime.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/imm32/ime.c b/dlls/imm32/ime.c index b31f56f234f..c10db8958f7 100644 --- a/dlls/imm32/ime.c +++ b/dlls/imm32/ime.c @@ -253,11 +253,10 @@ static void ime_ui_paint( HIMC himc, HWND hwnd ) if (ctx->cfCompForm.dwStyle == CFS_RECT) { - RECT client; - client = ctx->cfCompForm.rcArea; + RECT client = ctx->cfCompForm.rcArea; MapWindowPoints( ctx->hWnd, 0, (POINT *)&client, 2 ); IntersectRect( &rect, &rect, &client ); - /* TODO: Wrap the input if needed */ + DrawTextW( hdc, str, len, &rect, DT_WORDBREAK | DT_CALCRECT ); } if (ctx->cfCompForm.dwStyle == CFS_DEFAULT) @@ -286,7 +285,8 @@ static void ime_ui_paint( HIMC himc, HWND hwnd ) } new_rect = rect; - TextOutW( hdc, offset.x, offset.y, str, len ); + OffsetRect( &rect, offset.x - rect.left, offset.y - rect.top ); + DrawTextW( hdc, str, len, &rect, DT_WORDBREAK ); if (font) SelectObject( hdc, font ); free( str ); -- 2.11.4.GIT