diff options
| author | Stefan Monnier | 2014-11-16 00:22:20 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2014-11-16 00:22:20 -0500 |
| commit | 9075fcc1937a211bc91e8bc49c332bc55ac99e24 (patch) | |
| tree | 1cff4991107011e0b5d13fac46b0881c30d31a63 /src/window.c | |
| parent | 86009dd5d886f1101358990e4f8f69a5d1467eb8 (diff) | |
| parent | 4f4cf9c855f5818d4c3c0fb772db8bbcf4f33780 (diff) | |
| download | emacs-9075fcc1937a211bc91e8bc49c332bc55ac99e24.tar.gz emacs-9075fcc1937a211bc91e8bc49c332bc55ac99e24.zip | |
Merge from emacs-24
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/window.c b/src/window.c index e4ff2b41806..7c2b3ca29d2 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -4950,9 +4950,14 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror) | |||
| 4950 | { | 4950 | { |
| 4951 | int px; | 4951 | int px; |
| 4952 | int dy = frame_line_height; | 4952 | int dy = frame_line_height; |
| 4953 | /* In the below we divide the window box height by the | ||
| 4954 | frame's line height to make the result predictable when | ||
| 4955 | the window box is not an integral multiple of the line | ||
| 4956 | height. This is important to ensure we get back to the | ||
| 4957 | same position when scrolling up, then down. */ | ||
| 4953 | if (whole) | 4958 | if (whole) |
| 4954 | dy = max ((window_box_height (w) | 4959 | dy = max ((window_box_height (w) / dy |
| 4955 | - next_screen_context_lines * dy), | 4960 | - next_screen_context_lines) * dy, |
| 4956 | dy); | 4961 | dy); |
| 4957 | dy *= n; | 4962 | dy *= n; |
| 4958 | 4963 | ||
| @@ -5034,9 +5039,12 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, int noerror) | |||
| 5034 | { | 5039 | { |
| 5035 | ptrdiff_t start_pos = IT_CHARPOS (it); | 5040 | ptrdiff_t start_pos = IT_CHARPOS (it); |
| 5036 | int dy = frame_line_height; | 5041 | int dy = frame_line_height; |
| 5037 | 5042 | /* In the below we divide the window box height by the frame's | |
| 5038 | dy = max ((window_box_height (w) | 5043 | line height to make the result predictable when the window |
| 5039 | - next_screen_context_lines * dy), | 5044 | box is not an integral multiple of the line height. This is |
| 5045 | important to ensure we get back to the same position when | ||
| 5046 | scrolling up, then down. */ | ||
| 5047 | dy = max ((window_box_height (w) / dy - next_screen_context_lines) * dy, | ||
| 5040 | dy) * n; | 5048 | dy) * n; |
| 5041 | 5049 | ||
| 5042 | /* Note that move_it_vertically always moves the iterator to the | 5050 | /* Note that move_it_vertically always moves the iterator to the |