diff options
author | Pepijn Van Eeckhoudt <pepijn@vaneeckhoudt.net> | 2021-01-11 14:33:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-11 14:33:51 +0100 |
commit | eef8e3ec9069e6741c5a854a274e09841ade31c9 (patch) | |
tree | f041353c3cda7dbe1a644f9617eff8065c603395 | |
parent | 5f4e679ef65755871e2926b1668acf35d15778d7 (diff) |
Make --scale a multiplier of the default scale
The help for the `--scale` option states the default value is 1. This is not the case though (current default is 8.0) which leads to the surprising result that without a scale argument the output width will be `x` and with, for instance `--scale 2` the output width will be `x / 4` instead of `x * 2`.
This change makes the CLI scale argument a multiplier of the default scale instead of overwriting the default scale.
-rw-r--r-- | svgbob_cli/src/main.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/svgbob_cli/src/main.rs b/svgbob_cli/src/main.rs index d86c2f8..0773354 100644 --- a/svgbob_cli/src/main.rs +++ b/svgbob_cli/src/main.rs @@ -129,8 +129,10 @@ fn main() { settings.stroke_width = stroke_width; } - if let Some(scale) = parse_value_of(&args, "scale") { - settings.scale = scale; + let scale : Option<f32> = parse_value_of(&args, "scale"); + match scale { + Some(s) => { settings.scale *= s; }, + _ => {} } let svg = svgbob::to_svg_with_settings(&*bob, &settings); |