Mercurial > emacs
comparison src/xterm.c @ 45197:0b6da8b7d7ac
(x_draw_image_foreground, x_draw_image_foreground_1):
Enlarge cursor rectangle drawn around image with non-zero relief.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Wed, 08 May 2002 21:32:00 +0000 |
parents | cc9283570d1b |
children | adebb58b0c5e |
comparison
equal
deleted
inserted
replaced
45196:fb8359237a78 | 45197:0b6da8b7d7ac |
---|---|
4114 be visible. If the image doesn't have a mask, make | 4114 be visible. If the image doesn't have a mask, make |
4115 a block cursor visible by drawing a rectangle around | 4115 a block cursor visible by drawing a rectangle around |
4116 the image. I believe it's looking better if we do | 4116 the image. I believe it's looking better if we do |
4117 nothing here for mouse-face. */ | 4117 nothing here for mouse-face. */ |
4118 if (s->hl == DRAW_CURSOR) | 4118 if (s->hl == DRAW_CURSOR) |
4119 XDrawRectangle (s->display, s->window, s->gc, x, y, | 4119 { |
4120 s->img->width - 1, s->img->height - 1); | 4120 int r = s->img->relief; |
4121 if (r < 0) r = -r; | |
4122 XDrawRectangle (s->display, s->window, s->gc, x - r, y - r, | |
4123 s->img->width + r*2 - 1, s->img->height + r*2 - 1); | |
4124 } | |
4121 } | 4125 } |
4122 } | 4126 } |
4123 else | 4127 else |
4124 /* Draw a rectangle if image could not be loaded. */ | 4128 /* Draw a rectangle if image could not be loaded. */ |
4125 XDrawRectangle (s->display, s->window, s->gc, x, y, | 4129 XDrawRectangle (s->display, s->window, s->gc, x, y, |
4230 be visible. If the image doesn't have a mask, make | 4234 be visible. If the image doesn't have a mask, make |
4231 a block cursor visible by drawing a rectangle around | 4235 a block cursor visible by drawing a rectangle around |
4232 the image. I believe it's looking better if we do | 4236 the image. I believe it's looking better if we do |
4233 nothing here for mouse-face. */ | 4237 nothing here for mouse-face. */ |
4234 if (s->hl == DRAW_CURSOR) | 4238 if (s->hl == DRAW_CURSOR) |
4235 XDrawRectangle (s->display, pixmap, s->gc, x, y, | 4239 { |
4236 s->img->width - 1, s->img->height - 1); | 4240 int r = s->img->relief; |
4241 if (r < 0) r = -r; | |
4242 XDrawRectangle (s->display, s->window, s->gc, x - r, y - r, | |
4243 s->img->width + r*2 - 1, s->img->height + r*2 - 1); | |
4244 } | |
4237 } | 4245 } |
4238 } | 4246 } |
4239 else | 4247 else |
4240 /* Draw a rectangle if image could not be loaded. */ | 4248 /* Draw a rectangle if image could not be loaded. */ |
4241 XDrawRectangle (s->display, pixmap, s->gc, x, y, | 4249 XDrawRectangle (s->display, pixmap, s->gc, x, y, |