comparison src/xterm.c @ 35276:008aea836cbc

(x_produce_image_glyph, x_draw_image_foreground) (x_draw_image_relief, x_draw_image_foreground_1) (x_draw_image_glyph_string): Adapt to the change of image margins.
author Gerd Moellmann <gerd@gnu.org>
date Fri, 12 Jan 2001 15:09:58 +0000
parents b179c9139145
children cb7e1d7b6b67
comparison
equal deleted inserted replaced
35275:38e58f530a1a 35276:008aea836cbc
1502 /* Make sure X resources of the face and image are loaded. */ 1502 /* Make sure X resources of the face and image are loaded. */
1503 PREPARE_FACE_FOR_DISPLAY (it->f, face); 1503 PREPARE_FACE_FOR_DISPLAY (it->f, face);
1504 prepare_image_for_display (it->f, img); 1504 prepare_image_for_display (it->f, img);
1505 1505
1506 it->ascent = it->phys_ascent = image_ascent (img, face); 1506 it->ascent = it->phys_ascent = image_ascent (img, face);
1507 it->descent = it->phys_descent = img->height + 2 * img->margin - it->ascent; 1507 it->descent = it->phys_descent = img->height + 2 * img->vmargin - it->ascent;
1508 it->pixel_width = img->width + 2 * img->margin; 1508 it->pixel_width = img->width + 2 * img->hmargin;
1509 1509
1510 it->nglyphs = 1; 1510 it->nglyphs = 1;
1511 1511
1512 if (face->box != FACE_NO_BOX) 1512 if (face->box != FACE_NO_BOX)
1513 { 1513 {
3842 else 3842 else
3843 x = s->x; 3843 x = s->x;
3844 3844
3845 /* If there is a margin around the image, adjust x- and y-position 3845 /* If there is a margin around the image, adjust x- and y-position
3846 by that margin. */ 3846 by that margin. */
3847 if (s->img->margin) 3847 x += s->img->hmargin;
3848 { 3848 y += s->img->vmargin;
3849 x += s->img->margin;
3850 y += s->img->margin;
3851 }
3852 3849
3853 if (s->img->pixmap) 3850 if (s->img->pixmap)
3854 { 3851 {
3855 if (s->img->mask) 3852 if (s->img->mask)
3856 { 3853 {
3931 else 3928 else
3932 x = s->x; 3929 x = s->x;
3933 3930
3934 /* If there is a margin around the image, adjust x- and y-position 3931 /* If there is a margin around the image, adjust x- and y-position
3935 by that margin. */ 3932 by that margin. */
3936 if (s->img->margin) 3933 x += s->img->hmargin;
3937 { 3934 y += s->img->vmargin;
3938 x += s->img->margin;
3939 y += s->img->margin;
3940 }
3941 3935
3942 if (s->hl == DRAW_IMAGE_SUNKEN 3936 if (s->hl == DRAW_IMAGE_SUNKEN
3943 || s->hl == DRAW_IMAGE_RAISED) 3937 || s->hl == DRAW_IMAGE_RAISED)
3944 { 3938 {
3945 thick = tool_bar_button_relief > 0 ? tool_bar_button_relief : 3; 3939 thick = tool_bar_button_relief > 0 ? tool_bar_button_relief : 3;
3980 else 3974 else
3981 x = 0; 3975 x = 0;
3982 3976
3983 /* If there is a margin around the image, adjust x- and y-position 3977 /* If there is a margin around the image, adjust x- and y-position
3984 by that margin. */ 3978 by that margin. */
3985 if (s->img->margin) 3979 x += s->img->hmargin;
3986 { 3980 y += s->img->vmargin;
3987 x += s->img->margin;
3988 y += s->img->margin;
3989 }
3990 3981
3991 if (s->img->pixmap) 3982 if (s->img->pixmap)
3992 { 3983 {
3993 if (s->img->mask) 3984 if (s->img->mask)
3994 { 3985 {
4072 x_draw_image_glyph_string (s) 4063 x_draw_image_glyph_string (s)
4073 struct glyph_string *s; 4064 struct glyph_string *s;
4074 { 4065 {
4075 int x, y; 4066 int x, y;
4076 int box_line_width = s->face->box_line_width; 4067 int box_line_width = s->face->box_line_width;
4077 int margin = s->img->margin;
4078 int height; 4068 int height;
4079 Pixmap pixmap = None; 4069 Pixmap pixmap = None;
4080 4070
4081 height = s->height - 2 * box_line_width; 4071 height = s->height - 2 * box_line_width;
4082 4072
4083 /* Fill background with face under the image. Do it only if row is 4073 /* Fill background with face under the image. Do it only if row is
4084 taller than image or if image has a clip mask to reduce 4074 taller than image or if image has a clip mask to reduce
4085 flickering. */ 4075 flickering. */
4086 s->stippled_p = s->face->stipple != 0; 4076 s->stippled_p = s->face->stipple != 0;
4087 if (height > s->img->height 4077 if (height > s->img->height
4088 || margin 4078 || s->img->hmargin
4079 || s->img->vmargin
4089 || s->img->mask 4080 || s->img->mask
4090 || s->img->pixmap == 0 4081 || s->img->pixmap == 0
4091 || s->width != s->background_width) 4082 || s->width != s->background_width)
4092 { 4083 {
4093 if (box_line_width && s->first_glyph->left_box_line_p) 4084 if (box_line_width && s->first_glyph->left_box_line_p)