Skip to content

user32: Fix uiLengthDrawn calculation in DrawTextExW().

uiLengthDrawn should represent the number of characters that have been processed. However, the original implementation uses len (the count of displayed characters in the current line), which is not accurate.

When text requires line breaks or special processing (such as adding an ellipsis), the actual number of processed characters may differ from the number of displayed characters.

When the DT_CALCRECT flag is absent, len gets decremented to 0 during the drawing loop.

Consequently, uiLengthDrawn becomes inaccurate since it relies on len's value for statistics.

Edited by JiangYi Chen

Merge request reports

Loading