aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/border_delegate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/controls/border_delegate.cpp')
-rw-r--r--src/ui/controls/border_delegate.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ui/controls/border_delegate.cpp b/src/ui/controls/border_delegate.cpp
index 4031d787..ec7ba437 100644
--- a/src/ui/controls/border_delegate.cpp
+++ b/src/ui/controls/border_delegate.cpp
@@ -61,12 +61,19 @@ namespace cru::ui::controls
border_property_->RemovePropertyChangedListener(border_property_changed_listener_);
border_property_ = std::move(border_property);
border_property_->AddPropertyChangedListener(border_property_changed_listener_);
+ control_->Repaint();
}
void BorderDelegate::Draw(ID2D1DeviceContext* device_context, const Size& size) const
{
device_context->DrawRoundedRectangle(
- D2D1::RoundedRect(D2D1::RectF(0.0f, 0.0f, size.width, size.height),
+ D2D1::RoundedRect(
+ D2D1::RectF(
+ border_property_->GetWidth() / 2.0f,
+ border_property_->GetWidth() / 2.0f,
+ size.width - border_property_->GetWidth(),
+ size.height - border_property_->GetWidth()
+ ),
border_property_->GetRadiusX(),
border_property_->GetRadiusY()
),