mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 13:09:52 +02:00
use ceil
This commit is contained in:
parent
f6670a6374
commit
4d7d483c0e
1 changed files with 1 additions and 1 deletions
|
@ -667,7 +667,7 @@ QImage OpenGLDisplayPlugin::getScreenshot(float aspectRatio) const {
|
||||||
auto bestSize = size;
|
auto bestSize = size;
|
||||||
uvec2 corner(0);
|
uvec2 corner(0);
|
||||||
if (aspectRatio != 0.0f) { // Pick out the largest piece of the center that produces the requested width/height aspectRatio
|
if (aspectRatio != 0.0f) { // Pick out the largest piece of the center that produces the requested width/height aspectRatio
|
||||||
if (((size.y * aspectRatio) + 0.5f) < size.x) {
|
if (ceil(size.y * aspectRatio) < size.x) {
|
||||||
bestSize.x = round(size.y * aspectRatio);
|
bestSize.x = round(size.y * aspectRatio);
|
||||||
} else {
|
} else {
|
||||||
bestSize.y = round(size.x / aspectRatio);
|
bestSize.y = round(size.x / aspectRatio);
|
||||||
|
|
Loading…
Reference in a new issue