Commit 1b14c610 authored by RazrFalcon's avatar RazrFalcon

Keep invisible shapes during 'export by ID'.

Required for a proper bbox resolving.

Closes #88
parent 898df135
......@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
This changelog also contains important changes in dependencies.
## [Unreleased]
### Added
- (resvg) Keep invisible shapes during *export by ID*.
Required for a proper bbox resolving.
### Fixed
- (usvg) `offset` attribute resolving inside the `stop` element.
- (svgdom) `stroke-miterlimit` attribute parsing.
......
......@@ -472,7 +472,7 @@ dependencies = [
"resvg-qt 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"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.4.0 (git+https://github.com/RazrFalcon/usvg?rev=066d3cd)",
"usvg 0.4.0 (git+https://github.com/RazrFalcon/usvg?rev=837bba9)",
]
[[package]]
......@@ -582,7 +582,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "usvg"
version = "0.4.0"
source = "git+https://github.com/RazrFalcon/usvg?rev=066d3cd#066d3cdb9af5d944c59d69b1129b935237438c25"
source = "git+https://github.com/RazrFalcon/usvg?rev=837bba9#837bba9a2e51852d7c5c169aac596a231eda7282"
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)",
......@@ -677,7 +677,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"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.4.0 (git+https://github.com/RazrFalcon/usvg?rev=066d3cd)" = "<none>"
"checksum usvg 0.4.0 (git+https://github.com/RazrFalcon/usvg?rev=837bba9)" = "<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"
......
......@@ -30,7 +30,7 @@ travis-ci = { repository = "RazrFalcon/resvg" }
[dependencies]
log = "0.4.5"
rgb = "0.8.9"
usvg = { git = "https://github.com/RazrFalcon/usvg", rev = "066d3cd" }
usvg = { git = "https://github.com/RazrFalcon/usvg", rev = "837bba9" }
#usvg = { path = "../usvg" }
unicode-segmentation = "1.2.1"
......
......@@ -28,6 +28,7 @@ pub fn load_sub_svg(
font_size: opt.usvg.font_size,
languages: opt.usvg.languages.clone(),
keep_named_groups: false,
keep_invisible_shapes: false,
},
fit_to: FitTo::Original,
background: None,
......
......@@ -77,7 +77,7 @@ pub trait SizeExt {
impl SizeExt for Size {
fn to_screen_size(&self) -> ScreenSize {
ScreenSize::new(self.width as u32, self.height as u32)
ScreenSize::new(self.width.round() as u32, self.height.round() as u32)
}
}
......
a-stroke-miterlimit-004.svg
a-stroke-miterlimit-005.svg
e-stop-019.svg
e-stop-020.svg
e-stop-021.svg
e-stop-022.svg
e-stop-023.svg
e-stop-024.svg
e-stop-025.svg
e-stop-026.svg
e-stop-027.svg
a-stroke-miterlimit-004.svg
a-stroke-miterlimit-005.svg
e-stop-019.svg
e-stop-020.svg
e-stop-021.svg
e-stop-022.svg
e-stop-023.svg
e-stop-024.svg
e-stop-025.svg
e-stop-026.svg
e-stop-027.svg
......@@ -242,6 +242,7 @@ pub fn parse() -> Result<(Args, Options), String> {
// We don't have to keep named groups when we don't need them
// because it will slow down rendering.
let keep_named_groups = app_args.query_all || app_args.export_id.is_some();
let keep_invisible_shapes = keep_named_groups;
let mut fit_to = FitTo::Original;
if let Some(w) = args.width {
......@@ -265,6 +266,7 @@ pub fn parse() -> Result<(Args, Options), String> {
font_size: args.font_size as f64,
languages,
keep_named_groups,
keep_invisible_shapes,
},
fit_to,
background: args.background,
......
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