aboutsummaryrefslogtreecommitdiff
path: root/src/ui/border_property.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-11-05 20:54:48 +0800
committercrupest <crupest@outlook.com>2018-11-05 20:54:48 +0800
commit1dab244aaad8694ba37ef43caedd8c8ba0310c00 (patch)
treef70f6489a0f88520a0bdc095cd9713d03f83687b /src/ui/border_property.cpp
parent252519effe30881825dd02e26dc41bd9cde34782 (diff)
downloadcru-1dab244aaad8694ba37ef43caedd8c8ba0310c00.tar.gz
cru-1dab244aaad8694ba37ef43caedd8c8ba0310c00.tar.bz2
cru-1dab244aaad8694ba37ef43caedd8c8ba0310c00.zip
...
Diffstat (limited to 'src/ui/border_property.cpp')
-rw-r--r--src/ui/border_property.cpp31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/ui/border_property.cpp b/src/ui/border_property.cpp
index 03cae16e..f716a8be 100644
--- a/src/ui/border_property.cpp
+++ b/src/ui/border_property.cpp
@@ -4,40 +4,13 @@
namespace cru::ui
{
- BorderProperty::BorderProperty()
+ BorderProperty::BorderProperty(): BorderProperty(graph::CreateSolidBrush(D2D1::ColorF(D2D1::ColorF::Black)))
{
- brush_ = graph::CreateSolidBrush(D2D1::ColorF(D2D1::ColorF::Black));
- }
-
- void BorderProperty::SetBrush(Microsoft::WRL::ComPtr<ID2D1Brush> brush)
- {
- if (brush == nullptr)
- throw std::invalid_argument("Brush of BorderProperty mustn't be null.");
- brush_ = std::move(brush);
- RaisePropertyChangedEvent(brush_property_name);
- }
-
- void BorderProperty::SetWidth(const float width)
- {
- stroke_width_ = width;
- RaisePropertyChangedEvent(width_property_name);
- }
- void BorderProperty::SetStrokeStyle(Microsoft::WRL::ComPtr<ID2D1StrokeStyle> stroke_style)
- {
- stroke_style_ = std::move(stroke_style);
- RaisePropertyChangedEvent(stroke_style_property_name);
}
- void BorderProperty::SetRadiusX(const float radius_x)
+ BorderProperty::BorderProperty(Microsoft::WRL::ComPtr<ID2D1Brush> brush): brush_(std::move(brush))
{
- radius_x_ = radius_x;
- RaisePropertyChangedEvent(radius_x_property_name);
- }
- void BorderProperty::SetRadiusY(const float radius_y)
- {
- radius_y_ = radius_y;
- RaisePropertyChangedEvent(radius_y_property_name);
}
}