From 1938bc365db9cdcddbd4261740d9ce27c51700d1 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Tue, 20 Apr 2004 22:16:33 +0000 Subject: [PATCH] (image_ascent): Add slice arg; calculate ascent for image slice (or full image). --- src/image.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/image.c b/src/image.c index 66b004220d1..4c2bdb440e8 100644 --- a/src/image.c +++ b/src/image.c @@ -1076,13 +1076,21 @@ prepare_image_for_display (f, img) drawn in face FACE. */ int -image_ascent (img, face) +image_ascent (img, face, slice) struct image *img; struct face *face; + struct glyph_slice *slice; { - int height = img->height + img->vmargin; + int height; int ascent; + if (slice->height == img->height) + height = img->height + img->vmargin; + else if (slice->y == 0) + height = slice->height + img->vmargin; + else + height = slice->height; + if (img->ascent == CENTERED_IMAGE_ASCENT) { if (face->font) -- 2.39.5