diff --git a/inc/hgl/type/Size2.h b/inc/hgl/type/Size2.h index b89d7b3..c827307 100644 --- a/inc/hgl/type/Size2.h +++ b/inc/hgl/type/Size2.h @@ -1,11 +1,11 @@ -#pragma once +#pragma once #include namespace hgl { /** - * ߴģ + * 尺寸模板 */ template struct Size2 { @@ -24,8 +24,8 @@ namespace hgl height=h; } - const bool isLandscape()const{return width>height;} ///<Ƿ - const bool isPortrait()const{return widthheight;} ///<是否横的 + const bool isPortrait()const{return width Swapped(){return Size2(height,width);} ///<ȡһijߴ + Size2 Swapped()const{return Size2(height,width);} ///<获取一个横竖交换的尺寸 + + const bool operator == (const Size2 &s) const + { + if(width!=s.width)return(false); + if(height!=s.height)return(false); + return(true); + } + + const bool operator != (const Size2 &s) const + { + return !operator==(s); + } };//template struct Size2 using Size2i =Size2;