summaryrefslogtreecommitdiffstats
path: root/image.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-03-10 11:41:40 +0100
committerBert <ber.t@gmx.com>2011-03-10 11:41:40 +0100
commit3672c0bc636aa82f8fc38aa75f226915686d0bd3 (patch)
tree3ce1e2ae7c62498e252cd68fee5408da5dd12aa0 /image.c
parentd982b06eed04cb080a4dd730b75f93285d5b159b (diff)
downloadnsxiv-3672c0bc636aa82f8fc38aa75f226915686d0bd3.tar.zst
Toggle image transparency with A-key
Diffstat (limited to 'image.c')
-rw-r--r--image.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/image.c b/image.c
index 854e50b..4245993 100644
--- a/image.c
+++ b/image.c
@@ -43,6 +43,7 @@ void img_init(img_t *img, win_t *win) {
img->zoom = MAX(img->zoom, zoom_min);
img->zoom = MIN(img->zoom, zoom_max);
img->aa = options->aa;
+ img->alpha = 1;
}
if (win) {
@@ -211,7 +212,7 @@ void img_render(img_t *img, win_t *win) {
else
imlib_context_set_image(im_broken);
- if (imlib_image_has_alpha())
+ if (imlib_image_has_alpha() && !img->alpha)
win_draw_rect(win, win->pm, dx, dy, dw, dh, True, 0, win->white);
imlib_context_set_drawable(win->pm);