aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/render/ScrollRenderObject.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-06-22 01:09:24 +0800
committercrupest <crupest@outlook.com>2020-06-22 01:09:24 +0800
commit4f0a2f32c273780c32cc3937615c2a8bbd993aab (patch)
tree6e1f45447854a40fe2d16ef9bec79f3c0fef030a /include/cru/ui/render/ScrollRenderObject.hpp
parentd86a71f79afe0e4dac768f61d6bff690567aca5b (diff)
downloadcru-4f0a2f32c273780c32cc3937615c2a8bbd993aab.tar.gz
cru-4f0a2f32c273780c32cc3937615c2a8bbd993aab.tar.bz2
cru-4f0a2f32c273780c32cc3937615c2a8bbd993aab.zip
...
Diffstat (limited to 'include/cru/ui/render/ScrollRenderObject.hpp')
-rw-r--r--include/cru/ui/render/ScrollRenderObject.hpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/cru/ui/render/ScrollRenderObject.hpp b/include/cru/ui/render/ScrollRenderObject.hpp
index dcf6dae6..924b8ca6 100644
--- a/include/cru/ui/render/ScrollRenderObject.hpp
+++ b/include/cru/ui/render/ScrollRenderObject.hpp
@@ -21,8 +21,12 @@ class ScrollRenderObject : public RenderObject {
void SetScrollOffset(const Point& offset);
protected:
- void OnAddChild(RenderObject* new_child, Index position) override;
- void OnRemoveChild(RenderObject* removed_child, Index position) override;
+ // Logic:
+ // If available size is bigger than child's preferred size, then child's
+ // preferred size is taken.
+ // If not, all available size is taken while forming a scroll area.
+ Size OnMeasureContent(const MeasureRequirement& requirement) override;
+ void OnLayoutContent(const Rect& content_rect) override;
private:
Point scroll_offset_;