diff options
-rw-r--r-- | anim-crop-tool/main.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/anim-crop-tool/main.cpp b/anim-crop-tool/main.cpp index 4d0eca1e..6cfaf8aa 100644 --- a/anim-crop-tool/main.cpp +++ b/anim-crop-tool/main.cpp @@ -91,6 +91,11 @@ static bool load_file(anim_group& group, options& opts, anim_atlas_& atlas, Stri } cv::Size size{end - start}; + 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}; + } const auto dest_size = fm_begin( auto xy = opts.scale.scale_to({(unsigned)size.width, (unsigned)size.height}); |