summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/xdisp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 4e8bb7d9b97..f2b158f00e3 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -31956,12 +31956,14 @@ produce_image_glyph (struct it *it)
word-wrap, unless the image starts at column zero, because
wrapping correctly needs the real pixel width of the image. */
if ((it->line_wrap != WORD_WRAP
- || it->hpos == 0
+ || it->hpos == (0 + (it->lnum_width ? it->lnum_width + 2 : 0))
/* Always crop images larger than the window-width, minus 1 space. */
- || it->pixel_width > it->last_visible_x - FRAME_COLUMN_WIDTH (it->f))
+ || it->pixel_width > (it->last_visible_x - it->lnum_pixel_width
+ - FRAME_COLUMN_WIDTH (it->f)))
&& (crop = it->pixel_width - (it->last_visible_x - it->current_x),
crop > 0)
- && (it->hpos == 0 || it->pixel_width > it->last_visible_x / 4))
+ && (it->hpos == (0 + (it->lnum_width ? it->lnum_width + 2 : 0))
+ || it->pixel_width > it->last_visible_x / 4))
{
it->pixel_width -= crop;
slice.width -= crop;