mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-15 19:16:40 +01:00
libcanvas: FramedCanvas::covers() method is ill-conceived. Use PolyItem::covers()
This commit is contained in:
parent
9e754959f6
commit
ef07fb601a
2 changed files with 0 additions and 22 deletions
|
|
@ -289,24 +289,3 @@ FramedCurve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) c
|
|||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
FramedCurve::covers (Duple const & pc) const
|
||||
{
|
||||
Duple point = window_to_item (pc);
|
||||
|
||||
/* O(N) N = number of points, and not accurate */
|
||||
|
||||
for (Points::const_iterator p = _points.begin(); p != _points.end(); ++p) {
|
||||
|
||||
const Coord dx = point.x - (*p).x;
|
||||
const Coord dy = point.y - (*p).y;
|
||||
const Coord dx2 = dx * dx;
|
||||
const Coord dy2 = dy * dy;
|
||||
|
||||
if ((dx2 < 2.0 && dy2 < 2.0) || (dx2 + dy2 < 4.0)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue