From 6aa2201797a9ed64ce0178215ae941d0c5f09579 Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 30 Oct 2020 00:07:57 +0800 Subject: ... --- include/cru/ui/render/TextRenderObject.hpp | 38 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'include/cru/ui/render/TextRenderObject.hpp') diff --git a/include/cru/ui/render/TextRenderObject.hpp b/include/cru/ui/render/TextRenderObject.hpp index 3be42bbb..fa569c8c 100644 --- a/include/cru/ui/render/TextRenderObject.hpp +++ b/include/cru/ui/render/TextRenderObject.hpp @@ -24,10 +24,10 @@ class TextRenderObject : public RenderObject { constexpr static float default_caret_width = 2; public: - TextRenderObject(std::shared_ptr brush, - std::shared_ptr font, - std::shared_ptr selection_brush, - std::shared_ptr caret_brush); + TextRenderObject(std::shared_ptr brush, + std::shared_ptr font, + std::shared_ptr selection_brush, + std::shared_ptr caret_brush); TextRenderObject(const TextRenderObject& other) = delete; TextRenderObject(TextRenderObject&& other) = delete; TextRenderObject& operator=(const TextRenderObject& other) = delete; @@ -38,25 +38,25 @@ class TextRenderObject : public RenderObject { std::u16string_view GetTextView() const; void SetText(std::u16string new_text); - std::shared_ptr GetBrush() const { return brush_; } - void SetBrush(std::shared_ptr new_brush); + std::shared_ptr GetBrush() const { return brush_; } + void SetBrush(std::shared_ptr new_brush); - std::shared_ptr GetFont() const; - void SetFont(std::shared_ptr font); + std::shared_ptr GetFont() const; + void SetFont(std::shared_ptr font); std::vector TextRangeRect(const TextRange& text_range); Point TextSinglePoint(gsl::index position, bool trailing); - platform::graph::TextHitTestResult TextHitTest(const Point& point); + platform::graphics::TextHitTestResult TextHitTest(const Point& point); std::optional GetSelectionRange() const { return selection_range_; } void SetSelectionRange(std::optional new_range); - std::shared_ptr GetSelectionBrush() const { + std::shared_ptr GetSelectionBrush() const { return selection_brush_; } - void SetSelectionBrush(std::shared_ptr new_brush); + void SetSelectionBrush(std::shared_ptr new_brush); bool IsDrawCaret() const { return draw_caret_; } void SetDrawCaret(bool draw_caret); @@ -72,10 +72,10 @@ class TextRenderObject : public RenderObject { // Lefttop relative to render object lefttop. Rect GetCaretRect(); - std::shared_ptr GetCaretBrush() const { + std::shared_ptr GetCaretBrush() const { return caret_brush_; } - void GetCaretBrush(std::shared_ptr brush); + void GetCaretBrush(std::shared_ptr brush); float GetCaretWidth() const { return caret_width_; } void SetCaretWidth(float width); @@ -83,7 +83,7 @@ class TextRenderObject : public RenderObject { RenderObject* HitTest(const Point& point) override; protected: - void OnDrawContent(platform::graph::IPainter* painter) override; + void OnDrawContent(platform::graphics::IPainter* painter) override; // See remarks of this class. Size OnMeasureContent(const MeasureRequirement& requirement, @@ -93,16 +93,16 @@ class TextRenderObject : public RenderObject { void OnAfterLayout() override; private: - std::shared_ptr brush_; - std::shared_ptr font_; - std::unique_ptr text_layout_; + std::shared_ptr brush_; + std::shared_ptr font_; + std::unique_ptr text_layout_; std::optional selection_range_ = std::nullopt; - std::shared_ptr selection_brush_; + std::shared_ptr selection_brush_; bool draw_caret_ = false; gsl::index caret_position_ = 0; - std::shared_ptr caret_brush_; + std::shared_ptr caret_brush_; float caret_width_ = default_caret_width; }; } // namespace cru::ui::render -- cgit v1.2.3