aboutsummaryrefslogtreecommitdiff
path: root/src/Scale.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-10-21 03:12:35 +0200
committerdec05eba <dec05eba@protonmail.com>2020-10-21 03:12:35 +0200
commitea6f1b425a6aa9b7145a00d81473ef9508279eec (patch)
tree61f3d59aa277b889ed149cf6ccd5fc9dc2b836c8 /src/Scale.cpp
parentf126659965425ee5f5a3851fbe83ae532e48c478 (diff)
Fix thumbnail fallback size being incorrect, incorrect read marker for matrix
Diffstat (limited to 'src/Scale.cpp')
-rw-r--r--src/Scale.cpp38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/Scale.cpp b/src/Scale.cpp
deleted file mode 100644
index ab7ea2e..0000000
--- a/src/Scale.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "../include/Scale.hpp"
-
-namespace QuickMedia {
- static sf::Vector2f wrap_to_size_x(const sf::Vector2f &size, const sf::Vector2f &clamp_size) {
- sf::Vector2f new_size;
- auto size_ratio = size.y / size.x;
- new_size.x = clamp_size.x;
- new_size.y = new_size.x * size_ratio;
- return new_size;
- }
-
- static sf::Vector2f wrap_to_size_y(const sf::Vector2f &size, const sf::Vector2f &clamp_size) {
- sf::Vector2f new_size;
- auto size_ratio = size.x / size.y;
- new_size.y = clamp_size.y;
- new_size.x = new_size.y * size_ratio;
- return new_size;
- }
-
- sf::Vector2f wrap_to_size(const sf::Vector2f &size, const sf::Vector2f &clamp_size) {
- sf::Vector2f new_size;
- new_size = wrap_to_size_x(size, clamp_size);
- if(new_size.y > clamp_size.y)
- new_size = wrap_to_size_y(size, clamp_size);
- return new_size;
- }
-
- sf::Vector2f clamp_to_size(const sf::Vector2f &size, const sf::Vector2f &clamp_size) {
- sf::Vector2f new_size = size;
- if(size.x > clamp_size.x || size.y > clamp_size.y)
- new_size = wrap_to_size(new_size, clamp_size);
- return new_size;
- }
-
- sf::Vector2f get_ratio(const sf::Vector2f &original_size, const sf::Vector2f &new_size) {
- return sf::Vector2f(new_size.x / original_size.x, new_size.y / original_size.y);
- }
-} \ No newline at end of file