aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/render/render_object.hpp
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-09-17 16:05:17 +0800
committer杨宇千 <crupest@outlook.com>2019-09-17 16:05:17 +0800
commite8dd10eec26d26c3fb30f2712ccf58ac72edc8a2 (patch)
tree75293a2bb477fb1872087fab8bfd2c89b6d2051f /include/cru/ui/render/render_object.hpp
parent465d89b4207cce929dc8e0b6ac93c3533ba19408 (diff)
downloadcru-e8dd10eec26d26c3fb30f2712ccf58ac72edc8a2.tar.gz
cru-e8dd10eec26d26c3fb30f2712ccf58ac72edc8a2.tar.bz2
cru-e8dd10eec26d26c3fb30f2712ccf58ac72edc8a2.zip
...
Diffstat (limited to 'include/cru/ui/render/render_object.hpp')
-rw-r--r--include/cru/ui/render/render_object.hpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/cru/ui/render/render_object.hpp b/include/cru/ui/render/render_object.hpp
index 2394bf97..befaa3ec 100644
--- a/include/cru/ui/render/render_object.hpp
+++ b/include/cru/ui/render/render_object.hpp
@@ -59,11 +59,7 @@ 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) {
- const auto old_size = size_;
- size_ = size;
- OnSizeChanged(old_size, size);
- }
+ void SetSize(const Size& size) { size_ = size; }
Thickness GetMargin() const { return margin_; }
void SetMargin(const Thickness& margin) { margin_ = margin; }
@@ -109,13 +105,14 @@ class RenderObject : public Object {
// default is to invalidate both layout and paint
virtual void OnRemoveChild(RenderObject* removed_child, int position);
- virtual void OnSizeChanged(const Size& old_size, const Size& new_size);
-
virtual void OnMeasureCore(const Size& available_size);
virtual void OnLayoutCore(const Rect& rect);
virtual Size OnMeasureContent(const Size& available_size) = 0;
virtual void OnLayoutContent(const Rect& content_rect) = 0;
+ virtual void OnAfterLayout();
+ static void NotifyAfterLayoutRecursive(RenderObject* render_object);
+
Rect GetContentRect() const;
private: