Commit 60cb0507 authored by RazrFalcon's avatar RazrFalcon

Fixed feOffset subregion clipping.

parent 58e86ccb
......@@ -472,7 +472,7 @@ dependencies = [
"resvg-qt 0.3.0 (git+https://github.com/RazrFalcon/resvg-qt?rev=0fde4c9)",
"rgb 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"usvg 0.3.0 (git+https://github.com/RazrFalcon/usvg?rev=371f76b)",
"usvg 0.3.0 (git+https://github.com/RazrFalcon/usvg?rev=1f298f6)",
]
[[package]]
......@@ -502,10 +502,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "roxmltree"
version = "0.3.0"
source = "git+https://github.com/RazrFalcon/roxmltree?rev=d4b8589#d4b85891efce7bf06bf99c10a03dfb141f63ecec"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"xmlparser 0.7.0 (git+https://github.com/RazrFalcon/xmlparser?rev=8af3260)",
"xmlparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
......@@ -530,20 +530,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "svgdom"
version = "0.14.0"
source = "git+https://github.com/RazrFalcon/svgdom?rev=4d3d6c9#4d3d6c9563528f83bf6ed9b22e9d699b23be428b"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"roxmltree 0.3.0 (git+https://github.com/RazrFalcon/roxmltree?rev=d4b8589)",
"roxmltree 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"simplecss 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"svgtypes 0.2.0 (git+https://github.com/RazrFalcon/svgtypes?rev=bd9f1e0)",
"svgtypes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "svgtypes"
version = "0.2.0"
source = "git+https://github.com/RazrFalcon/svgtypes?rev=bd9f1e0#bd9f1e0b51d128694e5eb5fb2dc39843fa1f38eb"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"float-cmp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"phf 0.7.23 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -582,14 +582,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "usvg"
version = "0.3.0"
source = "git+https://github.com/RazrFalcon/usvg?rev=371f76b#371f76b1c21012d415fa55519b9e5b3bfe5f69da"
source = "git+https://github.com/RazrFalcon/usvg?rev=1f298f6#1f298f6b87583fd3f28dd89e5c9fcd32930b3cad"
dependencies = [
"base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libflate 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"lyon_geom 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rctree 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"svgdom 0.14.0 (git+https://github.com/RazrFalcon/svgdom?rev=4d3d6c9)",
"svgdom 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
......@@ -614,8 +614,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "xmlparser"
version = "0.7.0"
source = "git+https://github.com/RazrFalcon/xmlparser?rev=8af3260#8af326062091500d514b9ce281951d00bed2bf28"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c"
......@@ -666,19 +666,19 @@ source = "git+https://github.com/RazrFalcon/xmlparser?rev=8af3260#8af32606209150
"checksum redox_syscall 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "a84bcd297b87a545980a2d25a0beb72a1f490c31f0a9fde52fca35bfbb1ceb70"
"checksum resvg-qt 0.3.0 (git+https://github.com/RazrFalcon/resvg-qt?rev=0fde4c9)" = "<none>"
"checksum rgb 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "002bebda58b24482d6911a59512e8a17fa1defecf5a2162521113b7cc5422dd1"
"checksum roxmltree 0.3.0 (git+https://github.com/RazrFalcon/roxmltree?rev=d4b8589)" = "<none>"
"checksum roxmltree 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "869a77456372218c6cd28ae457bedbc338af19866290e71d71965cc992e2654b"
"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9"
"checksum simplecss 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "135685097a85a64067df36e28a243e94a94f76d829087ce0be34eeb014260c0e"
"checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac"
"checksum slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d"
"checksum svgdom 0.14.0 (git+https://github.com/RazrFalcon/svgdom?rev=4d3d6c9)" = "<none>"
"checksum svgtypes 0.2.0 (git+https://github.com/RazrFalcon/svgtypes?rev=bd9f1e0)" = "<none>"
"checksum svgdom 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a9b53b3ed152fc6b871f7232a8772c640567fd25d056941450637ecba32924d"
"checksum svgtypes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c43c25e6de7264024b5e351eb0c342039eb5acf51f2e9d0099bbd324b661453b"
"checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741"
"checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b"
"checksum unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "aa6024fc12ddfd1c6dbc14a80fa2324d4568849869b779f6bd37e5e4c03344d1"
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
"checksum usvg 0.3.0 (git+https://github.com/RazrFalcon/usvg?rev=371f76b)" = "<none>"
"checksum usvg 0.3.0 (git+https://github.com/RazrFalcon/usvg?rev=1f298f6)" = "<none>"
"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0"
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
"checksum xmlparser 0.7.0 (git+https://github.com/RazrFalcon/xmlparser?rev=8af3260)" = "<none>"
"checksum xmlparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "225256c1180a843c21c5c1953aa890b544f5188b8af5d0bad87a4a1bb942f9dc"
......@@ -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 = "371f76b" }
usvg = { git = "https://github.com/RazrFalcon/usvg", rev = "1f298f6" }
#usvg = { path = "../usvg" }
unicode-segmentation = "1.2.1"
......
......@@ -419,7 +419,7 @@ impl Filter<cairo::ImageSurface> for CairoFilter {
super::image::draw_raster(data, view_box, opt, &cr);
}
}
usvg::FeImageKind::Use => {}
usvg::FeImageKind::Use(..) => {}
}
Ok(Image::from_image(buffer, ColorSpace::SRGB))
......
......@@ -347,7 +347,7 @@ impl Filter<qt::Image> for QtFilter {
super::image::draw_raster(data, view_box, opt, &mut p);
}
}
usvg::FeImageKind::Use => {}
usvg::FeImageKind::Use(..) => {}
}
Ok(Image::from_image(buffer, ColorSpace::SRGB))
......
......@@ -193,9 +193,19 @@ pub trait Filter<T: ImageExt> {
if region != subregion {
// Clip result.
let mut subregion2 = subregion;
subregion2.x -= region.x;
subregion2.y -= region.y;
// TODO: explain
let subregion2 = if let usvg::FilterKind::FeOffset(..) = primitive.kind {
// We do not support clipping on feOffset.
let mut subregion2 = region;
subregion2.x = 0;
subregion2.y = 0;
subregion2
} else {
let mut subregion2 = subregion;
subregion2.x -= region.x;
subregion2.y -= region.y;
subregion2
};
let color_space = result.color_space;
let mut buffer = result.take()?;
......
e-mask-026.svg
e-feFlood-006.svg
e-filter-041.svg
e-mask-026.svg
e-feFlood-006.svg
e-filter-041.svg
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