    def __init__(self, screen, height, width, x=None, y=None):
        """
        :param screen: The underlying Screen that will be drawn to on refresh.
        :param height: The height of the screen buffer to be used.
        :param width: The width of the screen buffer to be used.
        :param x: The x position for the top left corner of the Canvas.
        :param y: The y position for the top left corner of the Canvas.

        If either of the x or y positions is not set, the Canvas will default
        to centring within the current Screen for that location.
        """
        # Save off the screen details.
        super().__init__(
            height, width, None, screen.colours, screen.unicode_aware)
        self._screen = screen
        self._dx = (screen.width - width) // 2 if x is None else x
        self._dy = (screen.height - height) // 2 if y is None else y
:param screen: The underlying Screen that will be drawn to on refresh.
:param height: The height of the screen buffer to be used.
:param width: The width of the screen buffer to be used.
:param x: The x position for the top left corner of the Canvas.
:param y: The y position for the top left corner of the Canvas.

If either of the x or y positions is not set, the Canvas will default
to centring within the current Screen for that location.
asciimatics/screen.py