From 6268f3ca09afef812cf288f323cacff22fbfcffc Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 4 Apr 2019 23:08:22 +0800 Subject: Finish refactor!!! --- src/platform_win/win_text_layout.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/platform_win/win_text_layout.cpp') diff --git a/src/platform_win/win_text_layout.cpp b/src/platform_win/win_text_layout.cpp index 7ae87a80..04b5e928 100644 --- a/src/platform_win/win_text_layout.cpp +++ b/src/platform_win/win_text_layout.cpp @@ -17,8 +17,9 @@ WinTextLayout::WinTextLayout(GraphManager* graph_manager, font_descriptor_.swap(font); ThrowIfFailed(graph_manager_->GetDWriteFactory()->CreateTextLayout( - text_.c_str(), text_.size(), font_descriptor_->GetDWriteTextFormat(), - max_width_, max_height_, &text_layout_)); + text_.c_str(), static_cast(text_.size()), + font_descriptor_->GetDWriteTextFormat(), max_width_, max_height_, + &text_layout_)); } std::wstring WinTextLayout::GetText() { return text_; } @@ -26,8 +27,9 @@ std::wstring WinTextLayout::GetText() { return text_; } void WinTextLayout::SetText(std::wstring new_text) { text_.swap(new_text); ThrowIfFailed(graph_manager_->GetDWriteFactory()->CreateTextLayout( - text_.c_str(), text_.size(), font_descriptor_->GetDWriteTextFormat(), - max_width_, max_height_, &text_layout_)); + text_.c_str(), static_cast(text_.size()), + font_descriptor_->GetDWriteTextFormat(), max_width_, max_height_, + &text_layout_)); } std::shared_ptr WinTextLayout::GetFont() { @@ -39,8 +41,9 @@ void WinTextLayout::SetFont(std::shared_ptr font) { assert(f); f.swap(font_descriptor_); ThrowIfFailed(graph_manager_->GetDWriteFactory()->CreateTextLayout( - text_.c_str(), text_.size(), font_descriptor_->GetDWriteTextFormat(), - max_width_, max_height_, &text_layout_)); + text_.c_str(), static_cast(text_.size()), + font_descriptor_->GetDWriteTextFormat(), max_width_, max_height_, + &text_layout_)); } void WinTextLayout::SetMaxWidth(float max_width) { -- cgit v1.2.3