Commit ce8f2a64 authored by Eric Domke's avatar Eric Domke
Browse files

Fixing compile errors and spacing inconsistencies

parent 05c51974
......@@ -14,7 +14,6 @@ namespace Svg
return this.Content;
}
public override SvgElement DeepCopy()
{
return DeepCopy<SvgDescription>();
......@@ -23,9 +22,7 @@ namespace Svg
public override SvgElement DeepCopy<T>()
{
var newObj = base.DeepCopy<T>() as SvgDescription;
newObj.Text = this.Text;
return newObj;
}
}
}
\ No newline at end of file
......@@ -69,16 +69,16 @@ namespace Svg
get { return new System.Drawing.RectangleF(); }
}
// public override SvgElementCollection Children
// {
// get
// {
// SvgElement element = this.OwnerDocument.IdManager.GetElementById(this.ReferencedElement);
// SvgElementCollection elements = new SvgElementCollection(this, true);
// elements.Add(element);
// return elements;
// }
// }
// public override SvgElementCollection Children
// {
// get
// {
// SvgElement element = this.OwnerDocument.IdManager.GetElementById(this.ReferencedElement);
// SvgElementCollection elements = new SvgElementCollection(this, true);
// elements.Add(element);
// return elements;
// }
// }
protected override void Render(SvgRenderer renderer)
{
......
......@@ -193,7 +193,7 @@ namespace Svg
for (var i = 0; i < colorBlend.Positions.Length; i++)
{
var originalPoint = MovePointAlongVector(specifiedStart, specifiedUnitVector, (float) specifiedLength * colorBlend.Positions[i]);
var originalPoint = MovePointAlongVector(specifiedStart, specifiedUnitVector, (float)specifiedLength * colorBlend.Positions[i]);
var distanceFromEffectiveStart = CalculateDistance(effectiveStart, originalPoint);
......
......@@ -8,7 +8,6 @@ namespace Svg.Pathing
{
public override void AddToPath(System.Drawing.Drawing2D.GraphicsPath graphicsPath)
{
// Important for custom line caps. Force the path the close with an explicit line, not just an implicit close of the figure.
if (graphicsPath.PointCount > 0 && !graphicsPath.PathPoints[0].Equals(graphicsPath.PathPoints[graphicsPath.PathPoints.Length - 1]))
{
......
......@@ -16,7 +16,7 @@
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<SccProjectName>
</SccProjectName>
......@@ -121,7 +121,6 @@
<Compile Include="Extensions.cs" />
<Compile Include="Painting\ISvgBoundable.cs" />
<Compile Include="Painting\SvgDeferredPaintServer.cs" />
<Compile Include="Painting\ISvgBoundable.cs" />
<Compile Include="Painting\SvgMarker.cs" />
<Compile Include="Document Structure\SvgDefinitionList.cs" />
<Compile Include="Document Structure\SvgDescription.cs" />
......
......@@ -17,13 +17,14 @@ namespace Svg
/// <summary>
/// Initializes the <see cref="SvgText"/> class.
/// </summary>
public SvgText() : base() {}
public SvgText() : base() { }
/// <summary>
/// Initializes a new instance of the <see cref="SvgText"/> class.
/// </summary>
/// <param name="text">The text.</param>
public SvgText(string text) : this()
public SvgText(string text)
: this()
{
this.Text = text;
}
......
......@@ -71,11 +71,11 @@ namespace Svg
get { return this._x; }
set
{
if(_x != value)
if (_x != value)
{
this._x = value;
this.IsPathDirty = true;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "x", Value = value });
OnAttributeChanged(new AttributeEventArgs { Attribute = "x", Value = value });
}
}
}
......@@ -109,11 +109,11 @@ namespace Svg
get { return this._y; }
set
{
if(_y != value)
if (_y != value)
{
this._y = value;
this.IsPathDirty = true;
OnAttributeChanged(new AttributeEventArgs{ Attribute = "y", Value = value });
OnAttributeChanged(new AttributeEventArgs { Attribute = "y", Value = value });
}
}
}
......@@ -202,7 +202,7 @@ namespace Svg
private static string ValidateFontFamily(string fontFamilyList)
{
// Split font family list on "," and then trim start and end spaces and quotes.
var fontParts = fontFamilyList.Split(new[] { ',' }).Select(fontName => fontName.Trim(new[] { '"', ' ','\'' }));
var fontParts = fontFamilyList.Split(new[] { ',' }).Select(fontName => fontName.Trim(new[] { '"', ' ', '\'' }));
var families = System.Drawing.FontFamily.Families;
......@@ -293,9 +293,12 @@ namespace Svg
ch = (i == posCount - 1 ? text.Substring(i) : text.Substring(i, 1));
stringBounds = _stringMeasure.MeasureString(ch, font);
totalHeight = Math.Max(totalHeight, stringBounds.Height);
result.Nodes.Add(new NodeBounds() { Bounds = stringBounds,
Node = new SvgContentNode() { Content = ch},
xOffset = (i == 0 ? 0 : _x[i].ToDeviceValue(this) - _x[0].ToDeviceValue(this))});
result.Nodes.Add(new NodeBounds()
{
Bounds = stringBounds,
Node = new SvgContentNode() { Content = ch },
xOffset = (i == 0 ? 0 : _x[i].ToDeviceValue(this) - _x[0].ToDeviceValue(this))
});
}
}
......@@ -379,7 +382,7 @@ namespace Svg
{
// Minus FontSize because the x/y coords mark the bottom left, not bottom top.
DrawString(_path, x + data.xOffset, y - boundsData.Bounds.Height, font,
PrepareText(data.Node.Content, i > 0 && boundsData.Nodes[i-1].Node is SvgTextBase,
PrepareText(data.Node.Content, i > 0 && boundsData.Nodes[i - 1].Node is SvgTextBase,
i < boundsData.Nodes.Count - 1 && boundsData.Nodes[i + 1].Node is SvgTextBase));
}
else
......@@ -534,7 +537,7 @@ namespace Svg
//change
protected void OnChange(string newString, string sessionID)
{
RaiseChange(this, new StringArg {s = newString, SessionID = sessionID});
RaiseChange(this, new StringArg { s = newString, SessionID = sessionID });
}
protected void RaiseChange(object sender, StringArg s)
......
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