2075 |
* FRAME_LINE_HEIGHT (it->f)); |
* FRAME_LINE_HEIGHT (it->f)); |
2076 |
else if (it->f->extra_line_spacing > 0) |
else if (it->f->extra_line_spacing > 0) |
2077 |
it->extra_line_spacing = it->f->extra_line_spacing; |
it->extra_line_spacing = it->f->extra_line_spacing; |
2078 |
|
it->max_extra_line_spacing = 0; |
2079 |
} |
} |
2080 |
|
|
2081 |
/* If realized faces have been removed, e.g. because of face |
/* If realized faces have been removed, e.g. because of face |
6068 |
{ |
{ |
6069 |
int nlines, h; |
int nlines, h; |
6070 |
struct it it2, it3; |
struct it it2, it3; |
6071 |
int start_pos = IT_CHARPOS (*it); |
int start_pos; |
6072 |
|
|
6073 |
|
move_further_back: |
6074 |
xassert (dy >= 0); |
xassert (dy >= 0); |
6075 |
|
|
6076 |
|
start_pos = IT_CHARPOS (*it); |
6077 |
|
|
6078 |
/* Estimate how many newlines we must move back. */ |
/* Estimate how many newlines we must move back. */ |
6079 |
nlines = max (1, dy / FRAME_LINE_HEIGHT (it->f)); |
nlines = max (1, dy / FRAME_LINE_HEIGHT (it->f)); |
6080 |
|
|
6140 |
a line height of 13 pixels each, recentering with point |
a line height of 13 pixels each, recentering with point |
6141 |
on the bottom line will try to move -39/2 = 19 pixels |
on the bottom line will try to move -39/2 = 19 pixels |
6142 |
backward. Try to avoid moving into the first line. */ |
backward. Try to avoid moving into the first line. */ |
6143 |
&& it->current_y - target_y > line_height / 3 * 2 |
&& it->current_y - target_y > line_height * 2 / 3 |
6144 |
&& IT_CHARPOS (*it) > BEGV) |
&& IT_CHARPOS (*it) > BEGV) |
6145 |
{ |
{ |
6146 |
TRACE_MOVE ((stderr, " not far enough -> move_vert %d\n", |
TRACE_MOVE ((stderr, " not far enough -> move_vert %d\n", |
6147 |
target_y - it->current_y)); |
target_y - it->current_y)); |
6148 |
move_it_vertically (it, target_y - it->current_y); |
dy = it->current_y - target_y; |
6149 |
xassert (IT_CHARPOS (*it) >= BEGV); |
goto move_further_back; |
6150 |
} |
} |
6151 |
else if (target_y >= it->current_y + line_height |
else if (target_y >= it->current_y + line_height |
6152 |
&& IT_CHARPOS (*it) < ZV) |
&& IT_CHARPOS (*it) < ZV) |
6187 |
{ |
{ |
6188 |
if (dy <= 0) |
if (dy <= 0) |
6189 |
move_it_vertically_backward (it, -dy); |
move_it_vertically_backward (it, -dy); |
6190 |
else if (dy > 0) |
else |
6191 |
{ |
{ |
6192 |
TRACE_MOVE ((stderr, "move_it_v: from %d, %d\n", IT_CHARPOS (*it), dy)); |
TRACE_MOVE ((stderr, "move_it_v: from %d, %d\n", IT_CHARPOS (*it), dy)); |
6193 |
move_it_to (it, ZV, -1, it->current_y + dy, -1, |
move_it_to (it, ZV, -1, it->current_y + dy, -1, |
6284 |
/* DVPOS == 0 means move to the start of the screen line. */ |
/* DVPOS == 0 means move to the start of the screen line. */ |
6285 |
move_it_vertically_backward (it, 0); |
move_it_vertically_backward (it, 0); |
6286 |
xassert (it->current_x == 0 && it->hpos == 0); |
xassert (it->current_x == 0 && it->hpos == 0); |
6287 |
|
/* Let next call to line_bottom_y calculate real line height */ |
6288 |
|
last_height = 0; |
6289 |
} |
} |
6290 |
else if (dvpos > 0) |
else if (dvpos > 0) |
6291 |
move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS); |
move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS); |
7429 |
height = it.current_y + last_height; |
height = it.current_y + last_height; |
7430 |
else |
else |
7431 |
height = it.current_y + it.max_ascent + it.max_descent; |
height = it.current_y + it.max_ascent + it.max_descent; |
7432 |
height -= it.extra_line_spacing; |
height -= min (it.extra_line_spacing, it.max_extra_line_spacing); |
7433 |
height = (height + unit - 1) / unit; |
height = (height + unit - 1) / unit; |
7434 |
} |
} |
7435 |
|
|
8707 |
{ |
{ |
8708 |
row->height = row->phys_height = it->last_visible_y - row->y; |
row->height = row->phys_height = it->last_visible_y - row->y; |
8709 |
row->ascent = row->phys_ascent = 0; |
row->ascent = row->phys_ascent = 0; |
8710 |
|
row->extra_line_spacing = 0; |
8711 |
} |
} |
8712 |
|
|
8713 |
row->full_width_p = 1; |
row->full_width_p = 1; |
10896 |
row = MATRIX_ROW (matrix, w->cursor.vpos); |
row = MATRIX_ROW (matrix, w->cursor.vpos); |
10897 |
|
|
10898 |
/* If the cursor row is not partially visible, there's nothing to do. */ |
/* If the cursor row is not partially visible, there's nothing to do. */ |
10899 |
if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (row)) |
if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)) |
10900 |
return 1; |
return 1; |
10901 |
|
|
10902 |
/* If the row the cursor is in is taller than the window's height, |
/* If the row the cursor is in is taller than the window's height, |
11050 |
{ |
{ |
11051 |
start_display (&it, w, scroll_margin_pos); |
start_display (&it, w, scroll_margin_pos); |
11052 |
if (this_scroll_margin) |
if (this_scroll_margin) |
11053 |
move_it_vertically (&it, - this_scroll_margin); |
move_it_vertically_backward (&it, this_scroll_margin); |
11054 |
if (extra_scroll_margin_lines) |
if (extra_scroll_margin_lines) |
11055 |
move_it_by_lines (&it, - extra_scroll_margin_lines, 0); |
move_it_by_lines (&it, - extra_scroll_margin_lines, 0); |
11056 |
scroll_margin_pos = it.current.pos; |
scroll_margin_pos = it.current.pos; |
11170 |
if (amount_to_scroll <= 0) |
if (amount_to_scroll <= 0) |
11171 |
return SCROLLING_FAILED; |
return SCROLLING_FAILED; |
11172 |
|
|
11173 |
move_it_vertically (&it, - amount_to_scroll); |
move_it_vertically_backward (&it, amount_to_scroll); |
11174 |
startp = it.current.pos; |
startp = it.current.pos; |
11175 |
} |
} |
11176 |
} |
} |
11474 |
/* if PT is not in the glyph row, give up. */ |
/* if PT is not in the glyph row, give up. */ |
11475 |
rc = CURSOR_MOVEMENT_MUST_SCROLL; |
rc = CURSOR_MOVEMENT_MUST_SCROLL; |
11476 |
} |
} |
11477 |
else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (row)) |
else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)) |
11478 |
{ |
{ |
11479 |
if (PT == MATRIX_ROW_END_CHARPOS (row) |
if (PT == MATRIX_ROW_END_CHARPOS (row) |
11480 |
&& !row->ends_at_zv_p |
&& !row->ends_at_zv_p |
12049 |
if (it.current_y <= 0) |
if (it.current_y <= 0) |
12050 |
{ |
{ |
12051 |
init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID); |
init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID); |
12052 |
move_it_vertically (&it, 0); |
move_it_vertically_backward (&it, 0); |
12053 |
xassert (IT_CHARPOS (it) <= PT); |
xassert (IT_CHARPOS (it) <= PT); |
12054 |
it.current_y = 0; |
it.current_y = 0; |
12055 |
} |
} |
12398 |
/* Give up if old or new display is scrolled vertically. We could |
/* Give up if old or new display is scrolled vertically. We could |
12399 |
make this function handle this, but right now it doesn't. */ |
make this function handle this, but right now it doesn't. */ |
12400 |
start_row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); |
start_row = MATRIX_FIRST_TEXT_ROW (w->current_matrix); |
12401 |
if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (start_row)) |
if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row)) |
12402 |
return 0; |
return 0; |
12403 |
|
|
12404 |
/* The variable new_start now holds the new window start. The old |
/* The variable new_start now holds the new window start. The old |
12446 |
start = start_row->start.pos; |
start = start_row->start.pos; |
12447 |
/* If there are no more rows to try, or just one, give up. */ |
/* If there are no more rows to try, or just one, give up. */ |
12448 |
if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1 |
if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1 |
12449 |
|| w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (start_row) |
|| w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row) |
12450 |
|| CHARPOS (start) == ZV) |
|| CHARPOS (start) == ZV) |
12451 |
{ |
{ |
12452 |
clear_glyph_matrix (w->desired_matrix); |
clear_glyph_matrix (w->desired_matrix); |
14240 |
row->height = it->max_ascent + it->max_descent; |
row->height = it->max_ascent + it->max_descent; |
14241 |
row->phys_ascent = it->max_phys_ascent; |
row->phys_ascent = it->max_phys_ascent; |
14242 |
row->phys_height = it->max_phys_ascent + it->max_phys_descent; |
row->phys_height = it->max_phys_ascent + it->max_phys_descent; |
14243 |
|
row->extra_line_spacing = it->max_extra_line_spacing; |
14244 |
} |
} |
14245 |
|
|
14246 |
/* Compute the width of this line. */ |
/* Compute the width of this line. */ |
14284 |
row->pixel_width -= it->truncation_pixel_width; |
row->pixel_width -= it->truncation_pixel_width; |
14285 |
row->ascent = row->phys_ascent = 0; |
row->ascent = row->phys_ascent = 0; |
14286 |
row->height = row->phys_height = row->visible_height = 1; |
row->height = row->phys_height = row->visible_height = 1; |
14287 |
|
row->extra_line_spacing = 0; |
14288 |
} |
} |
14289 |
|
|
14290 |
/* Compute a hash code for this row. */ |
/* Compute a hash code for this row. */ |
14621 |
row->height = it->max_ascent + it->max_descent; |
row->height = it->max_ascent + it->max_descent; |
14622 |
row->phys_ascent = it->max_phys_ascent; |
row->phys_ascent = it->max_phys_ascent; |
14623 |
row->phys_height = it->max_phys_ascent + it->max_phys_descent; |
row->phys_height = it->max_phys_ascent + it->max_phys_descent; |
14624 |
|
row->extra_line_spacing = it->max_extra_line_spacing; |
14625 |
|
|
14626 |
/* Loop generating characters. The loop is left with IT on the next |
/* Loop generating characters. The loop is left with IT on the next |
14627 |
character to display. */ |
character to display. */ |
14687 |
row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); |
row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); |
14688 |
row->phys_height = max (row->phys_height, |
row->phys_height = max (row->phys_height, |
14689 |
it->max_phys_ascent + it->max_phys_descent); |
it->max_phys_ascent + it->max_phys_descent); |
14690 |
|
row->extra_line_spacing = max (row->extra_line_spacing, |
14691 |
|
it->max_extra_line_spacing); |
14692 |
set_iterator_to_next (it, 1); |
set_iterator_to_next (it, 1); |
14693 |
continue; |
continue; |
14694 |
} |
} |
14717 |
row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); |
row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); |
14718 |
row->phys_height = max (row->phys_height, |
row->phys_height = max (row->phys_height, |
14719 |
it->max_phys_ascent + it->max_phys_descent); |
it->max_phys_ascent + it->max_phys_descent); |
14720 |
|
row->extra_line_spacing = max (row->extra_line_spacing, |
14721 |
|
it->max_extra_line_spacing); |
14722 |
if (it->current_x - it->pixel_width < it->first_visible_x) |
if (it->current_x - it->pixel_width < it->first_visible_x) |
14723 |
row->x = x - it->first_visible_x; |
row->x = x - it->first_visible_x; |
14724 |
} |
} |
14870 |
row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); |
row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); |
14871 |
row->phys_height = max (row->phys_height, |
row->phys_height = max (row->phys_height, |
14872 |
it->max_phys_ascent + it->max_phys_descent); |
it->max_phys_ascent + it->max_phys_descent); |
14873 |
|
row->extra_line_spacing = max (row->extra_line_spacing, |
14874 |
|
it->max_extra_line_spacing); |
14875 |
|
|
14876 |
/* End of this display line if row is continued. */ |
/* End of this display line if row is continued. */ |
14877 |
if (row->continued_p || row->ends_at_zv_p) |
if (row->continued_p || row->ends_at_zv_p) |
16783 |
row->height = it->max_ascent + it->max_descent; |
row->height = it->max_ascent + it->max_descent; |
16784 |
row->phys_ascent = it->max_phys_ascent; |
row->phys_ascent = it->max_phys_ascent; |
16785 |
row->phys_height = it->max_phys_ascent + it->max_phys_descent; |
row->phys_height = it->max_phys_ascent + it->max_phys_descent; |
16786 |
|
row->extra_line_spacing = it->max_extra_line_spacing; |
16787 |
|
|
16788 |
/* This condition is for the case that we are called with current_x |
/* This condition is for the case that we are called with current_x |
16789 |
past last_visible_x. */ |
past last_visible_x. */ |
16843 |
row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); |
row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent); |
16844 |
row->phys_height = max (row->phys_height, |
row->phys_height = max (row->phys_height, |
16845 |
it->max_phys_ascent + it->max_phys_descent); |
it->max_phys_ascent + it->max_phys_descent); |
16846 |
|
row->extra_line_spacing = max (row->extra_line_spacing, |
16847 |
|
it->max_extra_line_spacing); |
16848 |
x += glyph->pixel_width; |
x += glyph->pixel_width; |
16849 |
++i; |
++i; |
16850 |
} |
} |
19467 |
it->current_x += it->pixel_width; |
it->current_x += it->pixel_width; |
19468 |
|
|
19469 |
if (extra_line_spacing > 0) |
if (extra_line_spacing > 0) |
19470 |
it->descent += extra_line_spacing; |
{ |
19471 |
|
it->descent += extra_line_spacing; |
19472 |
|
if (extra_line_spacing > it->max_extra_line_spacing) |
19473 |
|
it->max_extra_line_spacing = extra_line_spacing; |
19474 |
|
} |
19475 |
|
|
19476 |
it->max_ascent = max (it->max_ascent, it->ascent); |
it->max_ascent = max (it->max_ascent, it->ascent); |
19477 |
it->max_descent = max (it->max_descent, it->descent); |
it->max_descent = max (it->max_descent, it->descent); |