@staticmethod
def zoom_factor(width: int, height: int, x_right: float, x_left: float,
    y_top: float, y_bottom: float) ->float:
    """Calculate the zoom factor."""
    x_diff = x_left - x_right
    y_diff = y_top - y_bottom
    x_diff = x_diff if x_diff else 1.0
    y_diff = y_diff if y_diff else 1.0
    if width / x_diff < height / y_diff:
        return width / x_diff
    else:
        return height / y_diff
