From ff29b1c8cc3954108edc7085a2afba3c9b74c420 Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Fri, 30 Jan 2015 02:18:51 +0100 Subject: [PATCH] style/conversion fixes --- libraries/render-utils/src/TextureCache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/render-utils/src/TextureCache.cpp b/libraries/render-utils/src/TextureCache.cpp index a0c47585c7..a97b3f599a 100644 --- a/libraries/render-utils/src/TextureCache.cpp +++ b/libraries/render-utils/src/TextureCache.cpp @@ -459,14 +459,14 @@ void ImageReader::run() { int originalHeight = image.height(); // enforce a fixed maximum area (1024 * 2048) - const float MAXIMUM_AREA_SIZE = 2097152.0f; + const int MAXIMUM_AREA_SIZE = 2097152; int imageArea = image.width() * image.height(); if (imageArea > MAXIMUM_AREA_SIZE) { - float scaleRatio = sqrtf(MAXIMUM_AREA_SIZE) / sqrtf((float)imageArea); + float scaleRatio = sqrtf((float)MAXIMUM_AREA_SIZE) / sqrtf((float)imageArea); int resizeWidth = static_cast(std::floor(scaleRatio * static_cast(image.width()))); int resizeHeight = static_cast(std::floor(scaleRatio * static_cast(image.height()))); qDebug() << "Image greater than maximum size:" << _url << image.width() << image.height() << - " scaled to :" << resizeWidth << resizeHeight; + " scaled to:" << resizeWidth << resizeHeight; image = image.scaled(resizeWidth, resizeHeight, Qt::IgnoreAspectRatio); imageArea = image.width() * image.height(); }