[2/2] richedit: Made sure text is offset by formatting rectangle.

Dylan Smith dylan.ah.smith at gmail.com
Thu Dec 18 00:56:49 CST 2008

The formatting rectangle is set with EM_SETRECT, and retrieved with
EM_GETRECT, so it corresponds to rcFormat in the code.  This defines the
area that the richedit control should draw the text so that it is
offset by the top-left corner of the formatting rectangle, and clipped
so that it doesn't draw past the bottom or right hand side.  Thus this
is important for implementing windowless richedit controls to not
interfere with the rest of the window.

Previously the formatting rectangle was mostly unused, and when it was
used it was not used correctly.  I tested with a modified wordpad that
used EM_SETRECT, and found it was inconsistent with native richedit

This patch fixes problems with the offset of text based on the top left
corner of the formatting rectangle.  A later patch will be needed to fix
the problem of text not being clipped to the edge of the formatting
 dlls/riched20/caret.c        |   17 +++---
 dlls/riched20/editor.c       |  135 ++++++++++++++++++++++++++++++++++-------
 dlls/riched20/editstr.h      |    4 +-
 dlls/riched20/paint.c        |  103 +++++++++++++++++++-------------
 dlls/riched20/run.c          |    2 +-
 dlls/riched20/tests/editor.c |   33 ++++------
 dlls/riched20/wrap.c         |   24 ++++----
 7 files changed, 211 insertions(+), 107 deletions(-)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0002-richedit-Made-sure-text-is-offset-by-formatting.diff.txt
Url: http://www.winehq.org/pipermail/wine-patches/attachments/20081218/8f85d997/attachment-0001.txt 

More information about the wine-patches mailing list