private int drawSeg(final Graphics2D seg,
        final double length, final double rot, final int oldNo) {
      int no = oldNo;
      double pos = 0.0;
      final double end = Math.max(length - segLen * 0.5, 0.0);
      while(pos <= end) {
        final Graphics2D s = (Graphics2D) seg.create();
        if(isFirst && pos == 0.0) {
          if(mustDraw(s, Pen.SEG_START, rot)) {
            pen.start(s, no, rot);
          }
        } else if(isLast && pos + segLen > end) {
          if(mustDraw(s, Pen.SEG_END, rot)) {
            pen.end(s, no, rot);
          }
        } else {
          if(mustDraw(s, Pen.SEG_NORM, rot)) {
            pen.draw(s, no, rot);
          }
        }
        pos += segLen;
        ++no;
        s.dispose();
        seg.translate(segLen, 0.0);
      }
      return no;
    }