Edit control: Fix update rgn calc
Ulrich Czekalla
ulrich.czekalla at utoronto.ca
Tue May 25 08:56:55 CDT 2004
ChangeLog:
Ulrich Czekalla <ulrich at codeweavers.com>
Fix update region calculation for the case where a word wraps up to
the previous line.
-------------- next part --------------
Index: controls/edit.c
===================================================================
RCS file: /home/wine/wine/controls/edit.c,v
retrieving revision 1.131
diff -u -r1.131 edit.c
--- controls/edit.c 7 May 2004 00:40:18 -0000 1.131
+++ controls/edit.c 25 May 2004 13:55:10 -0000
@@ -1125,7 +1125,8 @@
es->tabs_count, es->tabs));
/* FIXME: check here for lines that are too wide even in AUTOHSCROLL (> 32767 ???) */
- if ((!(es->style & ES_AUTOHSCROLL)) && (current_line->width > fw)) {
+ if (!(es->style & ES_AUTOHSCROLL)) {
+ if (current_line->width > fw) {
INT next = 0;
INT prev;
do {
@@ -1167,6 +1168,17 @@
current_line->ending = END_WRAP;
current_line->width = (INT)LOWORD(GetTabbedTextExtentW(dc, current_position,
current_line->net_length, es->tabs_count, es->tabs));
+ }
+ else if (orig_net_length < current_line->net_length &&
+ current_line == start_line &&
+ current_line->index != nstart_index) {
+ /* The previous line expanded but it's still not as wide as the client rect */
+ /* The expansion is due to an upwards line wrap so we must partially include
+ it in the update region */
+ nstart_line = line_index;
+ nstart_index = current_line->index;
+ istart = current_line->index + orig_net_length;
+ }
}
More information about the wine-patches
mailing list