MCPcopy Create free account
hub / github.com/aseprite/laf / createIntersection

Method createIntersection

gfx/rect.h:323–331  ·  view source on GitHub ↗

Returns the intersection rectangle between this and rc rectangles.

Source from the content-addressed store, hash-verified

321
322 // Returns the intersection rectangle between this and rc rectangles.
323 [[nodiscard]]
324 RectT createIntersection(const RectT& rc) const
325 {
326 if (intersects(rc))
327 return RectT(PointT<T>(x > rc.x ? x : rc.x, y > rc.y ? y : rc.y),
328 PointT<T>(x + w < rc.x + rc.w ? x + w : rc.x + rc.w,
329 y + h < rc.y + rc.h ? y + h : rc.y + rc.h));
330 return RectT();
331 }
332
333 const RectT& operator+=(const BorderT<T>& br)
334 {

Callers

nothing calls this directly

Calls 1

RectTClass · 0.70

Tested by

no test coverage detected