diff --git a/inc/hgl/type/Size2.h b/inc/hgl/type/Size2.h index d63f43b..b82fdc9 100644 --- a/inc/hgl/type/Size2.h +++ b/inc/hgl/type/Size2.h @@ -70,12 +70,14 @@ namespace hgl SIZE2_OPERATOR_SELF(/=) #undef SIZE2_OPERATOR_SELF - #define SIZE2_OPERATOR_INTERACTIVE(op) template Size2 operator op (const N &n) const {return Size2(width op n,height op n);} - SIZE2_OPERATOR_INTERACTIVE(+) - SIZE2_OPERATOR_INTERACTIVE(-) - SIZE2_OPERATOR_INTERACTIVE(*) - SIZE2_OPERATOR_INTERACTIVE(/) - #undef SIZE2_OPERATOR_INTERACTIVE + #define SIZE2_OPERATOR_INTERACTIVE(op) template Size2 operator op (const N &n) const {return Size2(width op n,height op n);} \ + template Size2 operator op (const Size2 &n) const {return Size2(width op n.Width(),height op n.Height());} + + SIZE2_OPERATOR_INTERACTIVE(+) + SIZE2_OPERATOR_INTERACTIVE(-) + SIZE2_OPERATOR_INTERACTIVE(*) + SIZE2_OPERATOR_INTERACTIVE(/) + #undef SIZE2_OPERATOR_INTERACTIVE /** * 计算另一个尺寸在当前尺寸内的等比缩放多大可以正好