diff src/image.c @ 55022:dda0bae93c73

(image_ascent): Add slice arg; calculate ascent for image slice (or full image).
author Kim F. Storm <storm@cua.dk>
date Tue, 20 Apr 2004 22:16:33 +0000
parents 38cb79e68369
children b9215c2d57ad
line wrap: on
line diff
--- a/src/image.c	Tue Apr 20 22:16:19 2004 +0000
+++ b/src/image.c	Tue Apr 20 22:16:33 2004 +0000
@@ -1076,13 +1076,21 @@
    drawn in face FACE.  */
 
 int
-image_ascent (img, face)
+image_ascent (img, face, slice)
      struct image *img;
      struct face *face;
-{
-  int height = img->height + img->vmargin;
+     struct glyph_slice *slice;
+{
+  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)