aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/controls')
-rw-r--r--src/ui/controls/text_control.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ui/controls/text_control.cpp b/src/ui/controls/text_control.cpp
index 5769af58..09bc29e1 100644
--- a/src/ui/controls/text_control.cpp
+++ b/src/ui/controls/text_control.cpp
@@ -77,8 +77,9 @@ namespace cru::ui::controls
void TextControl::OnSizeChangedCore(events::SizeChangedEventArgs& args)
{
Control::OnSizeChangedCore(args);
- ThrowIfFailed(text_layout_->SetMaxWidth(args.GetNewSize().width));
- ThrowIfFailed(text_layout_->SetMaxHeight(args.GetNewSize().height));
+ const auto content = GetRect(RectRange::Content);
+ ThrowIfFailed(text_layout_->SetMaxWidth(content.width));
+ ThrowIfFailed(text_layout_->SetMaxHeight(content.height));
Repaint();
}