aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/cru/ui/render/ScrollRenderObject.hpp2
-rw-r--r--include/cru/ui/render/TextRenderObject.hpp5
2 files changed, 6 insertions, 1 deletions
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<platform::graph::IBrush> GetCaretBrush() const {
return caret_brush_;
}