diff options
author | crupest <crupest@outlook.com> | 2019-03-24 19:44:31 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-03-24 19:44:31 +0800 |
commit | b76e435faca204f830644047077ab08930dc8f9c (patch) | |
tree | 8bca146bc7443a704d3cb4b71b36e632cb505c25 /src/ui/render/border_render_object.hpp | |
parent | 79d1d76509dbf6cf9c79f8eb55968535982975aa (diff) | |
download | cru-b76e435faca204f830644047077ab08930dc8f9c.tar.gz cru-b76e435faca204f830644047077ab08930dc8f9c.tar.bz2 cru-b76e435faca204f830644047077ab08930dc8f9c.zip |
...
Diffstat (limited to 'src/ui/render/border_render_object.hpp')
-rw-r--r-- | src/ui/render/border_render_object.hpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ui/render/border_render_object.hpp b/src/ui/render/border_render_object.hpp index eccb1219..6f9a8c11 100644 --- a/src/ui/render/border_render_object.hpp +++ b/src/ui/render/border_render_object.hpp @@ -13,6 +13,11 @@ namespace cru::ui::render { struct CornerRadius { constexpr CornerRadius() : left_top(), right_top(), left_bottom(), right_bottom() {} + constexpr CornerRadius(const Point& value) + : left_top(value), + right_top(value), + left_bottom(value), + right_bottom(value) {} constexpr CornerRadius(Point left_top, Point right_top, Point left_bottom, Point right_bottom) : left_top(left_top), @@ -42,7 +47,9 @@ class BorderRenderObject : public RenderObject { void SetBrush(ID2D1Brush* new_brush); Thickness GetBorderWidth() const { return border_thickness_; } - void SetBorderWidth(const Thickness& thickness) { border_thickness_ = thickness; } + void SetBorderWidth(const Thickness& thickness) { + border_thickness_ = thickness; + } CornerRadius GetCornerRadius() const { return corner_radius_; } void SetCornerRadius(const CornerRadius& new_corner_radius) { @@ -58,6 +65,8 @@ class BorderRenderObject : public RenderObject { protected: void OnAddChild(RenderObject* new_child, int position) override; + void OnSizeChanged(const Size& old_size, const Size& new_size) override; + void OnMeasureCore(const Size& available_size) override; void OnLayoutCore(const Rect& rect) override; Size OnMeasureContent(const Size& available_size) override; |