Пример #1
0
 int horizontalIntersect(double axisIntercept, double left, double right, bool flipped) {
     addHorizontalEndPoints(left, right, axisIntercept);
     double rootVals[2];
     int roots = horizontalIntersect(axisIntercept, rootVals);
     for (int index = 0; index < roots; ++index) {
         double quadT = rootVals[index];
         SkDPoint pt = quad.xyAtT(quadT);
         double lineT = (pt.fX - left) / (right - left);
         if (PinTs(&quadT, &lineT)) {
             intersections->insert(quadT, lineT, pt);
         }
     }
     if (flipped) {
         intersections->flip();
     }
     return intersections->used();
 }
Пример #2
0
int horizontalIntersect(double axisIntercept, double left, double right, bool flipped) {
    addHorizontalEndPoints(left, right, axisIntercept);
    double rootVals[2];
    int roots = horizontalIntersect(axisIntercept, rootVals);
    for (int index = 0; index < roots; ++index) {
        double x;
        double quadT = rootVals[index];
        xy_at_t(quad, quadT, x, *(double*) NULL);
        double lineT = (x - left) / (right - left);
        if (pinTs(quadT, lineT)) {
            intersections.insert(quadT, lineT);
        }
    }
    if (flipped) {
        flip();
    }
    return intersections.fUsed;
}