From 05cb60439fda6f7a4bbf10bb96a832ab1111af8d Mon Sep 17 00:00:00 2001 From: Yixing Lao Date: Fri, 10 Jan 2025 20:46:58 +0800 Subject: [PATCH] refactor(camtools/render.py): enforce type safety for multiline_alignment parameter by using Literal type hint --- camtools/render.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/camtools/render.py b/camtools/render.py index 6218bdc..c487024 100644 --- a/camtools/render.py +++ b/camtools/render.py @@ -546,7 +546,7 @@ def render_text( font_type: Literal["tex", "serif", "sans", "mono"] = "tex", font_color: Tuple[float, float, float] = (0, 0, 0), tight_layout: bool = False, - multiline_alignment: str = "left", + multiline_alignment: Literal["left", "center", "right"] = "left", padding_tblr: Tuple[int, int, int, int] = (0, 0, 0, 0), ) -> Float[np.ndarray, "h w"]: """