code: public Rectangle getBoundsSurrounding (Rectangle content)
      {
          Rectangle bounds = new Rectangle(content);
  
          bounds.width += _leftPad + _rightPad;
          bounds.height += _topPad + _bottomPad;
          bounds.x -= _leftPad;
          bounds.y -= _topPad;
  
          return bounds;
      }
docs: Returns a rectangle describing the bounds of this NinePatch when drawn such that it frames
  the given content rectangle.