This commit is contained in:
giulio-Joshi 2022-10-25 21:11:53 +02:00
parent 7cc47d7284
commit 0933e157d5
2 changed files with 3 additions and 3 deletions

View File

@ -106,7 +106,7 @@ Options:
[default: 4] [default: 4]
-w, --width <WIDTH> -w, --width <WIDTH>
In case you know how many columns are needed, this paramter will calcualte the scale factor for you. Width expressed as text-columns, this parameter will calculate the scale factor for you.
Overrides `scale` parameter even when specified. Overrides `scale` parameter even when specified.
[default: disabled] [default: disabled]

View File

@ -63,8 +63,8 @@ fn get_character(
} }
/// ///
/// Determine which scale to use in presence of `width` parameters, /// Determine how much scale to use in presence of `width` parameters,
/// otherwise uses regular `scale` parameter as default /// otherwise returns regular `scale` parameter per default behaviour
/// ///
fn calculate_scale(args: &Arguments, dimensions: (u32, u32)) -> u32 { fn calculate_scale(args: &Arguments, dimensions: (u32, u32)) -> u32 {
args.width.map_or_else(|| args.scale, |v| dimensions.0 / v) args.width.map_or_else(|| args.scale, |v| dimensions.0 / v)