

def isIntersecting(self, pp, symbol, iPoint, onY2, xBrush, yBrush, brushWidth, brushHeight):
    result = False
    p = symbol.getParent().getPoint(iPoint)
    x = p.getX()
    y = p.getY()
    xPx = pp.xToPixel(x)
    yPx = pp.yToPixel(y, onY2)
    dx = (xBrush - xPx)
    dy = (- (yBrush - yPx))
    rSquared = ((dx * dx) + (dy * dy))
    angle = self.angle(dx, dy)
    thetaMax = symbol.getPieSliceTheta0()
    thetaMin = symbol.getPieSliceTheta1()
    rPiePlus = (symbol.getPieSliceRadius(pp, onY2) + (0.5 * max(brushWidth, brushHeight)))
    '\n        * Enforce a minimum slice angle for hit testing\n        * purposes, equivalent to  +/- 1 px of play along the\n        * arcs of tiny slices, to make them easier to select:<p>\n        *\n        * <pre>\n        *   r*minDTheta = 1 px\n        * </pre>\n        *\n        * This helps with tiny slices adjacent to large ones, but if\n        * several tiny slices are adjacent to each other, or if both\n        * adjacent slices come after the tiny slice in the curve\n        * order (e.g. the tiny slice is the very first slice) it\n        * still won\'t be selectable. Developers can switch\n        * curve order to get around this, but it\'s not ideal.\n        * <p>\n        *\n        * TODO: Integrate a "closest to slice angle" criterion\n        * to resolve ties when hit testing slices to provide\n        * a better hit testing behavior with small or overlapping\n        * slices.\n        *\n        '
    minDTheta = (((rPiePlus < 1) and 1.0) or (1.0 / rPiePlus))
    if ((thetaMax - thetaMin) < (2 * minDTheta)):
        thetaMid = (0.5 * (thetaMax + thetaMin))
        thetaMin = (thetaMid - minDTheta)
        thetaMax = (thetaMid + minDTheta)
    if ((rSquared <= (rPiePlus * rPiePlus)) and self.angleInRange(yBrush, thetaMin, thetaMax)):
        result = True
    return result

dataset/ETHPy150Open anandology/pyjamas/library/gwt/chart/SymbolType.py PieSliceSymbolType.isIntersecting/VarMisuse@249/717 `angle`->`yBrush`