summaryrefslogtreecommitdiff
path: root/src/func.cc
diff options
context:
space:
mode:
authorNateTG <nate-github@pedantic.org>2013-05-09 14:40:01 (GMT)
committerNateTG <nate-github@pedantic.org>2013-05-09 14:40:01 (GMT)
commit715d539f4ea1a37833ab2429262593aee57304fe (patch)
tree7e79e708bb407f7aff357731209092028ca198b1 /src/func.cc
parent6ee78e7f68e70f121625327aa97f979551e692b3 (diff)
Update func.cc
Fix for https://github.com/openscad/openscad/issues/322
Diffstat (limited to 'src/func.cc')
-rw-r--r--src/func.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/func.cc b/src/func.cc
index 4377a90..8675963 100644
--- a/src/func.cc
+++ b/src/func.cc
@@ -355,9 +355,9 @@ Value builtin_lookup(const Context *, const EvalContext *evalctx)
}
}
if (p <= low_p)
- return Value(low_v);
- if (p >= high_p)
return Value(high_v);
+ if (p >= high_p)
+ return Value(low_v);
double f = (p-low_p) / (high_p-low_p);
return Value(high_v * f + low_v * (1-f));
}
contact: Jan Huwald // Impressum