Commit 4ad94533 authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

user32: While calculating lines, discard uniscribe data for non-visible lines.

parent dd205230
......@@ -476,6 +476,12 @@ static SCRIPT_STRING_ANALYSIS EDIT_UpdateUniscribeData(EDITSTATE *es, HDC dc, IN
}
}
static inline INT get_vertical_line_count(EDITSTATE *es)
{
INT vlc = (es->format_rect.bottom - es->format_rect.top) / es->line_height;
return max(1,vlc);
}
/*********************************************************************
*
* EDIT_BuildLineDefs_ML
......@@ -496,6 +502,7 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta
INT line_count = es->line_count;
INT orig_net_length;
RECT rc;
INT vlc;
if (istart == iend && delta == 0)
return;
......@@ -536,6 +543,7 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta
fw = es->format_rect.right - es->format_rect.left;
current_position = es->text + current_line->index;
vlc = get_vertical_line_count(es);
do {
if (current_line != start_line)
{
......@@ -726,6 +734,11 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta
es->text_width = max(es->text_width, current_line->width);
current_position += current_line->length;
previous_line = current_line;
/* Discard data for non-visible lines. It will be calculated as needed */
if ((line_index < es->y_offset) || (line_index > es->y_offset + vlc))
EDIT_InvalidateUniscribeData_linedef(current_line);
current_line = current_line->next;
line_index++;
} while (previous_line->ending != END_0);
......@@ -1460,13 +1473,6 @@ static void EDIT_SL_InvalidateText(EDITSTATE *es, INT start, INT end)
EDIT_UpdateText(es, &rc, TRUE);
}
static inline INT get_vertical_line_count(EDITSTATE *es)
{
INT vlc = (es->format_rect.bottom - es->format_rect.top) / es->line_height;
return max(1,vlc);
}
/*********************************************************************
*
* EDIT_ML_InvalidateText
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment