if (pos >= currLineStart && pos < currLineEnd || pos == end - 1)
if (pos >= currLineStart && pos < currLineEnd)
    public Shape modelToView(int pos, Shape a, Bias b)        throws BadLocationException    {      Segment s = getLineBuffer();      int lineHeight = metrics.getHeight();      Rectangle rect = a.getBounds();            // Return a rectangle with width 1 and height equal to the height       // of the text      rect.height = lineHeight;      rect.width = 1;      int currLineStart = getStartOffset();      int end = getEndOffset();            if (pos < currLineStart || pos >= end)        throw new BadLocationException("invalid offset", pos);                 while (true)        {          int currLineEnd = calculateBreakPosition(currLineStart, end);          // If pos is between currLineStart and currLineEnd then just find          // the width of the text from currLineStart to pos and add that          // to rect.x          if (pos >= currLineStart && pos < currLineEnd || pos == end - 1)            {                           try                {                  getDocument().getText(currLineStart, pos - currLineStart, s);                }              catch (BadLocationException ble)                {                  // Shouldn't happen                }              rect.x += Utilities.getTabbedTextWidth(s, metrics, rect.x,                                                     WrappedPlainView.this,                                                     currLineStart);              return rect;            }          // Increment rect.y so we're checking the next logical line          rect.y += lineHeight;                    // Increment currLineStart to the model position of the start          // of the next logical line          if (currLineEnd == currLineStart)            currLineStart = end;          else            currLineStart = currLineEnd;        }    }