Signed-off-by: Sven Baars sbaars@codeweavers.com --- dlls/gdi32/font.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 6ad03df176b..4a6ca1916ac 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -4897,6 +4897,11 @@ BOOL WINAPI GetTextExtentExPointI( HDC hdc, const WORD *indices, INT count, INT unsigned int dx = abs( INTERNAL_XDSTOWS( dc, pos[i] )) + (i + 1) * dc->charExtra; if (nfit && dx > (unsigned int)max_ext) break; if (dxs) dxs[i] = dx; + if (nfit && dx == (unsigned int)max_ext) + { + i++; + break; + } } if (nfit) *nfit = i; } @@ -5033,7 +5038,12 @@ BOOL WINAPI GetTextExtentExPointW( HDC hdc, LPCWSTR str, INT count, INT max_ext, { unsigned int dx = abs( INTERNAL_XDSTOWS( dc, pos[i] )) + (i + 1) * dc->charExtra; if (nfit && dx > (unsigned int)max_ext) break; - if (dxs) dxs[i] = dx; + if (dxs) dxs[i] = dx; + if (nfit && dx == (unsigned int)max_ext) + { + i++; + break; + } } if (nfit) *nfit = i; }