Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
13132300
Commit
13132300
authored
10 years ago
by
Tebjan Halm
Browse files
Options
Download
Plain Diff
Merge pull request #97 from articulate/BoundsPerformance
Performance Improvement
parents
a653b4a4
1b8cb43f
master
netstandard2
nuget2.4.2
nuget2.4.1
nuget2.4
nuget2.3
nuget2.2.2
nuget2.2.1
No related merge requests found
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
Source/Painting/SvgRadialGradientServer.cs
+1
-1
Source/Painting/SvgRadialGradientServer.cs
Source/Paths/SvgPath.cs
+3
-3
Source/Paths/SvgPath.cs
Source/Rendering/SvgRenderer.cs
+1
-1
Source/Rendering/SvgRenderer.cs
Source/Svg.csproj
+1
-0
Source/Svg.csproj
Source/SvgElement.cs
+1
-1
Source/SvgElement.cs
Source/Text/SvgGlyph.cs
+3
-3
Source/Text/SvgGlyph.cs
Source/Text/SvgTextBase.cs
+8
-21
Source/Text/SvgTextBase.cs
with
18 additions
and
30 deletions
+18
-30
Source/Painting/SvgRadialGradientServer.cs
+
1
-
1
View file @
13132300
...
...
@@ -127,7 +127,7 @@ namespace Svg
using
(
var
transform
=
EffectiveGradientTransform
)
{
var
bounds
=
renderer
.
GetBoundable
().
Bounds
;
var
bounds
=
renderer
.
GetBoundable
().
Calculate
Bounds
()
;
transform
.
Translate
(
bounds
.
X
,
bounds
.
Y
,
MatrixOrder
.
Prepend
);
if
(
this
.
GradientUnits
==
SvgCoordinateUnits
.
ObjectBoundingBox
)
{
...
...
This diff is collapsed.
Click to expand it.
Source/Paths/SvgPath.cs
+
3
-
3
View file @
13132300
...
...
@@ -114,10 +114,10 @@ namespace Svg
/// <summary>
/// Gets the bounds of the element.
/// </summary>
/// <
value
>The bounds.</
value
>
public
override
System
.
Drawing
.
RectangleF
Bounds
/// <
returns
>The bounds.</
returns
>
public
override
RectangleF
Calculate
Bounds
()
{
get
{
return
this
.
Path
(
null
).
GetBounds
();
}
return
this
.
Path
(
null
).
GetBounds
();
}
/// <summary>
...
...
This diff is collapsed.
Click to expand it.
Source/Rendering/SvgRenderer.cs
+
1
-
1
View file @
13132300
...
...
@@ -18,7 +18,7 @@ namespace Svg
public
void
SetBoundable
(
ISvgBoundable
boundable
)
{
_boundables
.
Push
(
boundable
);
_boundables
.
Push
(
new
ImmutableBoundable
(
boundable
)
)
;
}
public
ISvgBoundable
GetBoundable
()
{
...
...
This diff is collapsed.
Click to expand it.
Source/Svg.csproj
+
1
-
0
View file @
13132300
...
...
@@ -109,6 +109,7 @@
<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"
/>
...
...
This diff is collapsed.
Click to expand it.
Source/SvgElement.cs
+
1
-
1
View file @
13132300
...
...
@@ -1162,4 +1162,4 @@ namespace Svg
void
Render
(
ISvgRenderer
renderer
);
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
Source/Text/SvgGlyph.cs
+
3
-
3
View file @
13132300
...
...
@@ -91,10 +91,10 @@ namespace Svg
/// <summary>
/// Gets the bounds of the element.
/// </summary>
/// <
value
>The bounds.</
value
>
public
override
System
.
Drawing
.
RectangleF
Bounds
/// <
returns
>The bounds.</
returns
>
public
override
System
.
Drawing
.
RectangleF
Calculate
Bounds
()
{
get
{
return
this
.
Path
(
null
).
GetBounds
();
}
return
this
.
Path
(
null
).
GetBounds
();
}
/// <summary>
...
...
This diff is collapsed.
Click to expand it.
Source/Text/SvgTextBase.cs
+
8
-
21
View file @
13132300
...
...
@@ -227,18 +227,15 @@ namespace Svg
/// <summary>
/// Gets the bounds of the element.
/// </summary>
/// <
value
>The bounds.</
value
>
public
override
System
.
Drawing
.
RectangleF
Bounds
/// <
returns
>The bounds.</
returns
>
public
override
RectangleF
Calculate
Bounds
()
{
get
var
path
=
this
.
Path
(
null
);
foreach
(
var
elem
in
this
.
Children
.
OfType
<
SvgVisualElement
>())
{
var
path
=
this
.
Path
(
null
);
foreach
(
var
elem
in
this
.
Children
.
OfType
<
SvgVisualElement
>())
{
path
.
AddPath
(
elem
.
Path
(
null
),
false
);
}
return
path
.
GetBounds
();
path
.
AddPath
(
elem
.
Path
(
null
),
false
);
}
return
path
.
GetBounds
();
}
/// <summary>
...
...
@@ -495,19 +492,9 @@ namespace Svg
_width
=
width
;
}
public
PointF
Location
{
get
{
return
PointF
.
Empty
;
}
}
public
SizeF
Size
{
get
{
return
new
SizeF
(
_width
,
_font
.
Size
);
}
}
public
RectangleF
Bounds
public
RectangleF
CalculateBounds
()
{
get
{
return
new
RectangleF
(
this
.
Location
,
this
.
Size
);
}
return
new
RectangleF
(
PointF
.
Empty
,
new
SizeF
(
_width
,
_font
.
Size
)
)
;
}
}
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help