diff options
Diffstat (limited to 'src/gui/Utils.cpp')
-rw-r--r-- | src/gui/Utils.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/Utils.cpp b/src/gui/Utils.cpp index d1643f2..8f77f17 100644 --- a/src/gui/Utils.cpp +++ b/src/gui/Utils.cpp @@ -67,4 +67,11 @@ namespace gsr { return from; } + + mgl::vec2f clamp_keep_aspect_ratio(mgl::vec2f from, mgl::vec2f to) { + if(from.x > to.x || from.y > to.y) + return scale_keep_aspect_ratio(from, to); + else + return from; + } }
\ No newline at end of file |