boolean (int upPosition, int downPosition, int x, int y, int rowHeight, int nodeWidth, float lineThickness) { int x1 = nodeWidth * downPosition + nodeWidth / 2; int y1 = rowHeight / 2; int x2 = nodeWidth * upPosition + nodeWidth / 2; int y2 = -rowHeight / 2; //return true; return (distance(x1, y1, x, y) + distance(x2, y2, x, y) < distance(x1, y1, x2, y2) + lineThickness); }