docs: function (bounds, vertex, next, orthogonal)
  	{
  		var x = bounds.x;
  		var y = bounds.y;
  		var w = bounds.width;
  		var h = bounds.height;
  		
  		var cx = x + w / 2;
  		var cy = y + h / 2;
  
  		var px = next.x;
  		var py = next.y;
  
  		// Special case for intersecting the diamond's corners
  		if (cx == px)
  		{
  			if (cy > py)
  			{
  				return new mxPoint(cx, y); // top
  			}
  			else
  			{
  				return new mxPoint(cx, y + h); // bottom
  			}
  		}
  		else if (cy == py)
  		{
  			if (cx > px)
  			{
  				return new mxPoint(x, cy); // left
  			}
  			else
  			{
  				return new mxPoint(x + w, cy); // right
  			}
  		}
  		
  		var tx = cx;
  		var ty = cy;
  		
  		if (orthogonal)
  		{
  			if (px >= x && px <= x + w)
  			{
  				tx = px;
  			}
  			else if (py >= y && py <= y + h)
  			{
  				ty = py;
  			}
  		}
  		
  		// In which quadrant will the intersection be?
  		// set the slope and offset of the border line accordingly
  		if (px < cx)
  		{
  			if (py < cy)
  			{
  				return mxUtils.intersection(px, py, tx, ty, cx, y, x, cy);
  			}
  			else
  			{
  				return mxUtils.intersection(px, py, tx, ty, cx, y + h, x, cy);
  			}
  		}
  		else if (py < cy)
  		{
  			return mxUtils.intersection(px, py, tx, ty, cx, y, x + w, cy);
  		}
  		else
  		{
  			return mxUtils.intersection(px, py, tx, ty, cx, y + h, x + w, cy);
  		}
  	}