From f55a20fd3bad952481339d47ff844ad816192f50 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 2 Oct 2018 00:32:21 +0800 Subject: Fix measure system of border. --- src/ui/controls/button.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/ui/controls/button.cpp') diff --git a/src/ui/controls/button.cpp b/src/ui/controls/button.cpp index 630c0c39..2ecc9f14 100644 --- a/src/ui/controls/button.cpp +++ b/src/ui/controls/button.cpp @@ -29,6 +29,16 @@ namespace cru::ui::controls border_delegate_->Draw(device_context, GetSize()); } + Size Button::OnMeasure(const Size& available_size) + { + return Control::DefaultMeasureWithPadding(available_size, border_delegate_->GetBorderThickness()); + } + + void Button::OnLayout(const Rect& rect) + { + Control::DefaultLayoutWithPadding(rect, border_delegate_->GetBorderThickness()); + } + void Button::OnMouseClickBegin(MouseButton button) { border_delegate_->SetBorderProperty(pressed_border_border_); -- cgit v1.2.3