private void addEdgeToScanbuf(ScanBuf pScanBuf, EdgeCrossing from,
    EdgeCrossing to)
  {
    int lAngleFrom = (int)from.getAngle();
    double lXFrom = fProjection.finalizeX(from.getX());
    double lYFrom = fProjection.finalizeY(from.getY());

    // Step around in 90 degree increments until target angle is reached
    while(lAngleFrom != (int)to.getAngle())
    {
      int lAngleNew = 0;
      double lXNew = 0;
      double lYNew = 0;

      switch(lAngleFrom)
      {
        case 0:
          // Top right
          lXNew = fProjection.finalizeX(Math.PI);
          lYNew = fProjection.finalizeY(1e6);
          lAngleNew = 1;
          break;

        case 1:
          // Top left
          lXNew = fProjection.finalizeX(-Math.PI);
          lYNew = fProjection.finalizeY(1e6);
          lAngleNew = 2;
          break;

        case 2:
          // Bottom left
          lXNew = fProjection.finalizeX(-Math.PI);
          lYNew = fProjection.finalizeY(-1e6);
          lAngleNew = 3;
          break;

        case 3:
          // Bottom right
          lXNew = fProjection.finalizeX(Math.PI);
          lYNew = fProjection.finalizeY(-1e6);
          lAngleNew = 0;
          break;
      }

      pScanBuf.addLine(lXFrom, lYFrom, lXNew, lYNew);

      lAngleFrom = lAngleNew;
      lXFrom = lXNew;
      lYFrom = lYNew;
    }

    // ...and from last to final.
    pScanBuf.addLine(lXFrom, lYFrom, fProjection.finalizeX(to.getX()),
      fProjection.finalizeY(to.getY()));
  }