aboutsummaryrefslogtreecommitdiff
path: root/src/ui/render/WindowRenderObject.cpp
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 /src/ui/render/WindowRenderObject.cpp
parentd86a71f79afe0e4dac768f61d6bff690567aca5b (diff)
downloadcru-4f0a2f32c273780c32cc3937615c2a8bbd993aab.tar.gz
cru-4f0a2f32c273780c32cc3937615c2a8bbd993aab.tar.bz2
cru-4f0a2f32c273780c32cc3937615c2a8bbd993aab.zip
...
Diffstat (limited to 'src/ui/render/WindowRenderObject.cpp')
-rw-r--r--src/ui/render/WindowRenderObject.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ui/render/WindowRenderObject.cpp b/src/ui/render/WindowRenderObject.cpp
index cd1f806f..28afe01d 100644
--- a/src/ui/render/WindowRenderObject.cpp
+++ b/src/ui/render/WindowRenderObject.cpp
@@ -34,9 +34,14 @@ RenderObject* WindowRenderObject::HitTest(const Point& point) {
return Rect{Point{}, GetSize()}.IsPointInside(point) ? this : nullptr;
}
-Size WindowRenderObject::OnMeasureContent(const Size& available_size) {
- if (const auto child = GetChild()) child->Measure(available_size);
- return available_size;
+Size WindowRenderObject::OnMeasureContent(
+ const MeasureRequirement& requirement) {
+ if (const auto child = GetChild()) {
+ child->Measure(requirement);
+ return child->GetMeasuredSize();
+ } else {
+ return Size{};
+ }
}
void WindowRenderObject::OnLayoutContent(const Rect& content_rect) {