    def block_transfer(self, buffer, x, y):
        """
        Copy a buffer entirely to this double buffer.

        :param buffer: The double buffer to copy
        :param x: The X origin for where to place it in this buffer
        :param y: The Y origin for where to place it in this buffer
        """
        # Just copy the double-buffer cells - the real screen will sync on refresh.
        block_min_x = max(0, x)
        block_max_x = min(x + buffer.width, self._width)

        # Check for trivial non-overlap
        if block_min_x > block_max_x:
            return

        # Copy the available section
        for by in range(0, self._height):
            if y <= by < y + buffer.height:
                self._double_buffer[by][block_min_x:block_max_x] = buffer.slice(
                    block_min_x - x, by - y, block_max_x - block_min_x)
Copy a buffer entirely to this double buffer.

:param buffer: The double buffer to copy
:param x: The X origin for where to place it in this buffer
:param y: The Y origin for where to place it in this buffer
asciimatics/screen.py