Skip to content

Commit 546de85

Browse files
authored
Merge pull request #5 from ievgennaida/master
Skipped group boundaries import when group is hidden.
2 parents 69a3bd0 + 7581aa5 commit 546de85

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

SvgFileType/SvgFileType.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,30 @@ private static void RenderElements(List<SvgVisualElement> elements, Document out
305305

306306
if (element is PaintGroupBoundaries)
307307
{
308+
309+
var boundaryNode = ((PaintGroupBoundaries)element);
310+
308311
// Render empty group boundary and continue
309312
var pdnLayer = new BitmapLayer(outputDocument.Width, outputDocument.Height);
310-
var boundaryNode = ((PaintGroupBoundaries)element);
311313
pdnLayer.Name = boundaryNode.ID;
312314

313315
// Store related group opacity and visibility.
314316
if (boundaryNode.RelatedGroup != null)
315317
{
318+
if (!importHiddenLayers)
319+
{
320+
// Skip group boundaries for hidden layers.
321+
if (!GetOriginalVisibilityState(boundaryNode.RelatedGroup))
322+
{
323+
layer++;
324+
if (progress != null)
325+
progress(layer);
326+
327+
continue;
328+
}
329+
}
330+
331+
316332
pdnLayer.Opacity = (byte)(boundaryNode.RelatedGroup.Opacity * 255);
317333
pdnLayer.Visible = boundaryNode.RelatedGroup.Visible;
318334
}

0 commit comments

Comments
 (0)