Skip to content
Snippets Groups Projects
Commit abb925c7 authored by marco's avatar marco
Browse files

fix bug in within statement found by inspection

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2650 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 8180b6d0
No related branches found
No related tags found
No related merge requests found
...@@ -63,7 +63,7 @@ bool QueryState::do_within(const geom::Vec3& pos, const impl::WithinParam& p, ...@@ -63,7 +63,7 @@ bool QueryState::do_within(const geom::Vec3& pos, const impl::WithinParam& p,
if (op==COP_LE) if (op==COP_LE)
return geom::Dot(d, d) <= p.GetRadiusSquare(); return geom::Dot(d, d) <= p.GetRadiusSquare();
else else
return geom::Dot(d, d) >= p.GetRadiusSquare(); return geom::Dot(d, d) > p.GetRadiusSquare();
} else { } else {
const LazilyBoundRef& r=this->GetBoundObject(p.GetRef()); const LazilyBoundRef& r=this->GetBoundObject(p.GetRef());
for (AtomViewIter i=r.view.AtomsBegin(), e=r.view.AtomsEnd(); i!=e; ++i) { for (AtomViewIter i=r.view.AtomsBegin(), e=r.view.AtomsEnd(); i!=e; ++i) {
...@@ -72,7 +72,7 @@ bool QueryState::do_within(const geom::Vec3& pos, const impl::WithinParam& p, ...@@ -72,7 +72,7 @@ bool QueryState::do_within(const geom::Vec3& pos, const impl::WithinParam& p,
if (geom::Dot(d, d) <= p.GetRadiusSquare()) { if (geom::Dot(d, d) <= p.GetRadiusSquare()) {
return true; return true;
} }
} else if (geom::Dot(d, d) <= p.GetRadiusSquare()) { } else if (geom::Dot(d, d) > p.GetRadiusSquare()) {
return false; return false;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment