summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2022-10-11 10:04:10 +0200
committerJaron Kent-Dobias <jaron@kent-dobias.com>2022-10-11 10:04:10 +0200
commit64a771aa19423d96bb72251eb209d50eb1f13f08 (patch)
tree4972e5f3985da54b333d72ebcf9925cc03b3a04e
parent766988cd11eda0d62689e6c4adc021a3d2d4f567 (diff)
downloadcode-64a771aa19423d96bb72251eb209d50eb1f13f08.tar.gz
code-64a771aa19423d96bb72251eb209d50eb1f13f08.tar.bz2
code-64a771aa19423d96bb72251eb209d50eb1f13f08.zip
Stop zero weights.
-rw-r--r--rbmp.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/rbmp.hpp b/rbmp.hpp
index 4cd6605..88f5900 100644
--- a/rbmp.hpp
+++ b/rbmp.hpp
@@ -80,7 +80,7 @@ public:
Real y = e3.weights.top();
Real z = e4.weights.top();
- Real cellFactor = w * z + x * y;
+ Real cellFactor = std::max(std::numeric_limits<Real>::min(), w * z + x * y);
e1.weights.push(z / cellFactor);
e2.weights.push(y / cellFactor);