public void addLine(double pXFrom, double pYFrom, double pXTo, double pYTo)
  {
    int lYFrom;
    int lYTo;

    // Do some rounding (but not in the way we expect it), limit values
    if(pYFrom < pYTo)
    {
      // Round lYFrom (but .5 is handled oddly)
      // 1.5001 - 2.5 -> 1.0001 - 2.0 -> 2
      lYFrom = (int)Math.ceil(pYFrom - 0.5);
      // Round lYTo, substract 1
      // 1.5 - 2.4999 -> 1.0 - 1.9999 -> 1
      lYTo = (int)Math.floor(pYTo - 0.5);

      /**
       * I don't know if this is intended, but in Java 3 == 3.001 is false
       * (the left arg is converted to double), so the expr is true only when
       * pYTo - 0.5 is exactly lYTo
       */
      if(lYTo == pYTo - 0.5)
      {
        lYTo--;
      }
    } else
    {
      lYFrom = (int)Math.ceil(pYTo - 0.5);
      lYTo = (int)Math.floor(pYFrom - 0.5);

      if(lYTo == pYFrom - 0.5)
      {
        lYTo--;
      }
    }

    // Limit y to size of image
    if(lYFrom < 0)
    {
      lYFrom = 0;
    }
    if(lYTo >= fLines)
    {
      lYTo = fLines - 1;
    }

    if(lYFrom > lYTo)
    {
      // No lines crossed.
      return;
    }

    // Note min/max settings so far
    if(lYFrom < fLineMin)
    {
      fLineMin = lYFrom;
    }
    if(lYTo > fLineMax)
    {
      fLineMax = lYTo;
    }

    // todo Curious: What happens if yFrom and yTo are equal? Shit? Or can't they be?
    double lDx = (pXTo - pXFrom) / (pYTo - pYFrom);
    double lX = pXFrom + lDx * ((lYFrom + 0.5) - pYFrom);

    // Record the x value for every line (y).
    for(int lLineNo = lYFrom; lLineNo <= lYTo; lLineNo++)
    {
      fScanbuf[lLineNo].add(new Double(lX));
      lX += lDx;
    }
    fScanBufsAdded = true;
  }