From 83736f1208a613d2457147c2df3f493228bab3cb Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 8 Jul 2020 17:14:42 +0800 Subject: ... --- include/cru/ui/render/ScrollRenderObject.hpp | 2 +- include/cru/ui/render/TextRenderObject.hpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/cru/ui/render/ScrollRenderObject.hpp b/include/cru/ui/render/ScrollRenderObject.hpp index 20b7278c..45fa3993 100644 --- a/include/cru/ui/render/ScrollRenderObject.hpp +++ b/include/cru/ui/render/ScrollRenderObject.hpp @@ -29,7 +29,7 @@ class ScrollRenderObject : public RenderObject { Point GetRawScrollOffset() const { return scroll_offset_; } // Rect lefttop relative to content rect. - void ScrollToContain(const Rect& rect); + void ScrollToContain(const Rect& rect, const Thickness& margin = Thickness{}); protected: void OnDrawCore(platform::graph::IPainter* painter) override; diff --git a/include/cru/ui/render/TextRenderObject.hpp b/include/cru/ui/render/TextRenderObject.hpp index 32d96797..0b276415 100644 --- a/include/cru/ui/render/TextRenderObject.hpp +++ b/include/cru/ui/render/TextRenderObject.hpp @@ -66,6 +66,11 @@ class TextRenderObject : public RenderObject { gsl::index GetCaretPosition() const { return caret_position_; } void SetCaretPosition(gsl::index position); + // Lefttop relative to content lefttop. + Rect GetCaretRectInContent(); + // Lefttop relative to render object lefttop. + Rect GetCaretRect(); + std::shared_ptr GetCaretBrush() const { return caret_brush_; } -- cgit v1.2.3