Commit 5bd751c6 authored by Tebjan Halm's avatar Tebjan Halm
Browse files

Merge pull request #100 from vvvv/revert-97-BoundsPerformance

Revert "Performance Improvement"
parents 13132300 ae333749
......@@ -127,7 +127,7 @@ namespace Svg
using (var transform = EffectiveGradientTransform)
{
var bounds = renderer.GetBoundable().CalculateBounds();
var bounds = renderer.GetBoundable().Bounds;
transform.Translate(bounds.X, bounds.Y, MatrixOrder.Prepend);
if (this.GradientUnits == SvgCoordinateUnits.ObjectBoundingBox)
{
......
......@@ -114,10 +114,10 @@ namespace Svg
/// <summary>
/// Gets the bounds of the element.
/// </summary>
/// <returns>The bounds.</returns>
public override RectangleF CalculateBounds()
/// <value>The bounds.</value>
public override System.Drawing.RectangleF Bounds
{
return this.Path(null).GetBounds();
get { return this.Path(null).GetBounds(); }
}
/// <summary>
......
......@@ -18,7 +18,7 @@ namespace Svg
public void SetBoundable(ISvgBoundable boundable)
{
_boundables.Push(new ImmutableBoundable(boundable));
_boundables.Push(boundable);
}
public ISvgBoundable GetBoundable()
{
......
......@@ -109,7 +109,6 @@
<Compile Include="Document Structure\SvgSymbol.cs" />
<Compile Include="Filter Effects\ImageBuffer.cs" />
<Compile Include="Painting\GenericBoundable.cs" />
<Compile Include="Painting\ImmutableBoundable.cs" />
<Compile Include="Painting\SvgFallbackPaintServer .cs" />
<Compile Include="Paths\CoordinateParser.cs" />
<Compile Include="Rendering\IGraphicsProvider.cs" />
......
......@@ -91,10 +91,10 @@ namespace Svg
/// <summary>
/// Gets the bounds of the element.
/// </summary>
/// <returns>The bounds.</returns>
public override System.Drawing.RectangleF CalculateBounds()
/// <value>The bounds.</value>
public override System.Drawing.RectangleF Bounds
{
return this.Path(null).GetBounds();
get { return this.Path(null).GetBounds(); }
}
/// <summary>
......
......@@ -227,8 +227,10 @@ namespace Svg
/// <summary>
/// Gets the bounds of the element.
/// </summary>
/// <returns>The bounds.</returns>
public override RectangleF CalculateBounds()
/// <value>The bounds.</value>
public override System.Drawing.RectangleF Bounds
{
get
{
var path = this.Path(null);
foreach (var elem in this.Children.OfType<SvgVisualElement>())
......@@ -237,6 +239,7 @@ namespace Svg
}
return path.GetBounds();
}
}
/// <summary>
/// Renders the <see cref="SvgElement"/> and contents to the specified <see cref="Graphics"/> object.
......@@ -492,9 +495,19 @@ namespace Svg
_width = width;
}
public RectangleF CalculateBounds()
public PointF Location
{
get { return PointF.Empty; }
}
public SizeF Size
{
get { return new SizeF(_width, _font.Size); }
}
public RectangleF Bounds
{
return new RectangleF(PointF.Empty, new SizeF(_width, _font.Size));
get { return new RectangleF(this.Location, this.Size); }
}
}
......
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