summaryrefslogtreecommitdiff
path: root/app/xtsscale
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2007-08-31 20:28:19 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2007-08-31 20:28:19 +0000
commit7f70e747437b5bcf5f52166b1671fc1cded20760 (patch)
treecadb4104c146584ebddd4ac658652ef12bbadcff /app/xtsscale
parente62463760ec0559eb4b6ba135985eea91e305ade (diff)
Fix error computation, in the case where one axis is inverted.
Diffstat (limited to 'app/xtsscale')
-rw-r--r--app/xtsscale/xtsscale.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/xtsscale/xtsscale.c b/app/xtsscale/xtsscale.c
index a3908b3fb..a91c92d69 100644
--- a/app/xtsscale/xtsscale.c
+++ b/app/xtsscale/xtsscale.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xtsscale.c,v 1.2 2007/08/30 19:45:25 matthieu Exp $ */
+/* $OpenBSD: xtsscale.c,v 1.3 2007/08/31 20:28:18 matthieu Exp $ */
/*
* Copyright (c) 2007 Robert Nagy <robert@openbsd.org>
*
@@ -368,7 +368,7 @@ calib:
a = (a1 + a2) / 2.0;
b = (b1 + b2) / 2.0;
xerr = a * width / 2 + b - x[2];
- if (fabs(xerr) > (a * width + b) * .01) {
+ if (fabs(xerr) > fabs(a * width * .01)) {
fprintf(stderr, "X error (%.2f) too high, try again\n",
fabs(xerr));
goto calib;
@@ -386,7 +386,7 @@ calib:
a = (a1 + a2) / 2.0;
b = (b1 + b2) / 2.0;
yerr = a * height / 2 + b - y[2];
- if (fabs(yerr) > (a * height + b) * 0.01) {
+ if (fabs(yerr) > fabs(a * height * 0.01)) {
fprintf(stderr, "Y error (%.2f) too high, try again\n",
fabs(yerr));
goto calib;