Mir
Loading...
Searching...
No Matches
mir::geometry::Rectangle Struct Reference

#include <rectangle.h>

Public Member Functions

constexpr Rectangle ()=default
constexpr Rectangle (Point const &top_left, Size const &size)
Point bottom_right () const
 The bottom right boundary point of the rectangle.
Point top_right () const
Point bottom_left () const
bool contains (Point const &p) const
bool contains (Rectangle const &r) const
 Test if the rectangle contains another.
bool overlaps (Rectangle const &r) const
Rectangle intersection_with (Rectangle const &r) const
X left () const
X right () const
Y top () const
Y bottom () const

Public Attributes

Point top_left
Size size

Constructor & Destructor Documentation

◆ Rectangle() [1/2]

mir::geometry::Rectangle::Rectangle ( )
constexprdefault

◆ Rectangle() [2/2]

mir::geometry::Rectangle::Rectangle ( Point const & top_left,
Size const & size )
inlineconstexpr

Member Function Documentation

◆ bottom()

Y mir::geometry::Rectangle::bottom ( ) const
inline

◆ bottom_left()

Point mir::geometry::Rectangle::bottom_left ( ) const

◆ bottom_right()

Point mir::geometry::Rectangle::bottom_right ( ) const

The bottom right boundary point of the rectangle.

Note that the returned point is not included in the rectangle area, that is, the rectangle is represented as [top_left,bottom_right).

◆ contains() [1/2]

bool mir::geometry::Rectangle::contains ( Point const & p) const

◆ contains() [2/2]

bool mir::geometry::Rectangle::contains ( Rectangle const & r) const

Test if the rectangle contains another.

Note that an empty rectangle can still contain other empty rectangles, which are treated as points or lines of thickness zero.

◆ intersection_with()

Rectangle mir::geometry::Rectangle::intersection_with ( Rectangle const & r) const

◆ left()

X mir::geometry::Rectangle::left ( ) const
inline

◆ overlaps()

bool mir::geometry::Rectangle::overlaps ( Rectangle const & r) const

◆ right()

X mir::geometry::Rectangle::right ( ) const
inline

◆ top()

Y mir::geometry::Rectangle::top ( ) const
inline

◆ top_right()

Point mir::geometry::Rectangle::top_right ( ) const

Member Data Documentation

◆ size

Size mir::geometry::Rectangle::size

◆ top_left

Point mir::geometry::Rectangle::top_left

The documentation for this struct was generated from the following file:

Copyright © 2012-2026 Canonical Ltd.
Generated on Sun Mar 15 06:10:58 UTC 2026
This documentation is licensed under the GPL version 2 or 3.