From: Kim F. Storm Date: Tue, 20 Apr 2004 22:16:33 +0000 (+0000) Subject: (image_ascent): Add slice arg; calculate ascent for X-Git-Tag: ttn-vms-21-2-B4~6703 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1938bc365db9cdcddbd4261740d9ce27c51700d1;p=emacs.git (image_ascent): Add slice arg; calculate ascent for image slice (or full image). --- 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)