code: def _get_drawn_rect(self, grid, key, rect):
          
  
          rect = self.get_merged_rect(grid, key, rect)
          if rect is None:
              # Merged cell is drawn
              if grid.is_merged_cell_drawn(key):
                  # Merging cell is outside view
                  row, col, __ = key = self.get_merging_cell(grid, key)
                  rect = grid.CellToRect(row, col)
                  rect = self.get_merged_rect(grid, key, rect)
              else:
                  return
  
          return rect
docs: Replaces drawn rect if the one provided by wx is incorrect
  
          This handles merged rects including those that are partly off screen.