Commit 336d8458 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

Limit scrolling of the edit control to the last line of text.

parent 8e804681
...@@ -2783,6 +2783,8 @@ static BOOL EDIT_EM_LineScroll_internal(EDITSTATE *es, INT dx, INT dy) ...@@ -2783,6 +2783,8 @@ static BOOL EDIT_EM_LineScroll_internal(EDITSTATE *es, INT dx, INT dy)
{ {
INT nyoff; INT nyoff;
INT x_offset_in_pixels; INT x_offset_in_pixels;
INT lines_per_page = (es->format_rect.bottom - es->format_rect.top) /
es->line_height;
if (es->style & ES_MULTILINE) if (es->style & ES_MULTILINE)
{ {
...@@ -2799,8 +2801,8 @@ static BOOL EDIT_EM_LineScroll_internal(EDITSTATE *es, INT dx, INT dy) ...@@ -2799,8 +2801,8 @@ static BOOL EDIT_EM_LineScroll_internal(EDITSTATE *es, INT dx, INT dy)
if (dx > es->text_width - x_offset_in_pixels) if (dx > es->text_width - x_offset_in_pixels)
dx = es->text_width - x_offset_in_pixels; dx = es->text_width - x_offset_in_pixels;
nyoff = max(0, es->y_offset + dy); nyoff = max(0, es->y_offset + dy);
if (nyoff >= es->line_count) if (nyoff >= es->line_count - lines_per_page)
nyoff = es->line_count - 1; nyoff = es->line_count - lines_per_page;
dy = (es->y_offset - nyoff) * es->line_height; dy = (es->y_offset - nyoff) * es->line_height;
if (dx || dy) { if (dx || dy) {
RECT rc1; RECT rc1;
......
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