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
6d38adf2
Commit
6d38adf2
authored
Jun 12, 2014
by
tebjan
Browse files
fixed 'none' errors for SvgUnits
parent
5dbfa773
Changes
2
Hide whitespace changes
Inline
Side-by-side
Source/DataTypes/SvgUnit.cs
View file @
6d38adf2
...
...
@@ -165,26 +165,43 @@ namespace Svg
}
}
/// <summary>
/// Indicates whether this instance and a specified object are equal.
/// </summary>
/// <param name="obj">Another object to compare to.</param>
/// <returns>
/// true if <paramref name="obj"/> and this instance are the same type and represent the same value; otherwise, false.
/// </returns>
public
override
bool
Equals
(
object
obj
)
{
if
(
obj
==
null
)
return
false
;
#
region
Equals
and
GetHashCode
implementation
public
override
bool
Equals
(
object
obj
)
{
if
(
obj
==
null
)
return
false
;
if
(!(
obj
.
GetType
()
==
typeof
(
SvgUnit
)))
return
false
;
var
unit
=
(
SvgUnit
)
obj
;
return
(
unit
.
Value
==
this
.
Value
&&
unit
.
Type
==
this
.
Type
);
}
public
override
int
GetHashCode
()
{
return
base
.
GetHashCode
();
}
}
public
bool
Equals
(
SvgUnit
other
)
{
return
this
.
_type
==
other
.
_type
&&
(
this
.
_value
==
other
.
_value
);
}
public
override
int
GetHashCode
()
{
int
hashCode
=
0
;
unchecked
{
hashCode
+=
1000000007
*
_type
.
GetHashCode
();
hashCode
+=
1000000009
*
_value
.
GetHashCode
();
hashCode
+=
1000000021
*
_isEmpty
.
GetHashCode
();
hashCode
+=
1000000033
*
_deviceValue
.
GetHashCode
();
}
return
hashCode
;
}
public
static
bool
operator
==(
SvgUnit
lhs
,
SvgUnit
rhs
)
{
return
lhs
.
Equals
(
rhs
);
}
public
static
bool
operator
!=(
SvgUnit
lhs
,
SvgUnit
rhs
)
{
return
!(
lhs
==
rhs
);
}
#
endregion
public
override
string
ToString
()
{
...
...
Source/Document Structure/SvgUse.cs
View file @
6d38adf2
...
...
@@ -49,6 +49,8 @@ namespace Svg
/// </summary>
public
SvgUse
()
{
this
.
X
=
0
;
this
.
Y
=
0
;
}
public
override
System
.
Drawing
.
Drawing2D
.
GraphicsPath
Path
...
...
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