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
ebba7b35
Commit
ebba7b35
authored
Jun 11, 2014
by
Tebjan Halm
Browse files
Merge pull request #67 from csmoore/master
Support for `"display=none"` #66
parents
f099da1a
c04111fc
Changes
47
Show whitespace changes
Inline
Side-by-side
Samples/SVGViewer/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll
deleted
100644 → 0
View file @
f099da1a
File deleted
Source/Basic Shapes/SvgImage.cs
View file @
ebba7b35
...
...
@@ -97,6 +97,9 @@ namespace Svg
/// </summary>
protected
override
void
Render
(
SvgRenderer
renderer
)
{
if
(!
Visible
||
!
Displayable
)
return
;
if
(
Width
.
Value
>
0.0f
&&
Height
.
Value
>
0.0f
&&
this
.
Href
!=
null
)
{
using
(
Image
b
=
GetImage
(
this
.
Href
))
...
...
Source/Basic Shapes/SvgVisualElement.cs
View file @
ebba7b35
...
...
@@ -94,7 +94,7 @@ namespace Svg
/// <param name="renderer">The <see cref="SvgRenderer"/> object to render to.</param>
protected
override
void
Render
(
SvgRenderer
renderer
)
{
if
(
this
.
Path
!=
null
&&
this
.
Visible
)
if
(
(
this
.
Path
!=
null
)
&&
this
.
Visible
&&
this
.
Displayable
)
{
this
.
PushTransforms
(
renderer
);
this
.
SetClip
(
renderer
);
...
...
Source/Basic Shapes/SvgVisualElementStyle.cs
View file @
ebba7b35
...
...
@@ -26,6 +26,30 @@ namespace Svg
set
{
this
.
Attributes
[
"visibility"
]
=
value
;
}
}
/// <summary>
/// Gets or sets a value to determine whether the element will be rendered.
/// Needed to support SVG attribute display="none"
/// </summary>
[
SvgAttribute
(
"display"
)]
public
virtual
string
Display
{
get
{
return
this
.
Attributes
[
"display"
]
as
string
;
}
set
{
this
.
Attributes
[
"display"
]
=
value
;
}
}
// Displayable - false if attribute display="none", true otherwise
protected
virtual
bool
Displayable
{
get
{
string
checkForDisplayNone
=
this
.
Attributes
[
"display"
]
as
string
;
if
((!
string
.
IsNullOrEmpty
(
checkForDisplayNone
))
&&
(
checkForDisplayNone
==
"none"
))
return
false
;
else
return
true
;
}
}
/// <summary>
/// Gets or sets the fill <see cref="SvgPaintServer"/> of this element.
/// </summary>
...
...
Source/Document Structure/SvgGroup.cs
View file @
ebba7b35
...
...
@@ -68,6 +68,9 @@ namespace Svg
/// <param name="graphics">The <see cref="Graphics"/> object to render to.</param>
protected
override
void
Render
(
SvgRenderer
renderer
)
{
if
(!
Visible
||
!
Displayable
)
return
;
this
.
PushTransforms
(
renderer
);
this
.
SetClip
(
renderer
);
base
.
RenderChildren
(
renderer
);
...
...
Source/Document Structure/SvgUse.cs
View file @
ebba7b35
...
...
@@ -80,6 +80,9 @@ namespace Svg
protected
override
void
Render
(
SvgRenderer
renderer
)
{
if
(!
Visible
||
!
Displayable
)
return
;
this
.
PushTransforms
(
renderer
);
SvgVisualElement
element
=
(
SvgVisualElement
)
this
.
OwnerDocument
.
IdManager
.
GetElementById
(
this
.
ReferencedElement
);
...
...
Source/Painting/EnumConverters.cs
View file @
ebba7b35
...
...
@@ -44,7 +44,13 @@ namespace Svg
throw
new
ArgumentOutOfRangeException
(
"value must be a string."
);
}
return
(
string
)
value
==
"visible"
?
true
:
false
;
// Note: currently only used by SvgVisualElement.Visible but if
// conversion is used elsewhere these checks below will need to change
string
visibility
=
(
string
)
value
;
if
((
visibility
==
"hidden"
)
||
(
visibility
==
"collapse"
))
return
false
;
else
return
true
;
}
public
override
object
ConvertTo
(
ITypeDescriptorContext
context
,
CultureInfo
culture
,
object
value
,
Type
destinationType
)
...
...
Prev
1
2
3
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