summaryrefslogtreecommitdiffhomepage
path: root/anim-crop-tool/main.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-04 11:09:41 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-04 21:36:58 +0100
commit14167171aff17b9bc4b5531fffd3f729e12f8a59 (patch)
treec15e56a4ec716f6cb83419cea37dc63f484859ab /anim-crop-tool/main.cpp
parentb16ab0038a0ec70c59a3bbfef4aa4dee0b04cf15 (diff)
src: make anim_scale easier to construct
Diffstat (limited to 'anim-crop-tool/main.cpp')
-rw-r--r--anim-crop-tool/main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/anim-crop-tool/main.cpp b/anim-crop-tool/main.cpp
index 6cfaf8aa..9c09a413 100644
--- a/anim-crop-tool/main.cpp
+++ b/anim-crop-tool/main.cpp
@@ -94,7 +94,7 @@ static bool load_file(anim_group& group, options& opts, anim_atlas_& atlas, Stri
if (opts.scale.type != anim_scale_type::ratio)
{
float new_width = opts.scale.scale_to_({(unsigned)size.width, (unsigned)size.height})[0];
- opts.scale = {{.r = {new_width / (float)size.width}}, anim_scale_type::ratio};
+ opts.scale = {new_width / (float)size.width};
}
const auto dest_size = fm_begin(
@@ -211,11 +211,11 @@ static std::tuple<options, Arguments, bool> parse_cmdline(int argc, const char*
options opts;
if (!args.value<StringView>("width").isEmpty())
- opts.scale = { { .f = {true, args.value<unsigned>("width")} }, anim_scale_type::fixed };
+ opts.scale = {args.value<unsigned>("width"), true};
else if (!args.value<StringView>("height").isEmpty())
- opts.scale = { { .f = {false, args.value<unsigned>("height")} }, anim_scale_type::fixed };
+ opts.scale = {args.value<unsigned>("height"), false};
else if (!args.value<StringView>("scale").isEmpty())
- opts.scale = { { .r = {args.value<float>("scale")} } , anim_scale_type::ratio };
+ opts.scale = {args.value<float>("scale")};
opts.output_dir = Path::join(loader.startup_directory(), args.value<StringView>("output"));
opts.input_file = Path::join(loader.startup_directory(), args.value<StringView>("input"));