Mercurial > emacs
comparison src/xdisp.c @ 28723:67ffd6aa22da
(display_line): If lines are continued, restore
iterator's ascent/descent information to the values before the
first glyph not fitting on the line.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 26 Apr 2000 17:43:04 +0000 |
parents | 7606937fa891 |
children | 60ee0a9fb323 |
comparison
equal
deleted
inserted
replaced
28722:a4c4a68597f5 | 28723:67ffd6aa22da |
---|---|
11219 character to display. */ | 11219 character to display. */ |
11220 while (1) | 11220 while (1) |
11221 { | 11221 { |
11222 int n_glyphs_before, hpos_before, x_before; | 11222 int n_glyphs_before, hpos_before, x_before; |
11223 int x, i, nglyphs; | 11223 int x, i, nglyphs; |
11224 int ascent, descent, phys_ascent, phys_descent; | |
11224 | 11225 |
11225 /* Retrieve the next thing to display. Value is zero if end of | 11226 /* Retrieve the next thing to display. Value is zero if end of |
11226 buffer reached. */ | 11227 buffer reached. */ |
11227 if (!get_next_display_element (it)) | 11228 if (!get_next_display_element (it)) |
11228 { | 11229 { |
11247 | 11248 |
11248 /* Now, get the metrics of what we want to display. This also | 11249 /* Now, get the metrics of what we want to display. This also |
11249 generates glyphs in `row' (which is IT->glyph_row). */ | 11250 generates glyphs in `row' (which is IT->glyph_row). */ |
11250 n_glyphs_before = row->used[TEXT_AREA]; | 11251 n_glyphs_before = row->used[TEXT_AREA]; |
11251 x = it->current_x; | 11252 x = it->current_x; |
11253 | |
11254 /* Remember the line height so far in case the next element doesn't | |
11255 fit on the line. */ | |
11256 if (!it->truncate_lines_p) | |
11257 { | |
11258 ascent = it->max_ascent; | |
11259 descent = it->max_descent; | |
11260 phys_ascent = it->max_phys_ascent; | |
11261 phys_descent = it->max_phys_descent; | |
11262 } | |
11263 | |
11252 PRODUCE_GLYPHS (it); | 11264 PRODUCE_GLYPHS (it); |
11253 | 11265 |
11254 /* If this display element was in marginal areas, continue with | 11266 /* If this display element was in marginal areas, continue with |
11255 the next one. */ | 11267 the next one. */ |
11256 if (it->area != TEXT_AREA) | 11268 if (it->area != TEXT_AREA) |
11311 | 11323 |
11312 if (it->hpos == 0 | 11324 if (it->hpos == 0 |
11313 || (new_x == it->last_visible_x | 11325 || (new_x == it->last_visible_x |
11314 && FRAME_WINDOW_P (it->f))) | 11326 && FRAME_WINDOW_P (it->f))) |
11315 { | 11327 { |
11316 /* Current glyph fits exactly on the line. We | 11328 /* Current glyph is the only one on the line or |
11317 must continue the line because we can't draw | 11329 fits exactly on the line. We must continue |
11318 the cursor after the glyph. */ | 11330 the line because we can't draw the cursor |
11331 after the glyph. */ | |
11319 row->continued_p = 1; | 11332 row->continued_p = 1; |
11320 it->current_x = new_x; | 11333 it->current_x = new_x; |
11321 it->continuation_lines_width += new_x; | 11334 it->continuation_lines_width += new_x; |
11322 ++it->hpos; | 11335 ++it->hpos; |
11323 if (i == nglyphs - 1) | 11336 if (i == nglyphs - 1) |
11337 produce_special_glyphs (it, IT_CONTINUATION); | 11350 produce_special_glyphs (it, IT_CONTINUATION); |
11338 row->continued_p = 1; | 11351 row->continued_p = 1; |
11339 | 11352 |
11340 it->current_x = x; | 11353 it->current_x = x; |
11341 it->continuation_lines_width += x; | 11354 it->continuation_lines_width += x; |
11355 | |
11356 /* Restore the height to what it was before the | |
11357 element not fitting on the line. */ | |
11358 it->max_ascent = ascent; | |
11359 it->max_descent = descent; | |
11360 it->max_phys_ascent = phys_ascent; | |
11361 it->max_phys_descent = phys_descent; | |
11342 } | 11362 } |
11363 | |
11343 break; | 11364 break; |
11344 } | 11365 } |
11345 else if (new_x > it->first_visible_x) | 11366 else if (new_x > it->first_visible_x) |
11346 { | 11367 { |
11347 /* Increment number of glyphs actually displayed. */ | 11368 /* Increment number of glyphs actually displayed. */ |