aboutsummaryrefslogtreecommitdiff
path: root/src/ui/render/render_object.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/render/render_object.hpp')
-rw-r--r--src/ui/render/render_object.hpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ui/render/render_object.hpp b/src/ui/render/render_object.hpp
index 34f5dcee..a9950198 100644
--- a/src/ui/render/render_object.hpp
+++ b/src/ui/render/render_object.hpp
@@ -37,7 +37,11 @@ class RenderObject : public Object {
Point GetOffset() const { return offset_; }
void SetOffset(const Point& offset) { offset_ = offset; }
Size GetSize() const { return size_; }
- void SetSize(const Size& size) { size_ = size; }
+ void SetSize(const Size& size) {
+ const auto old_size = size_;
+ size_ = size;
+ OnSizeChanged(old_size, size);
+ }
Thickness GetMargin() const { return margin_; }
void SetMargin(const Thickness& margin) { margin_ = margin; }
@@ -64,6 +68,8 @@ class RenderObject : public Object {
virtual void OnAddChild(RenderObject* new_child, int position);
virtual void OnRemoveChild(RenderObject* removed_child, int position);
+ virtual void OnSizeChanged(const Size& old_size, const Size& new_size);
+
virtual Size OnMeasureContent(const Size& available_size) = 0;
virtual void OnLayoutContent(const Rect& content_rect) = 0;