def _transform_coordinates(self, func: Callable[[float, float], tuple[float, float]]) -> None:
        """Helper method to transformer either row or column coordinates."""

        def func_x(x: float) -> float:
            return func(x, 0)[0]

        def func_y(y: float) -> float:
            return func(0, y)[1]

        self.entries = {
            cast(tuple[int, int], func(int(x), int(y))): v for (x, y), v in self.entries.items()
        }
        self.vertical_lines = [
            _VerticalLine(func_x(x), func_y(y1), func_y(y2), emph, doubled)
            for x, y1, y2, emph, doubled in self.vertical_lines
        ]
        self.horizontal_lines = [
            _HorizontalLine(func_y(y), func_x(x1), func_x(x2), emph, doubled)
            for y, x1, x2, emph, doubled in self.horizontal_lines
        ]
        self.horizontal_padding = {
            int(func_x(int(x))): padding for x, padding in self.horizontal_padding.items()
        }
        self.vertical_padding = {
            int(func_y(int(y))): padding for y, padding in self.vertical_padding.items()
        }
Helper method to transformer either row or column coordinates.
cirq-core/cirq/circuits/text_diagram_drawer.py