diff options
Diffstat (limited to 'src/ui/render/GeometryRenderObject.cpp')
| -rw-r--r-- | src/ui/render/GeometryRenderObject.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/ui/render/GeometryRenderObject.cpp b/src/ui/render/GeometryRenderObject.cpp index 84379b39..1ab0d8ed 100644 --- a/src/ui/render/GeometryRenderObject.cpp +++ b/src/ui/render/GeometryRenderObject.cpp @@ -60,9 +60,23 @@ void GeometryRenderObject::SetStrokeWidth(float width) { InvalidatePaint(); } -void GeometryRenderObject::Draw(platform::graphics::IPainter* painter) { +RenderObject* GeometryRenderObject::HitTest(const Point& point) { + return GetPaddingRect().IsPointInside(point) ? this : nullptr; +} + +Size GeometryRenderObject::OnMeasureContent( + const MeasureRequirement& requirement) { + Size result = GetViewPort().GetSize(); + return requirement.ExpandToSuggestAndCoerce(result); +} + +void GeometryRenderObject::OnLayoutContent(const Rect& content_rect) {} + +void GeometryRenderObject::OnDraw(RenderObjectDrawContext& context) { if (!geometry_) return; + auto painter = context.painter; + painter->PushState(); auto content_rect = GetContentRect(); @@ -86,15 +100,4 @@ void GeometryRenderObject::Draw(platform::graphics::IPainter* painter) { painter->PopState(); } -RenderObject* GeometryRenderObject::HitTest(const Point& point) { - return GetPaddingRect().IsPointInside(point) ? this : nullptr; -} - -Size GeometryRenderObject::OnMeasureContent( - const MeasureRequirement& requirement) { - Size result = GetViewPort().GetSize(); - return requirement.ExpandToSuggestAndCoerce(result); -} - -void GeometryRenderObject::OnLayoutContent(const Rect& content_rect) {} } // namespace cru::ui::render |
