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
eae91392
Commit
eae91392
authored
Nov 19, 2016
by
Tebjan Halm
Committed by
GitHub
Nov 19, 2016
Browse files
Merge pull request #262 from sovietmagic/master
Proper SvgTextBase.Text property setter behaviour
parents
3c3e5608
05b4d6ed
Changes
3
Show whitespace changes
Inline
Side-by-side
Source/Text/SvgTextBase.cs
View file @
eae91392
...
@@ -26,7 +26,16 @@ namespace Svg
...
@@ -26,7 +26,16 @@ namespace Svg
public
virtual
string
Text
public
virtual
string
Text
{
{
get
{
return
base
.
Content
;
}
get
{
return
base
.
Content
;
}
set
{
base
.
Content
=
value
;
this
.
IsPathDirty
=
true
;
this
.
Content
=
value
;
}
set
{
Nodes
.
Clear
();
Children
.
Clear
();
if
(
value
!=
null
)
{
Nodes
.
Add
(
new
SvgContentNode
{
Content
=
value
});
}
this
.
IsPathDirty
=
true
;
Content
=
value
;
}
}
}
/// <summary>
/// <summary>
...
...
Tests/Svg.UnitTests/Svg.UnitTests.csproj
View file @
eae91392
...
@@ -64,6 +64,7 @@
...
@@ -64,6 +64,7 @@
<Compile
Include=
"SmallEmbeddingImageTest.cs"
/>
<Compile
Include=
"SmallEmbeddingImageTest.cs"
/>
<Compile
Include=
"SvgPointCollectionTests.cs"
/>
<Compile
Include=
"SvgPointCollectionTests.cs"
/>
<Compile
Include=
"SvgTestHelper.cs"
/>
<Compile
Include=
"SvgTestHelper.cs"
/>
<Compile
Include=
"SvgTextTests.cs"
/>
<Compile
Include=
"SvgTextElementDeepCopyTest.cs"
/>
<Compile
Include=
"SvgTextElementDeepCopyTest.cs"
/>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
...
...
Tests/Svg.UnitTests/SvgTextTests.cs
0 → 100644
View file @
eae91392
using
Microsoft.VisualStudio.TestTools.UnitTesting
;
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Text
;
using
System.Xml
;
namespace
Svg.UnitTests
{
[
TestClass
]
public
class
SvgTextTests
{
[
TestMethod
]
public
void
TextPropertyAffectsSvgOutput
()
{
var
document
=
new
SvgDocument
();
document
.
Children
.
Add
(
new
SvgText
{
Text
=
"test1"
});
using
(
var
stream
=
new
MemoryStream
())
{
document
.
Write
(
stream
);
stream
.
Position
=
0
;
var
xmlDoc
=
new
XmlDocument
();
xmlDoc
.
Load
(
stream
);
Assert
.
AreEqual
(
"test1"
,
xmlDoc
.
DocumentElement
.
FirstChild
.
InnerText
);
}
}
}
}
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