Account for floating point results in to_relative_box

Because the function uses division the return types may either be int or
float.
This commit is contained in:
Martin Weinelt 2025-05-13 05:44:39 +02:00
parent c2337894bd
commit f60e8ee76e
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759

View File

@ -169,7 +169,7 @@ def get_tz_modifiers(tz_name: str) -> Tuple[str, str, float]:
def to_relative_box(
width: int, height: int, box: Tuple[int, int, int, int]
) -> Tuple[int, int, int, int]:
) -> Tuple[int | float, int | float, int | float, int | float]:
return (
box[0] / width, # x
box[1] / height, # y