]> git.eshelyaron.com Git - emacs.git/commitdiff
(image_ascent): Add slice arg; calculate ascent for
authorKim F. Storm <storm@cua.dk>
Tue, 20 Apr 2004 22:16:33 +0000 (22:16 +0000)
committerKim F. Storm <storm@cua.dk>
Tue, 20 Apr 2004 22:16:33 +0000 (22:16 +0000)
image slice (or full image).

src/image.c

index 66b004220d147e4720e2396f7cb78674b19bcd1f..4c2bdb440e8254020658a0f10fac46fb61da7277 100644 (file)
@@ -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)