diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index dbc416afd9a..6efd0958002 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -19786,7 +19786,7 @@ produce_image_glyph (it) | |||
| 19786 | { | 19786 | { |
| 19787 | struct image *img; | 19787 | struct image *img; |
| 19788 | struct face *face; | 19788 | struct face *face; |
| 19789 | int glyph_ascent; | 19789 | int glyph_ascent, crop; |
| 19790 | struct glyph_slice slice; | 19790 | struct glyph_slice slice; |
| 19791 | 19791 | ||
| 19792 | xassert (it->what == IT_IMAGE); | 19792 | xassert (it->what == IT_IMAGE); |
| @@ -19894,6 +19894,15 @@ produce_image_glyph (it) | |||
| 19894 | 19894 | ||
| 19895 | take_vertical_position_into_account (it); | 19895 | take_vertical_position_into_account (it); |
| 19896 | 19896 | ||
| 19897 | /* Automatically crop wide image glyphs at right edge so we can | ||
| 19898 | draw the cursor on same display row. */ | ||
| 19899 | if ((crop = it->pixel_width - (it->last_visible_x - it->current_x), crop > 0) | ||
| 19900 | && (it->hpos == 0 || it->pixel_width > it->last_visible_x / 4)) | ||
| 19901 | { | ||
| 19902 | it->pixel_width -= crop; | ||
| 19903 | slice.width -= crop; | ||
| 19904 | } | ||
| 19905 | |||
| 19897 | if (it->glyph_row) | 19906 | if (it->glyph_row) |
| 19898 | { | 19907 | { |
| 19899 | struct glyph *glyph; | 19908 | struct glyph *glyph; |