From d7fbe9332f01153efaea40e7a35f0025c75b9a04 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Sun, 16 Nov 2025 10:22:07 +0800 Subject: Abstract out AutoDestruct. --- src/ui/render/TextRenderObject.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/ui/render/TextRenderObject.cpp') diff --git a/src/ui/render/TextRenderObject.cpp b/src/ui/render/TextRenderObject.cpp index 18020032..c7803383 100644 --- a/src/ui/render/TextRenderObject.cpp +++ b/src/ui/render/TextRenderObject.cpp @@ -187,8 +187,7 @@ void TextRenderObject::Draw(platform::graphics::IPainter* painter) { } if (this->selection_range_.has_value()) { - const auto&& rects = - text_layout_->TextRangeRect(this->selection_range_.value()); + const auto&& rects = text_layout_->TextRangeRect(*this->selection_range_); for (const auto& rect : rects) painter->FillRectangle(rect, this->GetSelectionBrush().get()); } -- cgit v1.2.3