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
5bd751c6
Commit
5bd751c6
authored
Sep 26, 2014
by
Tebjan Halm
Browse files
Merge pull request #100 from vvvv/revert-97-BoundsPerformance
Revert "Performance Improvement"
parents
13132300
ae333749
Changes
27
Show whitespace changes
Inline
Side-by-side
Source/Painting/SvgRadialGradientServer.cs
View file @
5bd751c6
...
...
@@ -127,7 +127,7 @@ namespace Svg
using
(
var
transform
=
EffectiveGradientTransform
)
{
var
bounds
=
renderer
.
GetBoundable
().
Calculate
Bounds
()
;
var
bounds
=
renderer
.
GetBoundable
().
Bounds
;
transform
.
Translate
(
bounds
.
X
,
bounds
.
Y
,
MatrixOrder
.
Prepend
);
if
(
this
.
GradientUnits
==
SvgCoordinateUnits
.
ObjectBoundingBox
)
{
...
...
Source/Paths/SvgPath.cs
View file @
5bd751c6
...
...
@@ -114,10 +114,10 @@ namespace Svg
/// <summary>
/// Gets the bounds of the element.
/// </summary>
/// <
returns
>The bounds.</
returns
>
public
override
RectangleF
Calculate
Bounds
()
/// <
value
>The bounds.</
value
>
public
override
System
.
Drawing
.
RectangleF
Bounds
{
return
this
.
Path
(
null
).
GetBounds
();
get
{
return
this
.
Path
(
null
).
GetBounds
();
}
}
/// <summary>
...
...
Source/Rendering/SvgRenderer.cs
View file @
5bd751c6
...
...
@@ -18,7 +18,7 @@ namespace Svg
public
void
SetBoundable
(
ISvgBoundable
boundable
)
{
_boundables
.
Push
(
new
ImmutableBoundable
(
boundable
)
)
;
_boundables
.
Push
(
boundable
);
}
public
ISvgBoundable
GetBoundable
()
{
...
...
Source/Svg.csproj
View file @
5bd751c6
...
...
@@ -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"
/>
...
...
Source/SvgElement.cs
View file @
5bd751c6
Source/Text/SvgGlyph.cs
View file @
5bd751c6
...
...
@@ -91,10 +91,10 @@ namespace Svg
/// <summary>
/// Gets the bounds of the element.
/// </summary>
/// <
returns
>The bounds.</
returns
>
public
override
System
.
Drawing
.
RectangleF
Calculate
Bounds
()
/// <
value
>The bounds.</
value
>
public
override
System
.
Drawing
.
RectangleF
Bounds
{
return
this
.
Path
(
null
).
GetBounds
();
get
{
return
this
.
Path
(
null
).
GetBounds
();
}
}
/// <summary>
...
...
Source/Text/SvgTextBase.cs
View file @
5bd751c6
...
...
@@ -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
);
}
}
}
...
...
Prev
1
2
Next
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