diff options
| author | Gerd Moellmann | 2000-04-26 17:43:04 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-04-26 17:43:04 +0000 |
| commit | e6819fafa388fa58b1754d5d3979fa45df69f279 (patch) | |
| tree | 50092f87734a39ac54fa20c8f4ebf0d480fcc609 /src | |
| parent | 138e541fe66054e57dbe9332cf6be36c72904bc2 (diff) | |
| download | emacs-e6819fafa388fa58b1754d5d3979fa45df69f279.tar.gz emacs-e6819fafa388fa58b1754d5d3979fa45df69f279.zip | |
(display_line): If lines are continued, restore
iterator's ascent/descent information to the values before the
first glyph not fitting on the line.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 43cfd556e39..0789230f010 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -11221,6 +11221,7 @@ display_line (it) | |||
| 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. */ |
| @@ -11249,6 +11250,17 @@ display_line (it) | |||
| 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 |
| @@ -11313,9 +11325,10 @@ display_line (it) | |||
| 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; |
| @@ -11339,7 +11352,15 @@ display_line (it) | |||
| 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) |