Skip to content
Browse files

Simplified zoomdiff function

  • Loading branch information...
1 parent f2a3d73 commit c78f55ebb43f5d73033a4709dfd32830a016a7cb @muennich committed Aug 16, 2012
Showing with 1 addition and 10 deletions.
  1. +1 −7 image.c
  2. +0 −3 util.h
View
8 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) {
View
3 util.h
@@ -27,9 +27,6 @@
#include "types.h"
-#ifndef ABS
-#define ABS(a) ((a) < 0 ? -(a) : (a))
-#endif
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif

0 comments on commit c78f55e

Please sign in to comment.
Something went wrong with that request. Please try again.