Krolyxon
Commit c78f55e

Branches

Refs →

nsxivc78f55e

Simplified zoomdiff function

Author
Bert Münnich
Date
2012-08-16 21:21 +0200
Parent
f2a3d73
Commit
c78f55ebb43f5d73033a4709dfd32830a016a7cb

+1 −10

2 files changed

  1. M image.c +1 −7
  2. M util.h +0 −3
M image.c View
@@ -37,13 +37,7 @@ float zoom_min;
3737 float zoom_max;
3838
3939 int zoomdiff(float z1, float z2) {
40− float d = z1 - z2;
41− const float mindelta = 0.001;
42−
43− if (ABS(d) < mindelta)
44− return 0;
45− else
46− return d < 0 ? -1 : 1;
40+ return (int) (z1 * 1000.0 - z2 * 1000.0);
4741 }
4842
4943 void img_init(img_t *img, win_t *win) {
M util.h View
@@ -27,9 +27,6 @@
2727
2828 #include "types.h"
2929
30−#ifndef ABS
31−#define ABS(a) ((a) < 0 ? -(a) : (a))
32−#endif
3330 #ifndef MIN
3431 #define MIN(a,b) ((a) < (b) ? (a) : (b))
3532 #endif