added Size2<>*Size2<> operator override.

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-10-31 16:12:13 +08:00
parent b060f6a6d4
commit fdceda495a

View File

@ -70,12 +70,14 @@ namespace hgl
SIZE2_OPERATOR_SELF(/=) SIZE2_OPERATOR_SELF(/=)
#undef SIZE2_OPERATOR_SELF #undef SIZE2_OPERATOR_SELF
#define SIZE2_OPERATOR_INTERACTIVE(op) template<typename N> Size2 operator op (const N &n) const {return Size2<T>(width op n,height op n);} #define SIZE2_OPERATOR_INTERACTIVE(op) template<typename N> Size2<T> operator op (const N &n) const {return Size2<T>(width op n,height op n);} \
SIZE2_OPERATOR_INTERACTIVE(+) template<typename N> Size2<T> operator op (const Size2<N> &n) const {return Size2<T>(width op n.Width(),height op n.Height());}
SIZE2_OPERATOR_INTERACTIVE(-)
SIZE2_OPERATOR_INTERACTIVE(*) SIZE2_OPERATOR_INTERACTIVE(+)
SIZE2_OPERATOR_INTERACTIVE(/) SIZE2_OPERATOR_INTERACTIVE(-)
#undef SIZE2_OPERATOR_INTERACTIVE SIZE2_OPERATOR_INTERACTIVE(*)
SIZE2_OPERATOR_INTERACTIVE(/)
#undef SIZE2_OPERATOR_INTERACTIVE
/** /**
* *