diff options
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/window.c b/src/window.c index 76432f8bb6b..22da72db2b7 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -4368,6 +4368,8 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) | |||
| 4368 | int vscrolled = 0; | 4368 | int vscrolled = 0; |
| 4369 | int x, y, rtop, rbot, rowh, vpos; | 4369 | int x, y, rtop, rbot, rowh, vpos; |
| 4370 | void *itdata = NULL; | 4370 | void *itdata = NULL; |
| 4371 | int window_total_lines; | ||
| 4372 | int frame_line_height = default_line_pixel_height (w); | ||
| 4371 | 4373 | ||
| 4372 | SET_TEXT_POS_FROM_MARKER (start, w->start); | 4374 | SET_TEXT_POS_FROM_MARKER (start, w->start); |
| 4373 | /* Scrolling a minibuffer window via scroll bar when the echo area | 4375 | /* Scrolling a minibuffer window via scroll bar when the echo area |
| @@ -4411,7 +4413,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) | |||
| 4411 | if (rtop || rbot) /* partially visible */ | 4413 | if (rtop || rbot) /* partially visible */ |
| 4412 | { | 4414 | { |
| 4413 | int px; | 4415 | int px; |
| 4414 | int dy = WINDOW_FRAME_LINE_HEIGHT (w); | 4416 | int dy = frame_line_height; |
| 4415 | if (whole) | 4417 | if (whole) |
| 4416 | dy = max ((window_box_height (w) | 4418 | dy = max ((window_box_height (w) |
| 4417 | - next_screen_context_lines * dy), | 4419 | - next_screen_context_lines * dy), |
| @@ -4497,7 +4499,7 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) | |||
| 4497 | if (whole) | 4499 | if (whole) |
| 4498 | { | 4500 | { |
| 4499 | ptrdiff_t start_pos = IT_CHARPOS (it); | 4501 | ptrdiff_t start_pos = IT_CHARPOS (it); |
| 4500 | int dy = WINDOW_FRAME_LINE_HEIGHT (w); | 4502 | int dy = frame_line_height; |
| 4501 | dy = max ((window_box_height (w) | 4503 | dy = max ((window_box_height (w) |
| 4502 | - next_screen_context_lines * dy), | 4504 | - next_screen_context_lines * dy), |
| 4503 | dy) * n; | 4505 | dy) * n; |
| @@ -4614,10 +4616,12 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) | |||
| 4614 | /* Move PT out of scroll margins. | 4616 | /* Move PT out of scroll margins. |
| 4615 | This code wants current_y to be zero at the window start position | 4617 | This code wants current_y to be zero at the window start position |
| 4616 | even if there is a header line. */ | 4618 | even if there is a header line. */ |
| 4619 | window_total_lines | ||
| 4620 | = w->total_lines * WINDOW_FRAME_LINE_HEIGHT (w) / frame_line_height; | ||
| 4617 | this_scroll_margin = max (0, scroll_margin); | 4621 | this_scroll_margin = max (0, scroll_margin); |
| 4618 | this_scroll_margin | 4622 | this_scroll_margin |
| 4619 | = min (this_scroll_margin, w->total_lines / 4); | 4623 | = min (this_scroll_margin, window_total_lines / 4); |
| 4620 | this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); | 4624 | this_scroll_margin *= frame_line_height; |
| 4621 | 4625 | ||
| 4622 | if (n > 0) | 4626 | if (n > 0) |
| 4623 | { | 4627 | { |