summaryrefslogtreecommitdiff
path: root/src/Stitch.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Stitch.cxx')
-rw-r--r--src/Stitch.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Stitch.cxx b/src/Stitch.cxx
index c0a770b..23558ef 100644
--- a/src/Stitch.cxx
+++ b/src/Stitch.cxx
@@ -17,6 +17,7 @@
#include "Stitch.H"
#define MIN(A,B) ((A)<(B)?(A):(B))
+#define MAX(A,B) ((A)>(B)?(A):(B))
#define MAX_VALUE 65025
static double pi_d = asin(1.0) * 2.0;
@@ -235,7 +236,7 @@ Stitch::color_correct(int c, double a, int pic, int color) {
V1 * a * a +
V2 * a * a * a * a);
- return (int) MIN(rint(cd), 65025.0);
+ return MAX(MIN((int) rint(cd), 65025), 0);
}
int