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
3f90e468
Commit
3f90e468
authored
Jul 23, 2014
by
Tebjan Halm
Browse files
Merge pull request #87 from articulate/master
Colors Fix, Perf Improvement, Thread Safety
parents
d711bb88
20f834ba
Changes
3
Show whitespace changes
Inline
Side-by-side
Source/Painting/SvgColourConverter.cs
View file @
3f90e468
...
...
@@ -115,7 +115,7 @@ namespace Svg
if
(
destinationType
==
typeof
(
string
))
{
var
colour
=
(
Color
)
value
;
return
ColorTranslator
.
ToHtml
(
colour
);
return
"#"
+
colour
.
R
.
ToString
(
"X2"
,
null
)
+
colour
.
G
.
ToString
(
"X2"
,
null
)
+
colour
.
B
.
ToString
(
"X2"
,
null
);
}
return
base
.
ConvertTo
(
context
,
culture
,
value
,
destinationType
);
...
...
Source/Paths/SvgPathBuilder.cs
View file @
3f90e468
...
...
@@ -276,7 +276,7 @@ namespace Svg
private
static
IEnumerable
<
float
>
ParseCoordinates
(
string
coords
)
{
var
parts
=
Regex
.
Split
(
coords
.
Remove
(
0
,
1
),
@"[\s,]|(?=(?<!e)-)"
);
var
parts
=
Regex
.
Split
(
coords
.
Remove
(
0
,
1
),
@"[\s,]|(?=(?<!e)-)"
,
RegexOptions
.
Compiled
);
for
(
int
i
=
0
;
i
<
parts
.
Length
;
i
++)
{
...
...
Source/SvgElementFactory.cs
View file @
3f90e468
...
...
@@ -167,12 +167,15 @@ namespace Svg
}
private
static
Dictionary
<
Type
,
Dictionary
<
string
,
PropertyDescriptorCollection
>>
_propertyDescriptors
=
new
Dictionary
<
Type
,
Dictionary
<
string
,
PropertyDescriptorCollection
>>();
private
static
object
syncLock
=
new
object
();
private
static
void
SetPropertyValue
(
SvgElement
element
,
string
attributeName
,
string
attributeValue
,
SvgDocument
document
)
{
var
elementType
=
element
.
GetType
();
PropertyDescriptorCollection
properties
;
lock
(
syncLock
)
{
if
(
_propertyDescriptors
.
Keys
.
Contains
(
elementType
))
{
if
(
_propertyDescriptors
[
elementType
].
Keys
.
Contains
(
attributeName
))
...
...
@@ -192,6 +195,7 @@ namespace Svg
_propertyDescriptors
[
elementType
].
Add
(
attributeName
,
properties
);
}
}
if
(
properties
.
Count
>
0
)
{
...
...
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