diff options
author | Bert <ber.t@gmx.com> | 2011-01-26 14:59:32 +0100 |
---|---|---|
committer | Bert <ber.t@gmx.com> | 2011-01-26 14:59:32 +0100 |
commit | 7834dee6e726df88e82ddc5e4c015023a50ba109 (patch) | |
tree | 272cb49856d7089ac61a7e23abaa5700c6c8b8f0 /image.c | |
parent | 2bedd223149e44b8d9ef9a6f2bf07b8a088aabe3 (diff) | |
download | nsxiv-7834dee6e726df88e82ddc5e4c015023a50ba109.tar.zst |
Added a key-mapping for toggle anti-aliasing
Diffstat (limited to 'image.c')
-rw-r--r-- | image.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -33,8 +33,10 @@ void img_init(img_t *img, win_t *win) { zoom_min = zoom_levels[0] / 100.0; zoom_max = zoom_levels[zl_cnt - 1] / 100.0; - if (img) + if (img) { img->zoom = 1.0; + img->aa = 1; + } if (win) { imlib_context_set_display(win->env.dpy); @@ -63,6 +65,7 @@ int img_load(img_t *img, const char *filename) { } imlib_context_set_image(im); + imlib_context_set_anti_alias(img->aa); img->re = 0; img->checkpan = 0; @@ -272,3 +275,13 @@ int img_rotate_left(img_t *img, win_t *win) { int img_rotate_right(img_t *img, win_t *win) { return img_rotate(img, win, 1); } + +int img_toggle_antialias(img_t *img) { + if (!img) + return 0; + + img->aa ^= 1; + imlib_context_set_anti_alias(img->aa); + + return 1; +} |