Skip to content

Commit

Permalink
Add copying _styles in DeepCopy (#1053)
Browse files Browse the repository at this point in the history
* DeepCopy missed coping _styles
* needed for svg elements with styles which include clip-path
  • Loading branch information
mzh3511 authored May 10, 2023
1 parent 43368fd commit 42faf6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/SvgElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,10 @@ ISvgNode ISvgNode.DeepCopy()
foreach (var node in Nodes)
newObj.Nodes.Add(node.DeepCopy());

foreach (var style in _styles)
foreach (var pair in style.Value)
newObj.AddStyle(style.Key, pair.Value, pair.Key);

return newObj;
}

Expand Down
1 change: 1 addition & 0 deletions doc/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The release versions are NuGet releases.
### Fixes
* fixed build error in C# 11 (see [PR #1030](https://github.com/svg-net/SVG/pull/1030))
* fixed out of memory exception on SVGs with gradients (see [PR #1038] (https://github.com/svg-net/SVG/pull/1038))
* fixed missing styles when `DeepCopy` the `SvgElement` (see [PR #1053] (https://github.com/svg-net/SVG/pull/1053))

## [Version 3.4.4](https://www.nuget.org/packages/Svg/3.4.4) (2022-10-29)

Expand Down

0 comments on commit 42faf6f

Please sign in to comment.