aboutsummaryrefslogtreecommitdiff
path: root/src/platform_win/win_text_layout.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-04-04 23:08:22 +0800
committercrupest <crupest@outlook.com>2019-04-04 23:08:22 +0800
commit6268f3ca09afef812cf288f323cacff22fbfcffc (patch)
tree86e89d3b4212ae069075f799a5278c120e258e73 /src/platform_win/win_text_layout.cpp
parentdbda5a8e4f0d59ad95be8fc3ee7b21e9122cc474 (diff)
downloadcru-6268f3ca09afef812cf288f323cacff22fbfcffc.tar.gz
cru-6268f3ca09afef812cf288f323cacff22fbfcffc.tar.bz2
cru-6268f3ca09afef812cf288f323cacff22fbfcffc.zip
Finish refactor!!!
Diffstat (limited to 'src/platform_win/win_text_layout.cpp')
-rw-r--r--src/platform_win/win_text_layout.cpp15
1 files changed, 9 insertions, 6 deletions
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<UINT32>(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<UINT32>(text_.size()),
+ font_descriptor_->GetDWriteTextFormat(), max_width_, max_height_,
+ &text_layout_));
}
std::shared_ptr<FontDescriptor> WinTextLayout::GetFont() {
@@ -39,8 +41,9 @@ void WinTextLayout::SetFont(std::shared_ptr<FontDescriptor> 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<UINT32>(text_.size()),
+ font_descriptor_->GetDWriteTextFormat(), max_width_, max_height_,
+ &text_layout_));
}
void WinTextLayout::SetMaxWidth(float max_width) {