diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-04-17 03:32:56 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-04-17 03:32:56 +0200 |
commit | 23435ac30b25cd1a0a8d52c4a792d90f38300344 (patch) | |
tree | b032a66dfcd30b005e2ff9a506b93f30a013e512 /include/Scale.hpp | |
parent | e183c47ec2db4e3bdd82a3fbbe81d2d61c64107a (diff) |
Fit image to window in continuous scrolling mode, use n 3 for waifu2x
Diffstat (limited to 'include/Scale.hpp')
-rw-r--r-- | include/Scale.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/Scale.hpp b/include/Scale.hpp index 375ddff..e458894 100644 --- a/include/Scale.hpp +++ b/include/Scale.hpp @@ -33,6 +33,14 @@ namespace QuickMedia { } template<typename T> + static T clamp_to_size_x(const T &size, const T &clamp_size) { + T new_size = size; + if(size.x > clamp_size.x) + new_size = wrap_to_size_x(new_size, clamp_size); + return new_size; + } + + template<typename T> static T clamp_to_size(const T &size, const T &clamp_size) { T new_size = size; if(size.x > clamp_size.x || size.y > clamp_size.y) |