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
26f61673
Commit
26f61673
authored
Aug 24, 2009
by
ddpruitt
Browse files
Commented out the Trace.TraceInformation() statements for performance.
Removed some compiler warnings.
parent
8f933da4
Changes
7
Show whitespace changes
Inline
Side-by-side
Basic Shapes/SvgVisualElement.cs
View file @
26f61673
...
@@ -136,21 +136,18 @@ namespace Svg
...
@@ -136,21 +136,18 @@ namespace Svg
if
(
this
.
Stroke
!=
null
)
if
(
this
.
Stroke
!=
null
)
{
{
float
strokeWidth
=
this
.
StrokeWidth
.
ToDeviceValue
(
this
);
float
strokeWidth
=
this
.
StrokeWidth
.
ToDeviceValue
(
this
);
using
(
Pen
pen
=
new
Pen
(
this
.
Stroke
.
GetBrush
(
this
,
this
.
StrokeOpacity
),
strokeWidth
))
using
(
var
pen
=
new
Pen
(
this
.
Stroke
.
GetBrush
(
this
,
this
.
StrokeOpacity
),
strokeWidth
))
{
{
if
(
pen
!=
null
)
if
(
this
.
StrokeDashArray
!=
null
&&
this
.
StrokeDashArray
.
Count
>
0
)
{
if
(
this
.
StrokeDashArray
!=
null
)
{
{
/* divide by stroke width - GDI behaviour that I don't quite understand yet.*/
/* divide by stroke width - GDI behaviour that I don't quite understand yet.*/
pen
.
DashPattern
=
this
.
StrokeDashArray
.
ConvertAll
(
u
=>
u
.
Value
/
((
strokeWidth
<=
0
)
?
1
:
strokeWidth
)).
ToArray
();
pen
.
DashPattern
=
this
.
StrokeDashArray
.
ConvertAll
(
u
=>
u
.
Value
/
((
strokeWidth
<=
0
)
?
1
:
strokeWidth
)).
ToArray
();
}
}
renderer
.
DrawPath
(
pen
,
this
.
Path
);
renderer
.
DrawPath
(
pen
,
this
.
Path
);
}
}
}
}
}
}
}
/// <summary>
/// <summary>
/// Sets the clipping region of the specified <see cref="SvgRenderer"/>.
/// Sets the clipping region of the specified <see cref="SvgRenderer"/>.
...
...
DataTypes/SvgPoint.cs
View file @
26f61673
...
@@ -35,16 +35,19 @@ namespace Svg
...
@@ -35,16 +35,19 @@ namespace Svg
public
override
bool
Equals
(
object
obj
)
public
override
bool
Equals
(
object
obj
)
{
{
if
(
obj
==
null
)
if
(
obj
==
null
)
return
false
;
return
false
;
if
(!(
obj
.
GetType
()
==
typeof
(
SvgPoint
)))
if
(!(
obj
.
GetType
()
==
typeof
(
SvgPoint
)))
return
false
;
return
false
;
SvgPoint
point
=
(
SvgPoint
)
obj
;
var
point
=
(
SvgPoint
)
obj
;
return
(
point
.
X
.
Equals
(
this
.
X
)
&&
point
.
Y
.
Equals
(
this
.
Y
));
return
(
point
.
X
.
Equals
(
this
.
X
)
&&
point
.
Y
.
Equals
(
this
.
Y
));
}
}
public
override
int
GetHashCode
()
{
return
base
.
GetHashCode
();
}
public
SvgPoint
(
string
x
,
string
y
)
public
SvgPoint
(
string
x
,
string
y
)
{
{
TypeConverter
converter
=
TypeDescriptor
.
GetConverter
(
typeof
(
SvgUnit
));
TypeConverter
converter
=
TypeDescriptor
.
GetConverter
(
typeof
(
SvgUnit
));
...
...
DataTypes/SvgUnit.cs
View file @
26f61673
...
@@ -160,18 +160,16 @@ namespace Svg
...
@@ -160,18 +160,16 @@ namespace Svg
/// </returns>
/// </returns>
public
override
bool
Equals
(
object
obj
)
public
override
bool
Equals
(
object
obj
)
{
{
if
(
obj
==
null
)
if
(
obj
==
null
)
return
false
;
{
if
(!(
obj
.
GetType
()
==
typeof
(
SvgUnit
)))
return
false
;
return
false
;
}
if
(!(
obj
.
GetType
()
==
typeof
(
SvgUnit
)))
var
unit
=
(
SvgUnit
)
obj
;
{
return
(
unit
.
Value
==
this
.
Value
&&
unit
.
Type
==
this
.
Type
);
return
false
;
}
}
SvgUnit
unit
=
(
SvgUnit
)
obj
;
public
override
int
GetHashCode
()
return
(
unit
.
Value
==
this
.
Value
&&
unit
.
Type
==
this
.
Type
);
{
return
base
.
GetHashCode
();
}
}
/// <summary>
/// <summary>
...
...
Filter Effects/feMerge/SvgMerge.cs
View file @
26f61673
...
@@ -10,11 +10,11 @@ namespace Svg.FilterEffects
...
@@ -10,11 +10,11 @@ namespace Svg.FilterEffects
{
{
public
class
SvgMerge
:
SvgFilterPrimitive
public
class
SvgMerge
:
SvgFilterPrimitive
{
{
p
rivate
StringCollection
_m
ergeResults
;
p
ublic
StringCollection
M
ergeResults
{
get
;
private
set
;
}
public
S
tringCollection
MergeResults
public
S
vgMerge
()
{
{
get
{
return
this
.
_mergeResults
;
}
MergeResults
=
new
StringCollection
();
}
}
public
override
Bitmap
Process
()
public
override
Bitmap
Process
()
...
...
Properties/AssemblyInfo.cs
View file @
26f61673
...
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
...
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
//
// You can specify all the values or you can default the Revision and Build Numbers
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
// by using the '*' as shown below:
[
assembly
:
AssemblyVersion
(
"0.5.2.
0
"
)]
[
assembly
:
AssemblyVersion
(
"0.5.2.
*
"
)]
[
assembly
:
AssemblyFileVersion
(
"0.5.2.0"
)]
[
assembly
:
AssemblyFileVersion
(
"0.5.2.0"
)]
SvgDocument.cs
View file @
26f61673
...
@@ -163,7 +163,7 @@ namespace Svg
...
@@ -163,7 +163,7 @@ namespace Svg
throw
new
ArgumentNullException
(
"stream"
);
throw
new
ArgumentNullException
(
"stream"
);
}
}
Trace
.
TraceInformation
(
"Begin Read"
);
//
Trace.TraceInformation("Begin Read");
using
(
var
reader
=
new
SvgTextReader
(
stream
,
entities
))
using
(
var
reader
=
new
SvgTextReader
(
stream
,
entities
))
{
{
...
@@ -248,7 +248,7 @@ namespace Svg
...
@@ -248,7 +248,7 @@ namespace Svg
}
}
}
}
Trace
.
TraceInformation
(
"End Read"
);
//
Trace.TraceInformation("End Read");
return
svgDocument
;
return
svgDocument
;
}
}
}
}
...
@@ -320,7 +320,7 @@ namespace Svg
...
@@ -320,7 +320,7 @@ namespace Svg
/// <returns>A <see cref="Bitmap"/> containing the rendered document.</returns>
/// <returns>A <see cref="Bitmap"/> containing the rendered document.</returns>
public
virtual
Bitmap
Draw
()
public
virtual
Bitmap
Draw
()
{
{
Trace
.
TraceInformation
(
"Begin Render"
);
//
Trace.TraceInformation("Begin Render");
var
size
=
GetDimensions
();
var
size
=
GetDimensions
();
var
bitmap
=
new
Bitmap
((
int
)
Math
.
Ceiling
(
size
.
Width
),
(
int
)
Math
.
Ceiling
(
size
.
Height
));
var
bitmap
=
new
Bitmap
((
int
)
Math
.
Ceiling
(
size
.
Width
),
(
int
)
Math
.
Ceiling
(
size
.
Height
));
...
@@ -342,7 +342,7 @@ namespace Svg
...
@@ -342,7 +342,7 @@ namespace Svg
throw
;
throw
;
}
}
Trace
.
TraceInformation
(
"End Render"
);
//
Trace.TraceInformation("End Render");
return
bitmap
;
return
bitmap
;
}
}
...
...
SvgElementFactory.cs
View file @
26f61673
...
@@ -93,7 +93,7 @@ namespace Svg
...
@@ -93,7 +93,7 @@ namespace Svg
SvgElement
createdElement
=
null
;
SvgElement
createdElement
=
null
;
string
elementName
=
reader
.
LocalName
;
string
elementName
=
reader
.
LocalName
;
Trace
.
TraceInformation
(
"Begin CreateElement: {0}"
,
elementName
);
//
Trace.TraceInformation("Begin CreateElement: {0}", elementName);
if
(
elementName
==
"svg"
)
if
(
elementName
==
"svg"
)
{
{
...
@@ -114,14 +114,14 @@ namespace Svg
...
@@ -114,14 +114,14 @@ namespace Svg
SetAttributes
(
createdElement
,
reader
,
document
);
SetAttributes
(
createdElement
,
reader
,
document
);
}
}
Trace
.
TraceInformation
(
"End CreateElement"
);
//
Trace.TraceInformation("End CreateElement");
return
createdElement
;
return
createdElement
;
}
}
private
static
void
SetAttributes
(
SvgElement
element
,
XmlTextReader
reader
,
SvgDocument
document
)
private
static
void
SetAttributes
(
SvgElement
element
,
XmlTextReader
reader
,
SvgDocument
document
)
{
{
Trace
.
TraceInformation
(
"Begin SetAttributes"
);
//
Trace.TraceInformation("Begin SetAttributes");
string
[]
styles
=
null
;
string
[]
styles
=
null
;
string
[]
style
=
null
;
string
[]
style
=
null
;
...
@@ -151,7 +151,7 @@ namespace Svg
...
@@ -151,7 +151,7 @@ namespace Svg
SetPropertyValue
(
element
,
reader
.
LocalName
,
reader
.
Value
,
document
);
SetPropertyValue
(
element
,
reader
.
LocalName
,
reader
.
Value
,
document
);
}
}
Trace
.
TraceInformation
(
"End SetAttributes"
);
//
Trace.TraceInformation("End SetAttributes");
}
}
private
static
void
SetPropertyValue
(
SvgElement
element
,
string
attributeName
,
string
attributeValue
,
SvgDocument
document
)
private
static
void
SetPropertyValue
(
SvgElement
element
,
string
attributeName
,
string
attributeValue
,
SvgDocument
document
)
...
...
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