소스 검색

Make Rect::area() signed, just like Rect::width()/height()

Makes it more sane what type to use when interacting with this class.
tags/v1.4.90
Pierre Ossman 9 년 전
부모
커밋
615a0f58f1
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1
    1
      common/rfb/Rect.h

+ 1
- 1
common/rfb/Rect.h 파일 보기

@@ -102,7 +102,7 @@ namespace rfb {
inline bool overlaps(const Rect &r) const {
return tl.x < r.br.x && tl.y < r.br.y && br.x > r.tl.x && br.y > r.tl.y;
}
inline unsigned int area() const {return is_empty() ? 0 : (br.x-tl.x)*(br.y-tl.y);}
inline int area() const {return is_empty() ? 0 : (br.x-tl.x)*(br.y-tl.y);}
inline Point dimensions() const {return Point(width(), height());}
inline int width() const {return br.x-tl.x;}
inline int height() const {return br.y-tl.y;}

Loading…
취소
저장