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