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
cebda093
Commit
cebda093
authored
Apr 26, 2014
by
C Moore
Browse files
Support for `"display=none"` #66
parent
ff49b835
Changes
2
Show whitespace changes
Inline
Side-by-side
Source/Basic Shapes/SvgVisualElementStyle.cs
View file @
cebda093
...
@@ -22,10 +22,29 @@ namespace Svg
...
@@ -22,10 +22,29 @@ namespace Svg
[
SvgAttribute
(
"visibility"
)]
[
SvgAttribute
(
"visibility"
)]
public
virtual
bool
Visible
public
virtual
bool
Visible
{
{
get
{
return
(
this
.
Attributes
[
"visibility"
]
==
null
)
?
true
:
(
bool
)
this
.
Attributes
[
"visibility"
];
}
// Add a check for display="none" (that also affects/sets Visible)
get
{
string
checkForDisplayNone
=
this
.
Attributes
[
"display"
]
as
string
;
if
((!
string
.
IsNullOrEmpty
(
checkForDisplayNone
))
&&
(
checkForDisplayNone
==
"none"
))
return
false
;
else
return
(
this
.
Attributes
[
"visibility"
]
==
null
)
?
true
:
(
bool
)
this
.
Attributes
[
"visibility"
];
}
set
{
this
.
Attributes
[
"visibility"
]
=
value
;
}
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
;
}
}
/// <summary>
/// <summary>
/// Gets or sets the fill <see cref="SvgPaintServer"/> of this element.
/// Gets or sets the fill <see cref="SvgPaintServer"/> of this element.
/// </summary>
/// </summary>
...
...
Source/Document Structure/SvgGroup.cs
View file @
cebda093
...
@@ -68,6 +68,9 @@ namespace Svg
...
@@ -68,6 +68,9 @@ namespace Svg
/// <param name="graphics">The <see cref="Graphics"/> object to render to.</param>
/// <param name="graphics">The <see cref="Graphics"/> object to render to.</param>
protected
override
void
Render
(
SvgRenderer
renderer
)
protected
override
void
Render
(
SvgRenderer
renderer
)
{
{
if
(!
Visible
)
return
;
this
.
PushTransforms
(
renderer
);
this
.
PushTransforms
(
renderer
);
this
.
SetClip
(
renderer
);
this
.
SetClip
(
renderer
);
base
.
RenderChildren
(
renderer
);
base
.
RenderChildren
(
renderer
);
...
...
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