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
59051383
Commit
59051383
authored
Mar 20, 2014
by
tebjan
Browse files
some OnAttributeChanged events would not be fired, added changed check for some attributes
parent
18ec8075
Changes
4
Hide whitespace changes
Inline
Side-by-side
Source/Basic Shapes/SvgCircle.cs
View file @
59051383
...
@@ -36,27 +36,43 @@ namespace Svg
...
@@ -36,27 +36,43 @@ namespace Svg
get
{
return
this
.
_centerX
;
}
get
{
return
this
.
_centerX
;
}
set
set
{
{
this
.
_centerX
=
value
;
if
(
_centerX
!=
value
)
this
.
IsPathDirty
=
true
;
{
this
.
_centerX
=
value
;
this
.
IsPathDirty
=
true
;
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"cx"
,
Value
=
value
});
}
}
}
}
}
[
SvgAttribute
(
"cy"
)]
[
SvgAttribute
(
"cy"
)]
public
virtual
SvgUnit
CenterY
public
virtual
SvgUnit
CenterY
{
{
get
{
return
this
.
_centerY
;
}
get
{
return
this
.
_centerY
;
}
set
set
{
{
this
.
_centerY
=
value
;
if
(
_centerY
!=
value
)
this
.
IsPathDirty
=
true
;
{
}
this
.
_centerY
=
value
;
this
.
IsPathDirty
=
true
;
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"cy"
,
Value
=
value
});
}
}
}
}
[
SvgAttribute
(
"r"
)]
[
SvgAttribute
(
"r"
)]
public
virtual
SvgUnit
Radius
public
virtual
SvgUnit
Radius
{
{
get
{
return
this
.
_radius
;
}
get
{
return
this
.
_radius
;
}
set
{
this
.
_radius
=
value
;
this
.
IsPathDirty
=
true
;
}
set
{
if
(
_radius
!=
value
)
{
this
.
_radius
=
value
;
this
.
IsPathDirty
=
true
;
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"r"
,
Value
=
value
});
}
}
}
}
/// <summary>
/// <summary>
...
...
Source/Basic Shapes/SvgRectangle.cs
View file @
59051383
...
@@ -46,13 +46,16 @@ namespace Svg
...
@@ -46,13 +46,16 @@ namespace Svg
[
SvgAttribute
(
"x"
)]
[
SvgAttribute
(
"x"
)]
public
SvgUnit
X
public
SvgUnit
X
{
{
get
{
return
_x
;
}
get
{
return
_x
;
}
set
set
{
{
_x
=
value
;
if
(
_x
!=
value
)
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"x"
,
Value
=
value
});
{
IsPathDirty
=
true
;
_x
=
value
;
}
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"x"
,
Value
=
value
});
IsPathDirty
=
true
;
}
}
}
}
/// <summary>
/// <summary>
...
@@ -61,13 +64,16 @@ namespace Svg
...
@@ -61,13 +64,16 @@ namespace Svg
[
SvgAttribute
(
"y"
)]
[
SvgAttribute
(
"y"
)]
public
SvgUnit
Y
public
SvgUnit
Y
{
{
get
{
return
_y
;
}
get
{
return
_y
;
}
set
set
{
{
_y
=
value
;
if
(
_y
!=
value
)
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"y"
,
Value
=
value
});
{
IsPathDirty
=
true
;
_y
=
value
;
}
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"y"
,
Value
=
value
});
IsPathDirty
=
true
;
}
}
}
}
/// <summary>
/// <summary>
...
@@ -76,13 +82,16 @@ namespace Svg
...
@@ -76,13 +82,16 @@ namespace Svg
[
SvgAttribute
(
"width"
)]
[
SvgAttribute
(
"width"
)]
public
SvgUnit
Width
public
SvgUnit
Width
{
{
get
{
return
_width
;
}
get
{
return
_width
;
}
set
set
{
{
_width
=
value
;
if
(
_width
!=
value
)
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"width"
,
Value
=
value
});
{
IsPathDirty
=
true
;
_width
=
value
;
}
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"width"
,
Value
=
value
});
IsPathDirty
=
true
;
}
}
}
}
/// <summary>
/// <summary>
...
@@ -91,13 +100,16 @@ namespace Svg
...
@@ -91,13 +100,16 @@ namespace Svg
[
SvgAttribute
(
"height"
)]
[
SvgAttribute
(
"height"
)]
public
SvgUnit
Height
public
SvgUnit
Height
{
{
get
{
return
_height
;
}
get
{
return
_height
;
}
set
set
{
{
_height
=
value
;
if
(
_height
!=
value
)
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"height"
,
Value
=
value
});
{
IsPathDirty
=
true
;
_height
=
value
;
}
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"height"
,
Value
=
value
});
IsPathDirty
=
true
;
}
}
}
}
/// <summary>
/// <summary>
...
...
Source/Paths/SvgPath.cs
View file @
59051383
...
@@ -18,7 +18,6 @@ namespace Svg
...
@@ -18,7 +18,6 @@ namespace Svg
public
class
SvgPath
:
SvgVisualElement
public
class
SvgPath
:
SvgVisualElement
{
{
private
GraphicsPath
_path
;
private
GraphicsPath
_path
;
private
int
_pathLength
;
/// <summary>
/// <summary>
/// Gets or sets a <see cref="SvgPathSegmentList"/> of path data.
/// Gets or sets a <see cref="SvgPathSegmentList"/> of path data.
...
@@ -41,8 +40,8 @@ namespace Svg
...
@@ -41,8 +40,8 @@ namespace Svg
[
SvgAttribute
(
"pathLength"
)]
[
SvgAttribute
(
"pathLength"
)]
public
int
PathLength
public
int
PathLength
{
{
get
{
return
this
.
_
pathLength
;
}
get
{
return
this
.
Attributes
.
GetAttribute
<
int
>(
"
pathLength
"
)
;
}
set
{
this
.
_
pathLength
=
value
;
}
set
{
this
.
Attributes
[
"
pathLength
"
]
=
value
;
}
}
}
...
...
Source/Text/SvgText.cs
View file @
59051383
...
@@ -85,13 +85,16 @@ namespace Svg
...
@@ -85,13 +85,16 @@ namespace Svg
[
SvgAttribute
(
"x"
)]
[
SvgAttribute
(
"x"
)]
public
virtual
SvgUnit
X
public
virtual
SvgUnit
X
{
{
get
{
return
this
.
_x
;
}
get
{
return
this
.
_x
;
}
set
set
{
{
this
.
_x
=
value
;
if
(
_x
!=
value
)
this
.
IsPathDirty
=
true
;
{
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"x"
,
Value
=
value
});
this
.
_x
=
value
;
}
this
.
IsPathDirty
=
true
;
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"x"
,
Value
=
value
});
}
}
}
}
/// <summary>
/// <summary>
...
@@ -101,13 +104,16 @@ namespace Svg
...
@@ -101,13 +104,16 @@ namespace Svg
[
SvgAttribute
(
"y"
)]
[
SvgAttribute
(
"y"
)]
public
virtual
SvgUnit
Y
public
virtual
SvgUnit
Y
{
{
get
{
return
this
.
_y
;
}
get
{
return
this
.
_y
;
}
set
set
{
{
this
.
_y
=
value
;
if
(
_y
!=
value
)
this
.
IsPathDirty
=
true
;
{
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"y"
,
Value
=
value
});
this
.
_y
=
value
;
}
this
.
IsPathDirty
=
true
;
OnAttributeChanged
(
new
AttributeEventArgs
{
Attribute
=
"y"
,
Value
=
value
});
}
}
}
}
/// <summary>
/// <summary>
...
...
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