Commit 9f3d271e authored by RazrFalcon's avatar RazrFalcon

Fixed 'color' on 'use' resolving.

parent c92b79e4
......@@ -15,6 +15,7 @@ This changelog also contains important changes in dependencies.
Does not work on the cairo backend.
### Fixed
- (usvg) `color` on `use` resolving.
- (usvg) `offset` attribute resolving inside the `stop` element.
- (usvg) Ungrouping of groups with non-inheritable attributes.
- (usvg) `rotate` attribute resolving.
......
......@@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- `offset` attribute resolving inside the `stop` element.
- Ungrouping of groups with non-inheritable attributes.
- `rotate` attribute resolving.
- `color` on `use` resolving.
### Removed
- `Rect::transform`.
......
......@@ -20,8 +20,6 @@ use super::prelude::*;
// <elem/>
// </g>
pub fn clip_element(doc: &mut Document, target_node: &mut Node) -> Option<Node> {
let mut defs_node = try_opt!(doc.defs_element(), None);
// No need to clip elements with overflow:visible.
{
let attrs = target_node.attributes();
......@@ -43,7 +41,7 @@ pub fn clip_element(doc: &mut Document, target_node: &mut Node) -> Option<Node>
let mut clip_node = doc.create_element(EId::ClipPath);
clip_node.set_id(gen_clip_path_id(doc));
clip_node.set_attribute((AId::ClipPathUnits, "userSpaceOnUse"));
defs_node.append(clip_node.clone());
g_node.insert_before(clip_node.clone());
let mut rect_node = doc.create_element(EId::Rect);
......
......@@ -138,20 +138,26 @@ pub fn prepare_doc(doc: &mut svgdom::Document, opt: &Options) {
fix_links(doc);
fix_xlinks(doc);
resolve_inherit(doc);
resolve_current_color(doc);
group_defs(doc, svg);
resolve_font_size(doc, opt);
resolve_font_weight(doc);
resolve_mask_attributes(doc);
resolve_use_attributes(doc);
resolve_svg_attributes(doc);
resolve_font_size(doc, opt);
resolve_font_weight(doc);
convert_units(svg, opt);
// `use` should be resolved before style attributes,
// because `use` can propagate own style.
resolve_use(doc, opt);
prepare_nested_svg(doc, svg);
resolve_inherit(doc);
resolve_current_color(doc);
group_defs(doc, svg);
resolve_linear_gradient_attributes(doc);
resolve_radial_gradient_attributes(doc);
resolve_gradient_stops(doc);
......@@ -169,12 +175,6 @@ pub fn prepare_doc(doc: &mut svgdom::Document, opt: &Options) {
remove_unused_defs(doc);
prepare_nested_svg(doc, svg);
// `use` should be resolved before style attributes,
// because `use` can propagate own style.
resolve_use(doc, opt);
ungroup_a(doc);
prepare_text_decoration(doc);
......
......@@ -52,7 +52,7 @@ pub fn resolve_current_color(doc: &Document) {
}
}
None => {
warn!("Failed to resolve currentColor for: {}. Removing it.", id);
warn!("Failed to resolve currentColor for '{}'. Removing it.", id);
node.remove_attribute(*id);
}
}
......
......@@ -928,3 +928,4 @@ e-marker-054,da2189e8
e-marker-055,92588210
e-marker-056,1aa62c2b
e-tspan-018,2ddc5037
e-use-023,967b9e79
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