summaryrefslogtreecommitdiffhomepage
path: root/anim-crop-tool
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-02-09 19:02:12 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-02-09 19:02:12 +0100
commitf009ba6263e55383395ac3afb2335816846b333b (patch)
treeb7540bc8d063ae569e3149b14ee1a10c51f3801c /anim-crop-tool
parentfc38aaa2713e606d353102ce67678d81cec7de7d (diff)
crop-tool: oops, calculate scale from first frame
Diffstat (limited to 'anim-crop-tool')
-rw-r--r--anim-crop-tool/main.cpp5
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});