26 Aug
2024
26 Aug
'24
1:13 p.m.
Zhiyi Zhang (@zhiyi) commented about dlls/user32/edit.c:
EDIT_SetCaretPos(es, es->selection_end, es->flags & EF_AFTER_WRAP); }
+static int EDIT_is_valid_format_rect(const EDITSTATE *es, const RECT *rc) +{ + int text_height = es->line_height * es->line_count; + + if (IsRectEmpty(rc)) + return 0; + if (text_height > (rc->bottom - rc->top)) text_height is only used once so I think you can just use es->line_height * es->line_count.
Let's write it as "if (es->text_width > rc->right - rc->left || es->line_height * es->line_count > rc->bottom - rc->top)" -- https://gitlab.winehq.org/wine/wine/-/merge_requests/6304#note_79999