From 0dcf8e686b93cca54a424affe0455d0a97d6c2ef Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 3 Mar 2020 23:36:45 +0800 Subject: ... --- include/cru/ui/render/render_object.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include/cru/ui/render/render_object.hpp') 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(); } @@ -102,6 +102,9 @@ class RenderObject : public Object { if (render_host_ != nullptr) render_host_->InvalidatePaint(); } + protected: + void SetChildMode(ChildMode mode) { child_mode_ = mode; } + protected: virtual void OnParentChanged(RenderObject* old_parent, RenderObject* new_parent); -- cgit v1.2.3