diff options
| author | Kim F. Storm | 2004-04-20 22:16:33 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2004-04-20 22:16:33 +0000 |
| commit | 1938bc365db9cdcddbd4261740d9ce27c51700d1 (patch) | |
| tree | f3bf70e929112d942e6f936f3c687041ffff84aa /src | |
| parent | cedd7cd9f175280c4da0a4d62d9e5fa484ce03e3 (diff) | |
| download | emacs-1938bc365db9cdcddbd4261740d9ce27c51700d1.tar.gz emacs-1938bc365db9cdcddbd4261740d9ce27c51700d1.zip | |
(image_ascent): Add slice arg; calculate ascent for
image slice (or full image).
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 12 |
1 files 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) | |||
| 1076 | drawn in face FACE. */ | 1076 | drawn in face FACE. */ |
| 1077 | 1077 | ||
| 1078 | int | 1078 | int |
| 1079 | image_ascent (img, face) | 1079 | image_ascent (img, face, slice) |
| 1080 | struct image *img; | 1080 | struct image *img; |
| 1081 | struct face *face; | 1081 | struct face *face; |
| 1082 | struct glyph_slice *slice; | ||
| 1082 | { | 1083 | { |
| 1083 | int height = img->height + img->vmargin; | 1084 | int height; |
| 1084 | int ascent; | 1085 | int ascent; |
| 1085 | 1086 | ||
| 1087 | if (slice->height == img->height) | ||
| 1088 | height = img->height + img->vmargin; | ||
| 1089 | else if (slice->y == 0) | ||
| 1090 | height = slice->height + img->vmargin; | ||
| 1091 | else | ||
| 1092 | height = slice->height; | ||
| 1093 | |||
| 1086 | if (img->ascent == CENTERED_IMAGE_ASCENT) | 1094 | if (img->ascent == CENTERED_IMAGE_ASCENT) |
| 1087 | { | 1095 | { |
| 1088 | if (face->font) | 1096 | if (face->font) |