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
c1ce332d
Commit
c1ce332d
authored
Mar 29, 2014
by
tebjan
Browse files
view box has correct equals check now
parent
218faebb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Source/DataTypes/SvgViewBox.cs
View file @
c1ce332d
...
...
@@ -85,6 +85,44 @@ namespace Svg
this
.
Width
=
width
;
this
.
Height
=
height
;
}
#
region
Equals
and
GetHashCode
implementation
public
override
bool
Equals
(
object
obj
)
{
return
(
obj
is
SvgViewBox
)
&&
Equals
((
SvgViewBox
)
obj
);
}
public
bool
Equals
(
SvgViewBox
other
)
{
return
this
.
MinX
==
other
.
MinX
&&
this
.
MinY
==
MinY
&&
this
.
Width
==
other
.
Width
&&
this
.
Height
==
other
.
Height
;
}
public
override
int
GetHashCode
()
{
int
hashCode
=
0
;
unchecked
{
hashCode
+=
1000000007
*
MinX
.
GetHashCode
();
hashCode
+=
1000000009
*
MinY
.
GetHashCode
();
hashCode
+=
1000000021
*
Width
.
GetHashCode
();
hashCode
+=
1000000033
*
Height
.
GetHashCode
();
}
return
hashCode
;
}
public
static
bool
operator
==(
SvgViewBox
lhs
,
SvgViewBox
rhs
)
{
return
lhs
.
Equals
(
rhs
);
}
public
static
bool
operator
!=(
SvgViewBox
lhs
,
SvgViewBox
rhs
)
{
return
!(
lhs
==
rhs
);
}
#
endregion
}
internal
class
SvgViewBoxConverter
:
TypeConverter
...
...
Source/SvgAttributeCollection.cs
View file @
c1ce332d
...
...
@@ -118,6 +118,8 @@ namespace Svg
return
UnboxAndCheck
<
int
>(
a
,
b
);
else
if
(
a
is
float
)
return
UnboxAndCheck
<
float
>(
a
,
b
);
else
if
(
a
is
SvgViewBox
)
return
UnboxAndCheck
<
SvgViewBox
>(
a
,
b
);
else
return
true
;
}
...
...
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