Commit 9d8c608f authored by RazrFalcon's avatar RazrFalcon

(usvg) Fixed 'symbol' resolving.

parent 44800cf6
......@@ -29,6 +29,7 @@ This changelog also contains important changes in dependencies.
that had `filter` on a child.
- (usvg) Style attributes resolving on the root `svg` element.
- (usvg) `SmoothCurveTo` and `SmoothQuadratic` conversion.
- (usvg) `symbol` resolving.
- (qt-backend) Stroking of LineTo specified as CurveTo.
- (svgdom) `stroke-miterlimit` attribute parsing.
- (svgdom) `length` and `number` attribute types parsing.
......
e-path-044.svg
e-path-045.svg
e-symbol-009.svg
e-path-044.svg
e-path-045.svg
e-symbol-009.svg
......@@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Groups regrouping.
- Style attributes resolving on the root `svg` element.
- `SmoothCurveTo` and `SmoothQuadratic` conversion.
- `symbol` resolving.
### Removed
- `Rect::transform`.
......
......@@ -175,6 +175,20 @@ fn resolve_symbol(
// If 'clipPath' was created we have to set the original transform
// to the group that contains 'clip-path' attribute.
g_node.set_attribute((AId::Transform, orig_ts));
// Swap ID's.
g_node.set_id(use_node.id().as_str());
use_node.set_id(String::new());
// Relink the node.
for mut node in doc.root().descendants().filter(|n| n.is_tag_name(EId::Use)) {
let av = node.attributes().get_value(AId::Href).cloned();
if let Some(AValue::Link(link)) = av {
if link == *use_node {
node.set_attribute((AId::Href, g_node.clone()));
}
}
}
} else {
// Set the original transform back to the 'use' itself.
use_node.prepend_transform(orig_ts);
......
......@@ -727,11 +727,11 @@ e-switch-009,0d479bbc
e-symbol-001,62ff702f
e-symbol-002,7059ea74
e-symbol-003,2aa26e99
e-symbol-004,9dba4805
e-symbol-005,7f250be0
e-symbol-006,d60da8e7
e-symbol-004,f8d61672
e-symbol-005,b15abc5b
e-symbol-006,8bf5fc7c
e-symbol-007,62ff702f
e-symbol-008,d6499300
e-symbol-008,2860ca11
e-text-001,7221ea6b
e-text-002,105c98ad
e-text-003,ada2d928
......@@ -953,3 +953,4 @@ e-filter-061,d6667c63
e-filter-062,32cc3451
e-path-045,47fe0aec
e-path-046,d5800e26
e-symbol-009,1a5c441c
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment