diff options
Diffstat (limited to 'include/cru/ui/render/LayoutRenderObject.h')
-rw-r--r-- | include/cru/ui/render/LayoutRenderObject.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/cru/ui/render/LayoutRenderObject.h b/include/cru/ui/render/LayoutRenderObject.h index 05da1bb8..62ee9005 100644 --- a/include/cru/ui/render/LayoutRenderObject.h +++ b/include/cru/ui/render/LayoutRenderObject.h @@ -1,7 +1,7 @@ #pragma once #include "RenderObject.h" -#include "cru/platform/graphics/util/Painter.h" +#include "cru/platform/graphics/Painter.h" namespace cru::ui::render { template <typename TChildLayoutData> @@ -54,6 +54,16 @@ class CRU_UI_API LayoutRenderObject : public RenderObject { return children_[position].layout_data; } + void Draw(platform::graphics::IPainter* painter) override { + for (auto& child : children_) { + painter->PushState(); + painter->ConcatTransform( + Matrix::Translation(child.render_object->GetOffset())); + child.render_object->Draw(painter); + painter->PopState(); + } + } + RenderObject* HitTest(const Point& point) override { const auto child_count = GetChildCount(); for (auto i = child_count - 1; i >= 0; --i) { |