42 int &left = m_topLeft.x;
43 int &top = m_topLeft.y;
44 int &right = m_bottomRight.x;
45 int &bottom = m_bottomRight.y;
48 explicit KRect(
int l,
int t,
int r,
int b);
65 operator QRect()
const;
67#ifdef KDWINUTILS_WITHMFC
69 explicit KRect(
const CRect &cr);
72 operator CRect()
const;
170 void SetRect(
int left,
int top,
int right,
int bottom);
The KPoint class defines a point in the plane using integer precision.
Definition kpoint.h:43
KRect operator+(const KPoint &lhs, const KRect &rhs)
Returns a KRect that is offset by a KPoint.
KRect operator-(const KPoint &lhs, const KRect &rhs)
Returns a KRect that is offset by the negation of a KPoint.
The KRect class defines a rectangle in the plane using integer precision.
Definition krect.h:40
void MoveToXY(const KPoint &point) noexcept
Moves KRect to the specified x- and y-coordinates.
KRect operator+(const KRect &lhs, const KSize &rhs)
Returns a KRect offset by a KSize.
void operator&=(const KRect &rect)
Sets Krect equal to the intersection of Krect and a rectangle.
void UnionRect(const KRect *rectSrc1, const KRect *rectSrc2)
Sets KRect equal to the union of two rectangles.
void operator-=(const KRect &rect)
Deflates Krect.
void InflateRect(int x, int y)
Increases the width and height of KRect.
KRect(int l, int t, int r, int b)
void NormalizeRect()
Standardizes the height and width of KRect.
void OffsetRect(const KSize &size)
Moves KRect by the specified offsets.
void operator-=(const KPoint &point)
Subtracts the specified offsets from Krect.
void operator+=(const KPoint &point)
Adds the specified offsets to Krect.
int Width() const
Calculates the width of KRect.
void MoveToX(int x)
Moves KRect to the specified x-coordinate.
KRect operator|(const KRect &lhs, const KRect &rhs)
Creates the union of KRect and a rectangle and returns the resulting KRect.
void swap(KRect &rect) noexcept
KRect & operator=(const CRect &rect)
KRect operator-(const KRect &lhs, const KRect &rhs)
Deflates KRect and returns the resulting KRect.
KPoint CenterPoint() const
Returns the centerpoint of KRect.
KRect operator+(const KRect &lhs, const KPoint &rhs)
Returns a KRect offset by a KPoint.
KRect operator-(const KRect &lhs, const KSize &rhs)
Subtracts the given offsets from KRect.
bool operator!=(const KRect &lhs, const KRect &rhs) noexcept
Checks for inequality between 2 rects.
void DeflateRect(const KSize &size)
Decreases the width and height of KRect.
bool operator==(const KRect &lhs, const KRect &rhs) noexcept
Checks for equality between 2 rects.
void DeflateRect(int l, int t, int r, int b)
Decreases the width and height of KRect.
void operator|=(const KRect &rect)
Sets Krect equal to the union of Krect and a rectangle.
void InflateRect(const KSize &size)
Increases the width and height of KRect.
KPoint & BottomRight()
Returns the bottom-right point of KRect.
void DeflateRect(const KRect &rect)
Decreases the width and height of KRect.
void operator-=(const KSize &size)
Subtracts the specified offsets from Krect.
KRect & operator=(const KRect &rect)
void InflateRect(int l, int t, int r, int b)
Increases the width and height of KRect.
bool IntersectRect(const KRect *rect1, const KRect *rect2)
Sets KRect equal to the intersection of two rectangles.
void InflateRect(const KRect &rect)
Increases the width and height of KRect.
const KPoint & BottomRight() const
bool SubtractRect(const KRect &rectSrc1, const KRect &rectSrc2)
Subtracts one rectangle from another.
KRect operator&(const KRect &lhs, const KRect &rhs)
Creates the intersection of KRect and a rectangle and returns the resulting KRect .
KRect & operator=(const QRect &rect)
bool PtInRect(const KPoint &point) const
Determines whether the specified point lies within KRect.
const KPoint & TopLeft() const
Returns the top-left point of KRect.
void MoveToY(int y)
Moves KRect to the specified y-coordinate.
void SetRect(int left, int top, int right, int bottom)
Sets the dimensions of KRect.
void CopyRect(const KRect &rect)
Copies the dimensions of a source rectangle to KRect.
void SetRectEmpty()
Sets KRect to an empty rectangle (all coordinates equal to 0).
KRect operator-(const KRect &lhs, const KPoint &rhs)
Subtracts the given offsets from Krect.
KRect(KRect &&rect) noexcept
KSize Size() const
Calculates the size of KRect.
KRect operator+(const KRect &lhs, const KRect &rhs)
Inflates KRect and returns the resulting KRect.
bool IsRectNull() const
Determines whether the top, bottom, left, and right member variables are all equal to 0.
void operator+=(const KRect &rect)
Inflates Krect.
void operator+=(const KSize &size)
Adds the specified offsets to Krect.
bool EqualRect(const KRect *cr) const
Determines whether KRect is equal to the given rectangle.
KRect(const KPoint &cp, const KSize &cs)
bool SubtractRect(const KRect *rectSrc1, const KRect *rectSrc2)
Subtracts one rectangle from another.
void CopyRect(const KRect *rect)
Copies the dimensions of a source rectangle to KRect.
int Height() const
Calculates the height of KRect.
void UnionRect(const KRect &rectSrc1, const KRect &rectSrc2)
Sets KRect equal to the union of two rectangles.
KRect(const KPoint &topLeft, const KPoint &bottomRight)
bool IsRectEmpty() const
Determines whether KRect is empty. KRect is empty if the width and/or height are 0.
void MoveToXY(int x, int y) noexcept
Moves KRect to the specified x- and y-coordinates.
void OffsetRect(int x, int y)
Moves KRect by the specified offsets.
KRect & operator=(KRect &&rect) noexcept
void OffsetRect(const KPoint &point)
Moves KRect by the specified offsets.
bool EqualRect(const KRect &cr) const
Determines whether KRect is equal to the given rectangle.
void DeflateRect(int x, int y)
Decreases the width and height of KRect.
KPoint & TopLeft()
Returns the top-left point of KRect.
bool IntersectRect(const KRect &rect1, const KRect &rect2)
Sets KRect equal to the intersection of two rectangles.
The KSize class defines the size of a two-dimensional object using integer point precision.
Definition ksize.h:43
KRect operator-(const KSize &lhs, const KRect &rhs)
Returns a KRect that is offset by the negation of a KSize.
KRect operator+(const KSize &lhs, const KRect &rhs)
Returns a KRect that is offset by a KSize.
#define KDWINUTILS_EXPORT
Definition kdwinutils_export.h:31
#define KDWINUTILS_BEGIN_NAMESPACE
Definition kdwinutils_global.h:27
#define KDWINUTILS_END_NAMESPACE
Definition kdwinutils_global.h:28