Skip to content
Snippets Groups Projects
Commit 4783947a authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

Rectangular mask hides all bins it has nonzero overlap with (#828)

parent 156b38a6
No related branches found
No related tags found
1 merge request!2164Detect almost any overlap of pixel and mask (#828)
...@@ -55,7 +55,8 @@ bool Rectangle::contains(double x, double y) const ...@@ -55,7 +55,8 @@ bool Rectangle::contains(double x, double y) const
bool Rectangle::contains(const Bin1D& binx, const Bin1D& biny) const bool Rectangle::contains(const Bin1D& binx, const Bin1D& biny) const
{ {
return contains(binx.center(), biny.center()); return m_inverted ^ (binx.upperBound() > m_xlow && binx.lowerBound() < m_xup &&
biny.upperBound() > m_ylow && biny.lowerBound() < m_yup);
} }
double Rectangle::getArea() const double Rectangle::getArea() const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment