Lines Matching defs:Rect
27 class Rect {
29 Rect() = default;
30 ~Rect() = default;
32 Rect(double x, double y, double width, double height)
37 Rect(const Offset& offset, const Size& size)
151 bool IsWrappedBy(const Rect& other) const
162 Rect Constrain(const Rect& other)
170 return Rect(left, top, right, bottom);
173 Rect& operator+=(const Offset& offset)
180 Rect& operator-=(const Offset& offset)
187 Rect& operator+=(const Size& size)
194 Rect& operator-=(const Size& size)
201 Rect operator+(const Offset& offset) const
203 return Rect(x_ + offset.GetX(), y_ + offset.GetY(), width_, height_);
206 Rect operator-(const Offset& offset) const
208 return Rect(x_ - offset.GetX(), y_ - offset.GetY(), width_, height_);
211 Rect operator+(const Size& size) const
213 return Rect(x_, y_, width_ + size.Width(), height_ + size.Height());
216 Rect operator-(const Size& size) const
218 return Rect(x_, y_, width_ - size.Width(), height_ - size.Height());
221 Rect operator*(double scale) const
223 return Rect(x_ * scale, y_ * scale, width_ * scale, height_ * scale);
226 bool operator==(const Rect& rect) const
231 bool operator!=(const Rect& rect) const
236 bool IsIntersectWith(const Rect& other) const
241 bool IsIntersectByCommonSideWith(const Rect& other) const
247 Rect IntersectRect(const Rect& other) const
253 return Rect(left, top, right - left, bottom - top);
256 Rect CombineRect(const Rect& other) const
262 return Rect(left, top, right - left, bottom - top);
270 * Case 1 : Inside. Rect won't be move because it is already attracted by magnet.
275 * | Magnetical Rect |
288 * | Magnetical Rect +--+
300 * | Magnetical Rect | +----------> | Magnetical Rect |
317 * | Magnetical Rect | | | +-----> | Magnetical Rect | | |
330 * | Magnetical Rect | | |
340 Offset MagneticAttractedBy(const Rect& magnet)
367 ss << "Rect (" << std::fixed << std::setprecision(2) << x_ << ", " << y_ << ") - [";