Commit 26f61673 authored by ddpruitt's avatar ddpruitt
Browse files

Commented out the Trace.TraceInformation() statements for performance.

Removed some compiler warnings.
parent 8f933da4
......@@ -136,21 +136,18 @@ namespace Svg
if (this.Stroke != null)
{
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)
if (this.StrokeDashArray != null && this.StrokeDashArray.Count > 0)
{
/* 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);
}
}
}
}
/// <summary>
/// Sets the clipping region of the specified <see cref="SvgRenderer"/>.
......
......@@ -35,16 +35,19 @@ namespace Svg
public override bool Equals(object obj)
{
if (obj == null)
return false;
if (obj == null) return false;
if (!(obj.GetType() == typeof(SvgPoint)))
return false;
if (!(obj.GetType() == typeof(SvgPoint))) return false;
SvgPoint point = (SvgPoint)obj;
var point = (SvgPoint)obj;
return (point.X.Equals(this.X) && point.Y.Equals(this.Y));
}
public override int GetHashCode()
{
return base.GetHashCode();
}
public SvgPoint(string x, string y)
{
TypeConverter converter = TypeDescriptor.GetConverter(typeof(SvgUnit));
......
......@@ -160,18 +160,16 @@ namespace Svg
/// </returns>
public override bool Equals(object obj)
{
if (obj == null)
{
return false;
}
if (obj == null) return false;
if (!(obj.GetType() == typeof (SvgUnit))) return false;
if (!(obj.GetType() == typeof(SvgUnit)))
{
return false;
var unit = (SvgUnit)obj;
return (unit.Value == this.Value && unit.Type == this.Type);
}
SvgUnit unit = (SvgUnit)obj;
return (unit.Value == this.Value && unit.Type == this.Type);
public override int GetHashCode()
{
return base.GetHashCode();
}
/// <summary>
......
......@@ -10,11 +10,11 @@ namespace Svg.FilterEffects
{
public class SvgMerge : SvgFilterPrimitive
{
private StringCollection _mergeResults;
public StringCollection MergeResults { get; private set; }
public StringCollection MergeResults
public SvgMerge()
{
get { return this._mergeResults; }
MergeResults = new StringCollection();
}
public override Bitmap Process()
......
......@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("0.5.2.0")]
[assembly: AssemblyVersion("0.5.2.*")]
[assembly: AssemblyFileVersion("0.5.2.0")]
......@@ -163,7 +163,7 @@ namespace Svg
throw new ArgumentNullException("stream");
}
Trace.TraceInformation("Begin Read");
//Trace.TraceInformation("Begin Read");
using (var reader = new SvgTextReader(stream, entities))
{
......@@ -248,7 +248,7 @@ namespace Svg
}
}
Trace.TraceInformation("End Read");
//Trace.TraceInformation("End Read");
return svgDocument;
}
}
......@@ -320,7 +320,7 @@ namespace Svg
/// <returns>A <see cref="Bitmap"/> containing the rendered document.</returns>
public virtual Bitmap Draw()
{
Trace.TraceInformation("Begin Render");
//Trace.TraceInformation("Begin Render");
var size = GetDimensions();
var bitmap = new Bitmap((int)Math.Ceiling(size.Width), (int)Math.Ceiling(size.Height));
......@@ -342,7 +342,7 @@ namespace Svg
throw;
}
Trace.TraceInformation("End Render");
//Trace.TraceInformation("End Render");
return bitmap;
}
......
......@@ -93,7 +93,7 @@ namespace Svg
SvgElement createdElement = null;
string elementName = reader.LocalName;
Trace.TraceInformation("Begin CreateElement: {0}", elementName);
//Trace.TraceInformation("Begin CreateElement: {0}", elementName);
if (elementName == "svg")
{
......@@ -114,14 +114,14 @@ namespace Svg
SetAttributes(createdElement, reader, document);
}
Trace.TraceInformation("End CreateElement");
//Trace.TraceInformation("End CreateElement");
return createdElement;
}
private static void SetAttributes(SvgElement element, XmlTextReader reader, SvgDocument document)
{
Trace.TraceInformation("Begin SetAttributes");
//Trace.TraceInformation("Begin SetAttributes");
string[] styles = null;
string[] style = null;
......@@ -151,7 +151,7 @@ namespace Svg
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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment