diff options
author | crupest <crupest@outlook.com> | 2020-06-28 22:17:14 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-06-28 22:17:14 +0800 |
commit | 427bd31059fcdca5806a149238e91173667953c1 (patch) | |
tree | dec0794e8445040f8b177aaa29e0600380e5420f /include/cru/ui/render/RenderObject.hpp | |
parent | 26da84f59396075118ee769654471159e1f49980 (diff) | |
download | cru-427bd31059fcdca5806a149238e91173667953c1.tar.gz cru-427bd31059fcdca5806a149238e91173667953c1.tar.bz2 cru-427bd31059fcdca5806a149238e91173667953c1.zip |
...
Diffstat (limited to 'include/cru/ui/render/RenderObject.hpp')
-rw-r--r-- | include/cru/ui/render/RenderObject.hpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/cru/ui/render/RenderObject.hpp b/include/cru/ui/render/RenderObject.hpp index 09f140db..2d9cd817 100644 --- a/include/cru/ui/render/RenderObject.hpp +++ b/include/cru/ui/render/RenderObject.hpp @@ -121,7 +121,7 @@ class RenderObject : public Object { // This will set offset of this render object and call OnLayoutCore. void Layout(const Point& offset); - virtual void Draw(platform::graph::IPainter* painter) = 0; + void Draw(platform::graph::IPainter* painter); // Param point must be relative the lefttop of render object including margin. // Add offset before pass point to children. @@ -145,6 +145,17 @@ class RenderObject : public Object { // default is to invalidate both layout and paint virtual void OnRemoveChild(RenderObject* removed_child, Index position); + // Draw all children with offset. + void DefaultDrawChildren(platform::graph::IPainter* painter); + + // Draw all children with translation of content rect lefttop. + void DefaultDrawContent(platform::graph::IPainter* painter); + + // Call DefaultDrawContent. Then call DefaultDrawChildren. + virtual void OnDrawCore(platform::graph::IPainter* painter); + + virtual void OnDrawContent(platform::graph::IPainter* painter); + // Size measure including margin and padding. Please reduce margin and padding // or other custom things and pass the result content measure requirement and // preferred size to OnMeasureContent. Return value must not be negative and |