public Shape paintLayer(Graphics g, int offs0, int offs1, Shape bounds,JTextComponent c, View view) {
    	Color color;
    	if (_provider.type(_mark)==MarkMarkupProvider.MarkupType.BOTH) {
    		color=_provider.markColor2(_mark);
    		if (color==null) {
    			color=_provider.markColor(_mark);
    		}
    	} else {
    		color=_provider.markColor(_mark);
    	}
      
      g.setColor(color == null ? c.getSelectionColor() : color);

      Rectangle alloc = null;
      if (offs0 == view.getStartOffset() && offs1 == view.getEndOffset()) {
        if (bounds instanceof Rectangle) {
          alloc = (Rectangle) bounds;
        } else {
          alloc = bounds.getBounds();
        }
      } else {
        try {
          Shape shape = view.modelToView(offs0,Position.Bias.Forward, offs1,Position.Bias.Backward, bounds);
          alloc = (shape instanceof Rectangle) ? (Rectangle) shape : shape.getBounds();
        } catch (BadLocationException e) {
          return null;
        }
      }

      FontMetrics fm = c.getFontMetrics(c.getFont());
      int baseline = alloc.y + alloc.height - fm.getDescent() + 1;
      alloc.width=Math.max(alloc.width, MarkerHighlightPainter.WIDTH_FOR_EMPTY_SPACE);
      g.drawLine(alloc.x, baseline, alloc.x + alloc.width, baseline);
      g.drawLine(alloc.x, baseline + 1, alloc.x + alloc.width,baseline + 1);

      doText(offs0,offs1,c);

      return alloc;
    }