diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-06-08 19:36:29 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-06-08 19:36:29 +0300 |
commit | 8ef8497add2007d29de1cb75b55e77349a7c717f (patch) | |
tree | b283424913c824d570e85badc22b42edc6c56f99 /indra/newview | |
parent | 96d717d17b0edbc22fe39a51d985498b47e372f5 (diff) |
SL-17532 Cap image size for profile image preview
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterprofiletexture.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/newview/llfloaterprofiletexture.cpp b/indra/newview/llfloaterprofiletexture.cpp index 743685e7d1..bf1f56a6d1 100644 --- a/indra/newview/llfloaterprofiletexture.cpp +++ b/indra/newview/llfloaterprofiletexture.cpp @@ -115,6 +115,16 @@ void LLFloaterProfileTexture::updateDimensions() S32 width = old_floater_rect.getWidth() - old_image_rect.getWidth() + mLastWidth; S32 height = old_floater_rect.getHeight() - old_image_rect.getHeight() + mLastHeight; + const F32 MAX_DIMENTIONS = 512; // most profiles are supposed to be 256x256 + + S32 biggest_dim = llmax(width, height); + if (biggest_dim > MAX_DIMENTIONS) + { + F32 scale_down = MAX_DIMENTIONS / (F32)biggest_dim; + width *= scale_down; + height *= scale_down; + } + //reshape floater reshape(width, height); |