Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ImportedProjects
SVG
Commits
f9088cab
Commit
f9088cab
authored
Jul 08, 2013
by
Tebjan Halm
Browse files
fixed circle attributes
parent
7e3424cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Source/Basic Shapes/SvgCircle.cs
View file @
f9088cab
...
...
@@ -16,6 +16,10 @@ namespace Svg
public
class
SvgCircle
:
SvgVisualElement
{
private
GraphicsPath
_path
;
private
SvgUnit
_radius
;
private
SvgUnit
_centerX
;
private
SvgUnit
_centerY
;
/// <summary>
/// Gets the center point of the circle.
...
...
@@ -26,58 +30,33 @@ namespace Svg
get
{
return
new
SvgPoint
(
this
.
CenterX
,
this
.
CenterY
);
}
}
/// <summary>
/// Gets or sets the center X co-ordinate.
/// </summary>
/// <value>The center X.</value>
[
SvgAttribute
(
"cx"
)]
public
SvgUnit
CenterX
public
virtual
SvgUnit
CenterX
{
get
{
return
this
.
Attributes
.
GetAttribute
<
SvgUnit
>(
"cx"
)
;
}
get
{
return
this
.
_centerX
;
}
set
{
if
(
this
.
Attributes
.
GetAttribute
<
SvgUnit
>(
"cx"
)
!=
value
)
{
this
.
Attributes
[
"cx"
]
=
value
;
this
.
IsPathDirty
=
true
;
}
this
.
_centerX
=
value
;
this
.
IsPathDirty
=
true
;
}
}
/// <summary>
/// Gets or sets the center Y co-ordinate.
/// </summary>
/// <value>The center Y.</value>
[
SvgAttribute
(
"cy"
)]
public
SvgUnit
CenterY
public
virtual
SvgUnit
CenterY
{
get
{
return
this
.
Attributes
.
GetAttribute
<
SvgUnit
>(
"cy"
)
;
}
get
{
return
this
.
_centerY
;
}
set
{
if
(
this
.
Attributes
.
GetAttribute
<
SvgUnit
>(
"cy"
)
!=
value
)
{
this
.
Attributes
[
"cy"
]
=
value
;
this
.
IsPathDirty
=
true
;
}
this
.
_centerY
=
value
;
this
.
IsPathDirty
=
true
;
}
}
/// <summary>
/// Gets or sets the radius of the circle.
/// </summary>
/// <value>The radius.</value>
[
SvgAttribute
(
"r"
)]
public
SvgUnit
Radius
public
virtual
SvgUnit
Radius
{
get
{
return
this
.
Attributes
.
GetAttribute
<
SvgUnit
>(
"r"
);
}
set
{
if
(
this
.
Attributes
.
GetAttribute
<
SvgUnit
>(
"r"
)
!=
value
)
{
this
.
Attributes
[
"r"
]
=
value
;
this
.
IsPathDirty
=
true
;
}
}
get
{
return
this
.
_radius
;
}
set
{
this
.
_radius
=
value
;
this
.
IsPathDirty
=
true
;
}
}
/// <summary>
...
...
Source/SvgDefinitionDefaults.cs
View file @
f9088cab
...
...
@@ -22,6 +22,8 @@ namespace Svg
_defaults
[
"clip-rule"
]
=
"nonzero"
;
_defaults
[
"transform"
]
=
""
;
_defaults
[
"rx"
]
=
"0"
;
_defaults
[
"ry"
]
=
"0"
;
_defaults
[
"cx"
]
=
"0"
;
_defaults
[
"cy"
]
=
"0"
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment