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
32ea4ec2
Commit
32ea4ec2
authored
Jul 31, 2014
by
Eric Domke
Browse files
Bug Fixes Prior to Work on Better CSS Support
parent
ce8f2a64
Changes
4
Show whitespace changes
Inline
Side-by-side
Source/Basic Shapes/SvgVisualElement.cs
View file @
32ea4ec2
...
...
@@ -138,7 +138,7 @@ namespace Svg
{
if
(
this
.
Fill
!=
null
)
{
using
(
Brush
brush
=
this
.
Fill
.
GetBrush
(
this
,
this
.
FillOpacity
))
using
(
Brush
brush
=
this
.
Fill
.
GetBrush
(
this
,
Math
.
Min
(
Math
.
Max
(
this
.
FillOpacity
*
this
.
Opacity
,
0
),
1
)
))
{
if
(
brush
!=
null
)
{
...
...
@@ -158,7 +158,7 @@ namespace Svg
if
(
this
.
Stroke
!=
null
)
{
float
strokeWidth
=
this
.
StrokeWidth
.
ToDeviceValue
(
this
);
using
(
var
pen
=
new
Pen
(
this
.
Stroke
.
GetBrush
(
this
,
this
.
StrokeOpacity
),
strokeWidth
))
using
(
var
pen
=
new
Pen
(
this
.
Stroke
.
GetBrush
(
this
,
Math
.
Min
(
Math
.
Max
(
this
.
StrokeOpacity
*
this
.
Opacity
,
0
),
1
)
),
strokeWidth
))
{
if
(
this
.
StrokeDashArray
!=
null
&&
this
.
StrokeDashArray
.
Count
>
0
)
{
...
...
Source/Painting/SvgDeferredPaintServer.cs
View file @
32ea4ec2
...
...
@@ -81,6 +81,7 @@ namespace Svg
}
else
{
deferred
.
EnsureServer
();
return
deferred
.
_concreteServer
as
T
;
}
}
...
...
Source/Text/SvgTextAnchor.cs
View file @
32ea4ec2
...
...
@@ -12,6 +12,7 @@ namespace Svg
[
TypeConverter
(
typeof
(
SvgTextAnchorConverter
))]
public
enum
SvgTextAnchor
{
inherit
,
/// <summary>
/// The rendered characters are aligned such that the start of the text string is at the initial current text position.
/// </summary>
...
...
Source/Text/SvgTextBase.cs
View file @
32ea4ec2
...
...
@@ -25,7 +25,7 @@ namespace Svg
private
SvgUnitCollection
_dx
=
new
SvgUnitCollection
();
private
SvgUnit
_letterSpacing
;
private
SvgUnit
_wordSpacing
;
private
SvgTextAnchor
_textAnchor
=
SvgTextAnchor
.
Star
t
;
private
SvgTextAnchor
_textAnchor
=
SvgTextAnchor
.
inheri
t
;
private
static
readonly
SvgRenderer
_stringMeasure
;
private
const
string
DefaultFontFamily
=
"Times New Roman"
;
...
...
@@ -196,7 +196,15 @@ namespace Svg
/// <value>The bounds.</value>
public
override
System
.
Drawing
.
RectangleF
Bounds
{
get
{
return
this
.
Path
.
GetBounds
();
}
get
{
var
path
=
this
.
Path
;
foreach
(
var
elem
in
this
.
Children
.
OfType
<
SvgVisualElement
>())
{
path
.
AddPath
(
elem
.
Path
,
false
);
}
return
path
.
GetBounds
();
}
}
private
static
string
ValidateFontFamily
(
string
fontFamilyList
)
...
...
@@ -361,8 +369,10 @@ namespace Svg
_path
=
new
GraphicsPath
();
_path
.
StartFigure
();
var
anchorElem
=
(
from
e
in
this
.
ParentsAndSelf
.
OfType
<
SvgTextBase
>()
where
e
.
TextAnchor
!=
SvgTextAnchor
.
inherit
select
e
).
FirstOrDefault
();
// Determine the location of the start point
switch
(
this
.
TextAnchor
)
switch
(
anchorElem
==
null
?
this
.
TextAnchor
:
anchorElem
.
TextAnchor
)
{
case
SvgTextAnchor
.
Middle
:
x
-=
(
boundsData
.
Bounds
.
Width
/
2
);
...
...
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