diff options
author | crupest <crupest@outlook.com> | 2020-03-03 23:36:45 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-03-03 23:36:45 +0800 |
commit | 0dcf8e686b93cca54a424affe0455d0a97d6c2ef (patch) | |
tree | 744897a3b6a29f6142f1943dab5d9957e670919b /include/cru/ui/render/render_object.hpp | |
parent | 47053829c322c43032244937cb63f9da178b852d (diff) | |
download | cru-0dcf8e686b93cca54a424affe0455d0a97d6c2ef.tar.gz cru-0dcf8e686b93cca54a424affe0455d0a97d6c2ef.tar.bz2 cru-0dcf8e686b93cca54a424affe0455d0a97d6c2ef.zip |
...
Diffstat (limited to 'include/cru/ui/render/render_object.hpp')
-rw-r--r-- | include/cru/ui/render/render_object.hpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/cru/ui/render/render_object.hpp b/include/cru/ui/render/render_object.hpp index 0f0cb8df..d9851757 100644 --- a/include/cru/ui/render/render_object.hpp +++ b/include/cru/ui/render/render_object.hpp @@ -70,6 +70,8 @@ class RenderObject : public Object { Point GetOffset() const { return offset_; } void SetOffset(const Point& offset) { offset_ = offset; } + Point GetTotalOffset() const; + Point FromRootToContent(const Point& point) const; Size GetSize() const { return size_; } void SetSize(const Size& size) { size_ = size; } @@ -91,9 +93,7 @@ class RenderObject : public Object { virtual RenderObject* HitTest(const Point& point) = 0; - protected: - void SetChildMode(ChildMode mode) { child_mode_ = mode; } - + public: void InvalidateLayout() const { if (render_host_ != nullptr) render_host_->InvalidateLayout(); } @@ -103,6 +103,9 @@ class RenderObject : public Object { } protected: + void SetChildMode(ChildMode mode) { child_mode_ = mode; } + + protected: virtual void OnParentChanged(RenderObject* old_parent, RenderObject* new_parent); |