From 23435ac30b25cd1a0a8d52c4a792d90f38300344 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 17 Apr 2021 03:32:56 +0200 Subject: Fit image to window in continuous scrolling mode, use n 3 for waifu2x --- include/Scale.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/Scale.hpp') diff --git a/include/Scale.hpp b/include/Scale.hpp index 375ddff..e458894 100644 --- a/include/Scale.hpp +++ b/include/Scale.hpp @@ -32,6 +32,14 @@ namespace QuickMedia { return new_size; } + template + 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 static T clamp_to_size(const T &size, const T &clamp_size) { T new_size = size; -- cgit v1.2.3