Commit 57650675 authored by RazrFalcon's avatar RazrFalcon

Fixed mask on mask.

parent bb93f170
......@@ -8,12 +8,11 @@ This changelog also contains important changes in dependencies.
## [Unreleased]
### Added
- (resvg) Nested `clipPath` support.
- (resvg) Nested `clipPath` and `mask` support.
- (resvg) MSVC support.
- (rendersvg) `font-family`, `font-size` and `languages` to args.
- (usvg) `systemLanguage` attribute support.
- (usvg) Default font family and size is configurable now.
- (usvg) `mask` attribute on `mask` element support.
- (c-api) `RESVG_ERROR_PARSING_FAILED`.
- (c-api) `font_family`, `font_size` and `languages` to `resvg_options`.
......
......@@ -31,7 +31,7 @@ travis-ci = { repository = "RazrFalcon/resvg" }
log = "0.4.5"
rgb = "0.8.9"
#usvg = "0.2"
usvg = { git = "https://github.com/RazrFalcon/usvg", rev = "1bcd5b7" }
usvg = { git = "https://github.com/RazrFalcon/usvg", rev = "371f76b" }
#usvg = { path = "../usvg" }
unicode-segmentation = "1.2.1"
......
......@@ -73,6 +73,7 @@ private:
opt.languages = toCStr(QLocale().bcp47Name());
// TODO: should be set manually
const auto screens = qApp->screens();
if (!screens.isEmpty()) {
const auto screen = screens.at(0);
......
......@@ -51,6 +51,14 @@ pub fn apply(
mask::image_to_mask(&mut data, layers.image_size());
}
if let Some(ref id) = mask.mask {
if let Some(ref mask_node) = node.tree().defs_by_id(id) {
if let usvg::NodeKind::Mask(ref mask) = *mask_node.borrow() {
apply(mask_node, mask, opt, bbox, layers, sub_cr);
}
}
}
sub_cr.set_matrix(cairo::Matrix::identity());
sub_cr.set_source_surface(&*mask_surface, 0.0, 0.0);
sub_cr.set_operator(cairo::Operator::DestIn);
......
......@@ -43,6 +43,14 @@ pub fn apply(
mask::image_to_mask(&mut mask_img.data_mut(), layers.image_size());
if let Some(ref id) = mask.mask {
if let Some(ref mask_node) = node.tree().defs_by_id(id) {
if let usvg::NodeKind::Mask(ref mask) = *mask_node.borrow() {
apply(mask_node, mask, opt, bbox, layers, sub_p);
}
}
}
sub_p.set_transform(&qt::Transform::default());
sub_p.set_composition_mode(qt::CompositionMode::DestinationIn);
sub_p.draw_image(0.0, 0.0, &mask_img);
......
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