aboutsummaryrefslogtreecommitdiff
path: root/src/ui/render
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-03-20 19:26:55 +0800
committercrupest <crupest@outlook.com>2019-03-20 19:26:55 +0800
commit616ebd78b543876388cb3d64f108abea041d4983 (patch)
tree8cae90f29695a3bd534b3ae5e32218d79719ba91 /src/ui/render
parentd518396a7fcdb2add413a9a37bb34515ff4f4cc4 (diff)
downloadcru-616ebd78b543876388cb3d64f108abea041d4983.tar.gz
cru-616ebd78b543876388cb3d64f108abea041d4983.tar.bz2
cru-616ebd78b543876388cb3d64f108abea041d4983.zip
...
Diffstat (limited to 'src/ui/render')
-rw-r--r--src/ui/render/text_render_object.hpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ui/render/text_render_object.hpp b/src/ui/render/text_render_object.hpp
index b868796d..d1d91034 100644
--- a/src/ui/render/text_render_object.hpp
+++ b/src/ui/render/text_render_object.hpp
@@ -18,7 +18,10 @@ class TextRenderObject : public RenderObject {
~TextRenderObject() override = default;
String GetText() const { return text_; }
- void SetText(String new_text) { text_ = std::move(new_text); }
+ void SetText(String new_text) {
+ text_ = std::move(new_text);
+ RecreateTextLayout();
+ }
Microsoft::WRL::ComPtr<ID2D1Brush> GetBrush() const { return brush_; }
void SetBrush(Microsoft::WRL::ComPtr<ID2D1Brush> new_brush) {
@@ -31,6 +34,7 @@ class TextRenderObject : public RenderObject {
void SetTextFormat(
Microsoft::WRL::ComPtr<IDWriteTextFormat> new_text_format) {
text_format_ = std::move(new_text_format);
+ RecreateTextLayout();
}
std::optional<TextRange> GetSelectionRange() const {