Commit c92b79e4 authored by RazrFalcon's avatar RazrFalcon

Fixed build on Rust 1.29

parent 4d62d312
......@@ -108,20 +108,20 @@ Also, we do not test against Chrome, Firefox, Inkscape and Batik because they ha
- [`xmlparser`](https://github.com/RazrFalcon/xmlparser) - an XML parser
- [`svgtypes`](https://github.com/RazrFalcon/svgtypes) - SVG types parser and writer
- [`rctree`](https://github.com/RazrFalcon/rctree) - a DOM-like tree
- [`resvg-qt`](https://github.com/RazrFalcon/resvg-qt) - a minimal bindings for [Qt]
- [`resvg-qt`](./resvg-qt) - a minimal bindings to [Qt]
All other dependencies aren't written by me for this project.
## Directory structure
- `capi` - C/FFI interface for *resvg*
- `docs` - Basic documentation
- `docs` - basic documentation
- `examples` - *resvg* as a library usage examples
- `resvg-qt` - A minimal bindings to Qt used by *resvg*
- `src` - Source code
- `testing_tools` - Scripts used for testing
- `tools` - Useful CLI tools
- `usvg` - An SVG simplification library used by *resvg*
- `resvg-qt` - a minimal bindings to Qt used by *resvg*
- `src` - source code
- `testing_tools` - scripts used for testing
- `tools` - useful CLI tools
- `usvg` - an SVG simplification library used by *resvg*
## Safety
......
......@@ -7,12 +7,12 @@
use std::process;
use std::path;
use gumdrop::Options as CliOptions;
use gumdrop::Options;
use resvg::{
self,
usvg,
FitTo,
Options,
};
pub fn print_help() {
......@@ -66,7 +66,7 @@ ARGS:
backends().join(", "));
}
#[derive(Debug, CliOptions)]
#[derive(Debug, Options)]
struct CliArgs {
#[options(no_short)]
help: bool,
......@@ -192,7 +192,7 @@ pub struct Args {
pub quiet: bool,
}
pub fn parse() -> Result<(Args, Options), String> {
pub fn parse() -> Result<(Args, resvg::Options), String> {
let args: Vec<String> = ::std::env::args().collect();
let args = match CliArgs::parse_args_default(&args[1..]) {
Ok(v) => v,
......@@ -257,7 +257,7 @@ pub fn parse() -> Result<(Args, Options), String> {
None => vec!["en".to_string()], // TODO: use system language
};
let opt = Options {
let opt = resvg::Options {
usvg: usvg::Options {
path: Some(in_svg.into()),
dpi: args.dpi as f64,
......
......@@ -2,6 +2,8 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
use std::f64;
// external
use svgdom;
......@@ -71,7 +73,7 @@ fn convert_orientation(attrs: &svgdom::Attributes) -> tree::MarkerOrientation {
let a = match angle.unit {
svgdom::AngleUnit::Degrees => angle.num,
svgdom::AngleUnit::Gradians => angle.num * 180.0 / 200.0,
svgdom::AngleUnit::Radians => angle.num * 180.0 / std::f64::consts::PI,
svgdom::AngleUnit::Radians => angle.num * 180.0 / f64::consts::PI,
};
tree::MarkerOrientation::Angle(a)
......
......@@ -11,6 +11,7 @@ use std::path;
// external
use svgdom;
use libflate;
// self
pub use self::nodes::*;
......
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