Home | History | Annotate | Download | only in gfx

Lines Matching defs:RECT

25 typedef struct tagRECT RECT;
38 class UI_EXPORT Rect
39 : public RectBase<Rect, Point, Size, Insets, Vector2d, int> {
41 Rect() : RectBase<Rect, Point, Size, Insets, Vector2d, int>(Point()) {}
43 Rect(int width, int height)
44 : RectBase<Rect, Point, Size, Insets, Vector2d, int>
47 Rect(int x, int y, int width, int height)
48 : RectBase<Rect, Point, Size, Insets, Vector2d, int>
52 explicit Rect(const RECT& r);
54 explicit Rect(const CGRect& r);
56 explicit Rect(const GdkRectangle& r);
59 explicit Rect(const gfx::Size& size)
60 : RectBase<Rect, Point, Size, Insets, Vector2d, int>(size) {}
62 Rect(const gfx::Point& origin, const gfx::Size& size)
63 : RectBase<Rect, Point, Size, Insets, Vector2d, int>(origin, size) {}
65 ~Rect() {}
68 // Construct an equivalent Win32 RECT object.
69 RECT ToRECT() const;
84 inline bool operator==(const Rect& lhs, const Rect& rhs) {
88 inline bool operator!=(const Rect& lhs, const Rect& rhs) {
92 UI_EXPORT Rect operator+(const Rect& lhs, const Vector2d& rhs);
93 UI_EXPORT Rect operator-(const Rect& lhs, const Vector2d& rhs);
95 inline Rect operator+(const Vector2d& lhs, const Rect& rhs) {
99 UI_EXPORT Rect IntersectRects(const Rect& a, const Rect& b);
100 UI_EXPORT Rect UnionRects(const Rect& a, const Rect& b);
101 UI_EXPORT Rect SubtractRects(const Rect& a, const Rect& b);
105 // This could also be thought of as "the smallest rect that contains both
107 // rect to be outside the rect. So technically one or both points will not be
108 // contained within the rect, because they will appear on one of these edges.
109 UI_EXPORT Rect BoundingRect(const Point& p1, const Point& p2);
111 inline Rect ScaleToEnclosingRect(const Rect& rect,
114 int x = std::floor(rect.x() * x_scale);
115 int y = std::floor(rect.y() * y_scale);
116 int r = rect.width() == 0 ? x : std::ceil(rect.right() * x_scale);
117 int b = rect.height() == 0 ? y : std::ceil(rect.bottom() * y_scale);
118 return Rect(x, y, r - x, b - y);
121 inline Rect ScaleToEnclosingRect(const Rect& rect, float scale) {
122 return ScaleToEnclosingRect(rect, scale, scale);
125 inline Rect ScaleToEnclosedRect(const Rect& rect,
128 int x = std::ceil(rect.x() * x_scale);
129 int y = std::ceil(rect.y() * y_scale);
130 int r = rect.width() == 0 ? x : std::floor(rect.right() * x_scale);
131 int b = rect.height() == 0 ? y : std::floor(rect.bottom() * y_scale);
132 return Rect(x, y, r - x, b - y);
135 inline Rect ScaleToEnclosedRect(const Rect& rect, float scale) {
136 return ScaleToEnclosedRect(rect, scale, scale);
140 extern template class RectBase<Rect, Point, Size, Insets, Vector2d, int>;