feat: XYWHRect __mul__

This commit is contained in:
2025-06-25 23:19:52 +08:00
parent f11dc6e38f
commit c65798a02d

View File

@ -34,3 +34,9 @@ class XYWHRect(NamedTuple):
raise TypeError() raise TypeError()
return self.__class__(*[a - b for a, b in zip(self, other)]) 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])