From a2339e70fdac1db7453cb008c4e37acdb5468f02 Mon Sep 17 00:00:00 2001 From: Lu Xu Date: Sat, 25 Sep 2021 08:10:29 +0300 Subject: Use zoom steps instead of hard-coding levels (#92) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: NRK Co-authored-by: Berke Kocaoğlu --- nsxiv.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'nsxiv.h') diff --git a/nsxiv.h b/nsxiv.h index be7ffe6..c148b24 100644 --- a/nsxiv.h +++ b/nsxiv.h @@ -39,6 +39,9 @@ #ifndef MAX #define MAX(a,b) ((a) > (b) ? (a) : (b)) #endif +#ifndef ABS +#define ABS(a) ((a) > 0 ? (a) : -(a)) +#endif #define ARRLEN(a) (sizeof(a) / sizeof((a)[0])) @@ -246,9 +249,8 @@ bool img_load(img_t*, const fileinfo_t*); CLEANUP void img_close(img_t*, bool); void img_render(img_t*); bool img_fit_win(img_t*, scalemode_t); -bool img_zoom(img_t*, float); -bool img_zoom_in(img_t*); -bool img_zoom_out(img_t*); +bool img_zoom(img_t*, int); +bool img_zoom_to(img_t*, float); bool img_pos(img_t*, float, float); bool img_move(img_t*, float, float); bool img_pan(img_t*, direction_t, int); -- cgit v1.2.3