# HG changeset patch # User Miles Bader # Date 970723273 0 # Node ID 0abb3c153331615db0cd04a283557933eaceeeb8 # Parent 37dfd66f0cd2b7f09f4a11fcf1991beab2db0980 (image_ascent): Rearrange ascent calculation for the has-a-font case. diff -r 37dfd66f0cd2 -r 0abb3c153331 src/xfns.c --- a/src/xfns.c Thu Oct 05 02:48:41 2000 +0000 +++ b/src/xfns.c Thu Oct 05 05:21:13 2000 +0000 @@ -5526,7 +5526,12 @@ if (img->ascent == CENTERED_IMAGE_ASCENT) { if (face->font) - ascent = height / 2 - (face->font->descent - face->font->ascent) / 2; + /* This expression is arranged so that if the image can't be + exactly centered, it will be moved slightly up. This is + because a typical font is `top-heavy' (due to the presence + uppercase letters), so the image placement should err towards + being top-heavy too. It also just generally looks better. */ + ascent = (height + face->font->ascent - face->font->descent + 1) / 2; else ascent = height / 2; }