MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / intersection

Method intersection

src/Engine/include/OpenLoco/Engine/Ui/Rect.hpp:48–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 }
47
48 Rect intersection(const Rect r2) const
49 {
50 int left = std::max(this->origin.x, r2.origin.x);
51 int top = std::max(this->origin.y, r2.origin.y);
52 int right = std::min(this->origin.x + this->size.width, r2.origin.x + r2.size.width);
53 int bottom = std::min(this->origin.y + this->size.height, r2.origin.y + r2.size.height);
54
55 return Rect(left, top, right - left, bottom - top);
56 }
57
58 int32_t width() const
59 {

Callers 3

renderMethod · 0.80
clipRenderTargetFunction · 0.80
renderMethod · 0.80

Calls 1

RectClass · 0.85

Tested by

no test coverage detected