This repository was archived by the owner on Nov 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 236
/
Copy pathD2DShapeStyle.cpp
104 lines (91 loc) · 1.88 KB
/
D2DShapeStyle.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#include "pch.h"
#include "D2DShapeStyle.h"
namespace Telerik
{
namespace UI
{
namespace Drawing
{
D2DShapeStyle::D2DShapeStyle(void)
{
this->strokeThickness = 1;
}
D2DShapeStyle^ D2DShapeStyle::Clone()
{
auto style = ref new D2DShapeStyle();
if(this->fill != nullptr)
{
style->fill = this->fill->Clone();
}
if(this->stroke != nullptr)
{
style->stroke = this->stroke->Clone();
}
if(this->foreground != nullptr)
{
style->foreground = this->foreground->Clone();
}
style->strokeThickness = this->strokeThickness;
return style;
}
void D2DShapeStyle::CopyFromStyle(D2DShapeStyle^ source)
{
this->fill = source->fill;
this->stroke = source->stroke;
this->foreground = source->foreground;
this->strokeThickness = source->strokeThickness;
}
void D2DShapeStyle::UpdateNullValuesFromStyle(D2DShapeStyle^ source)
{
if(this->fill == nullptr)
{
this->fill = source->fill;
}
if(this->stroke == nullptr)
{
this->stroke = source->stroke;
}
if(this->foreground == nullptr)
{
this->foreground = source->foreground;
}
}
void D2DShapeStyle::InitRender(D2DRenderContext^ context)
{
if(this->fill != nullptr)
{
this->fill->InitRender(context);
}
if(this->stroke != nullptr)
{
this->stroke->InitRender(context);
}
if(this->foreground != nullptr)
{
this->foreground->InitRender(context);
}
}
void D2DShapeStyle::Reset()
{
if(this->fill != nullptr)
{
this->fill->Reset();
}
if(this->stroke != nullptr)
{
this->stroke->Reset();
}
if(this->foreground != nullptr)
{
this->foreground->Reset();
}
}
void D2DShapeStyle::ResetToNullValues()
{
this->fill = nullptr;
this->stroke = nullptr;
this->foreground = nullptr;
}
}
}
}