Skip to content
Snippets Groups Projects
Commit 89f17786 authored by Harry Jeffery's avatar Harry Jeffery
Browse files

Merge pull request #721 from mantidproject/feature/11709_Lineviewer_handles

Feature/11709 lineviewer handles
parents b02a1a06 df466b78
No related branches found
No related tags found
No related merge requests found
......@@ -387,10 +387,21 @@ namespace SliceViewer
double distance = fabs( diff.x()*(current.y()-pixA.y()) - (current.x() - pixA.x())*diff.y() )
/ sqrt(diff.x()*diff.x() + diff.y()*diff.y());
// Margin of 6 pixels, and must be between the 2 limits
return ((distance < 7) &&
isBetween( current.x(), pixA.x(), pixB.x()) &&
isBetween( current.y(), pixA.y(), pixB.y()) );
// Margin of 6 pixels, and must be between the 2 limits (if the limits are not the same)
bool retval = false;
if (distance < 7)
{
retval = true;
if ((pixA.x() != pixB.x()) && (!isBetween( current.x(), pixA.x(), pixB.x())))
{
retval = false;
}
if ((pixA.y() != pixB.y()) && (!isBetween( current.y(), pixA.y(), pixB.y())))
{
retval = false;
}
}
return retval;
}
//-----------------------------------------------------------------------------------------------
......
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