comparison src/window.c @ 37305:8381b1ef7f3a

(window_scroll_pixel_based, Frecenter): Call window_box_height instead of using it.last_visible_y for the height of the window.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 10 Apr 2001 15:39:53 +0000
parents 9bf32a648127
children f028d889de06
comparison
equal deleted inserted replaced
37304:9ca19dfc32fb 37305:8381b1ef7f3a
3967 /* Move backward half the height of the window. Performance note: 3967 /* Move backward half the height of the window. Performance note:
3968 vmotion used here is about 10% faster, but would give wrong 3968 vmotion used here is about 10% faster, but would give wrong
3969 results for variable height lines. */ 3969 results for variable height lines. */
3970 init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID); 3970 init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);
3971 it.current_y = it.last_visible_y; 3971 it.current_y = it.last_visible_y;
3972 move_it_vertically (&it, -it.last_visible_y / 2); 3972 move_it_vertically (&it, - window_box_height (w) / 2);
3973 3973
3974 /* The function move_iterator_vertically may move over more than 3974 /* The function move_iterator_vertically may move over more than
3975 the specified y-distance. If it->w is small, e.g. a 3975 the specified y-distance. If it->w is small, e.g. a
3976 mini-buffer window, we may end up in front of the window's 3976 mini-buffer window, we may end up in front of the window's
3977 display area. This is the case when Start displaying at the 3977 display area. This is the case when Start displaying at the
4000 /* Move iterator it from start the specified distance forward or 4000 /* Move iterator it from start the specified distance forward or
4001 backward. The result is the new window start. */ 4001 backward. The result is the new window start. */
4002 start_display (&it, w, start); 4002 start_display (&it, w, start);
4003 if (whole) 4003 if (whole)
4004 { 4004 {
4005 int screen_full = (it.last_visible_y 4005 int screen_full = (window_box_height (w)
4006 - next_screen_context_lines * CANON_Y_UNIT (it.f)); 4006 - next_screen_context_lines * CANON_Y_UNIT (it.f));
4007 int direction = n < 0 ? -1 : 1; 4007 int direction = n < 0 ? -1 : 1;
4008 int dy = direction * screen_full; 4008 int dy = direction * screen_full;
4009 4009
4010 /* Note that move_it_vertically always moves the iterator to the 4010 /* Note that move_it_vertically always moves the iterator to the
4581 struct it it; 4581 struct it it;
4582 struct text_pos pt; 4582 struct text_pos pt;
4583 4583
4584 SET_TEXT_POS (pt, PT, PT_BYTE); 4584 SET_TEXT_POS (pt, PT, PT_BYTE);
4585 start_display (&it, w, pt); 4585 start_display (&it, w, pt);
4586 move_it_vertically (&it, - it.last_visible_y / 2); 4586 move_it_vertically (&it, - window_box_height (w) / 2);
4587 charpos = IT_CHARPOS (it); 4587 charpos = IT_CHARPOS (it);
4588 bytepos = IT_BYTEPOS (it); 4588 bytepos = IT_BYTEPOS (it);
4589 } 4589 }
4590 else if (XINT (arg) < 0) 4590 else if (XINT (arg) < 0)
4591 { 4591 {