summaryrefslogtreecommitdiffstats
path: root/image.c
diff options
context:
space:
mode:
authorBert Münnich <be.muennich@googlemail.com>2012-08-16 21:21:08 +0200
committerBert Münnich <be.muennich@googlemail.com>2012-08-16 21:21:08 +0200
commitc78f55ebb43f5d73033a4709dfd32830a016a7cb (patch)
tree3af9b18cc92d43cad0e751eab296dcf0a09f3baa /image.c
parentf2a3d73212ad63e1081278347c189f2554cab8a4 (diff)
downloadnsxiv-c78f55ebb43f5d73033a4709dfd32830a016a7cb.tar.zst
Simplified zoomdiff function
Diffstat (limited to 'image.c')
-rw-r--r--image.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/image.c b/image.c
index 52696ca..cf4ec35 100644
--- a/image.c
+++ b/image.c
@@ -37,13 +37,7 @@ float zoom_min;
float zoom_max;
int zoomdiff(float z1, float z2) {
- float d = z1 - z2;
- const float mindelta = 0.001;
-
- if (ABS(d) < mindelta)
- return 0;
- else
- return d < 0 ? -1 : 1;
+ return (int) (z1 * 1000.0 - z2 * 1000.0);
}
void img_init(img_t *img, win_t *win) {