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
f20108c8
"vscode:/vscode.git/clone" did not exist on "6d38adf208009893ae957cabab79df2db89683ea"
Commit
f20108c8
authored
Mar 28, 2014
by
tebjan
Browse files
svg transforms can now be compared and return correct results
parent
38015799
Changes
2
Hide whitespace changes
Inline
Side-by-side
Source/Transforms/SvgTransform.cs
View file @
f20108c8
...
@@ -12,5 +12,37 @@ namespace Svg.Transforms
...
@@ -12,5 +12,37 @@ namespace Svg.Transforms
public
abstract
string
WriteToString
();
public
abstract
string
WriteToString
();
public
abstract
object
Clone
();
public
abstract
object
Clone
();
#
region
Equals
implementation
public
override
bool
Equals
(
object
obj
)
{
SvgTransform
other
=
obj
as
SvgTransform
;
if
(
other
==
null
)
return
false
;
return
this
.
Matrix
==
other
.
Matrix
;
}
public
override
int
GetHashCode
()
{
int
hashCode
=
this
.
Matrix
.
GetHashCode
();
return
hashCode
;
}
public
static
bool
operator
==(
SvgTransform
lhs
,
SvgTransform
rhs
)
{
if
(
ReferenceEquals
(
lhs
,
rhs
))
return
true
;
if
(
ReferenceEquals
(
lhs
,
null
)
||
ReferenceEquals
(
rhs
,
null
))
return
false
;
return
lhs
.
Equals
(
rhs
);
}
public
static
bool
operator
!=(
SvgTransform
lhs
,
SvgTransform
rhs
)
{
return
!(
lhs
==
rhs
);
}
#
endregion
}
}
}
}
\ No newline at end of file
Source/Transforms/SvgTranslate.cs
View file @
f20108c8
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.
Text
;
using
System.
Drawing.Drawing2D
;
using
System.Globalization
;
using
System.Globalization
;
using
System.Text
;
namespace
Svg.Transforms
namespace
Svg.Transforms
{
{
...
@@ -26,7 +27,7 @@ namespace Svg.Transforms
...
@@ -26,7 +27,7 @@ namespace Svg.Transforms
{
{
get
get
{
{
System
.
Drawing
.
Drawing2D
.
Matrix
matrix
=
new
System
.
Drawing
.
Drawing2D
.
Matrix
();
Matrix
matrix
=
new
Matrix
();
matrix
.
Translate
(
this
.
X
,
this
.
Y
);
matrix
.
Translate
(
this
.
X
,
this
.
Y
);
return
matrix
;
return
matrix
;
}
}
...
...
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