From c65798a02db963336230f49a613b36d785ce4627 Mon Sep 17 00:00:00 2001 From: 283375 Date: Wed, 25 Jun 2025 23:19:52 +0800 Subject: [PATCH] feat: XYWHRect `__mul__` --- src/arcaea_offline_ocr/types.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/arcaea_offline_ocr/types.py b/src/arcaea_offline_ocr/types.py index d1bafa8..ccab234 100644 --- a/src/arcaea_offline_ocr/types.py +++ b/src/arcaea_offline_ocr/types.py @@ -34,3 +34,9 @@ class XYWHRect(NamedTuple): raise TypeError() return self.__class__(*[a - b for a, b in zip(self, other)]) + + def __mul__(self, other): + if not isinstance(other, (int, float)): + raise TypeError() + + return self.__class__(*[v * other for v in self])