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)"