diff options
author | crupest <crupest@outlook.com> | 2019-05-24 23:45:58 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-05-24 23:45:58 +0800 |
commit | b6db663269201fa14a6a4aa1b9042645a9e8f859 (patch) | |
tree | 1984e2c2784fb9623d4c20fbdd6fc650792e133c /include/cru/win/graph/win_text_layout.hpp | |
parent | b9df1bcaea0c19b2e29479cdb1ad5a39e23c4ee7 (diff) | |
download | cru-b6db663269201fa14a6a4aa1b9042645a9e8f859.tar.gz cru-b6db663269201fa14a6a4aa1b9042645a9e8f859.tar.bz2 cru-b6db663269201fa14a6a4aa1b9042645a9e8f859.zip |
...
Diffstat (limited to 'include/cru/win/graph/win_text_layout.hpp')
-rw-r--r-- | include/cru/win/graph/win_text_layout.hpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/cru/win/graph/win_text_layout.hpp b/include/cru/win/graph/win_text_layout.hpp index b861fda7..7339eff9 100644 --- a/include/cru/win/graph/win_text_layout.hpp +++ b/include/cru/win/graph/win_text_layout.hpp @@ -6,12 +6,12 @@ #include <memory> namespace cru::win::graph { -class GraphManager; +struct IWinNativeFactory; class WinFontDescriptor; -class WinTextLayout : public Object, public virtual platform::graph::TextLayout { +class WinTextLayout : public Object, public virtual platform::graph::ITextLayout { public: - explicit WinTextLayout(GraphManager* graph_manager, + explicit WinTextLayout(IWinNativeFactory* factory, std::shared_ptr<WinFontDescriptor> font, std::wstring text); WinTextLayout(const WinTextLayout& other) = delete; WinTextLayout(WinTextLayout&& other) = delete; @@ -21,8 +21,8 @@ class WinTextLayout : public Object, public virtual platform::graph::TextLayout std::wstring GetText() override; void SetText(std::wstring new_text) override; - std::shared_ptr<platform::graph::FontDescriptor> GetFont(); - void SetFont(std::shared_ptr<platform::graph::FontDescriptor> font); + std::shared_ptr<platform::graph::IFontDescriptor> GetFont(); + void SetFont(std::shared_ptr<platform::graph::IFontDescriptor> font); void SetMaxWidth(float max_width) override; void SetMaxHeight(float max_height) override; ui::Rect GetTextBounds() override; @@ -32,7 +32,7 @@ class WinTextLayout : public Object, public virtual platform::graph::TextLayout IDWriteTextLayout* GetDWriteTextLayout() const { return text_layout_.Get(); } private: - GraphManager* graph_manager_; + IWinNativeFactory* factory_; std::wstring text_; std::shared_ptr<WinFontDescriptor> font_descriptor_; float max_width_ = 0.0f; |