diff options
| author | Kim F. Storm | 2006-09-14 09:37:44 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2006-09-14 09:37:44 +0000 |
| commit | 50f814f59db0d3169a7bb60e4b570b0635d2bfec (patch) | |
| tree | c7f33d78edacbd0cf920ebe4cc96dad1c9498874 | |
| parent | 84be646fde59ee928abc9ef97707567ab1e3ef9b (diff) | |
| download | emacs-50f814f59db0d3169a7bb60e4b570b0635d2bfec.tar.gz emacs-50f814f59db0d3169a7bb60e4b570b0635d2bfec.zip | |
(produce_image_glyph): Automatically crop wide images at
right window edge so we can draw the cursor on the same row to
avoid confusing redisplay by placing the cursor outside the visible
window area.
| -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; |