mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-29 11:39:58 +02:00
[Kandinsky] Add setters to KDRect
Change-Id: I0386a7469442ea42cf50e33b48f26509a9eba33a
This commit is contained in:
@@ -26,6 +26,9 @@ public:
|
||||
KDCoordinate top() const;
|
||||
KDCoordinate bottom() const;
|
||||
|
||||
void setOrigin(KDPoint origin);
|
||||
void setSize(KDSize size);
|
||||
|
||||
KDRect translatedBy(KDPoint p) const;
|
||||
KDRect movedTo(KDPoint p) const;
|
||||
bool intersects(const KDRect & other) const;
|
||||
|
||||
@@ -13,6 +13,6 @@ private:
|
||||
KDCoordinate m_height;
|
||||
};
|
||||
|
||||
|
||||
constexpr KDSize KDSizeZero = KDSize(0,0);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,6 +30,9 @@ KDCoordinate KDRect::right() const { return m_x+m_width; }
|
||||
KDCoordinate KDRect::bottom() const { return m_y+m_height; }
|
||||
KDCoordinate KDRect::left() const { return m_x; }
|
||||
|
||||
void KDRect::setOrigin(KDPoint p) { m_x = p.x(); m_y = p.y(); }
|
||||
void KDRect::setSize(KDSize s) { m_width = s.width(); m_height = s.height(); }
|
||||
|
||||
static inline KDCoordinate min(KDCoordinate x, KDCoordinate y) { return (x<y ? x : y); }
|
||||
static inline KDCoordinate max(KDCoordinate x, KDCoordinate y) { return (x>y ? x : y); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user