From e906af7c3c6e4efd84b344c9572167f6ddf836fc Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Fri, 11 Jan 2019 17:39:26 +0200 Subject: SL-10327 FIXED Scalable preview of mesh model is shown with black bar on top in the Upload Model menu --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llfloatermodelpreview.cpp | 19 +++++++++++++++++-- .../skins/default/xui/en/floater_model_preview.xml | 8 +++----- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 091992d1ab..76cfc03b53 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8053,7 +8053,7 @@ PreviewRenderSize Comment - Resolution of the image rendered for the mesh upload preview + Resolution of the image rendered for the mesh upload preview (must be a power of 2) Persist 1 Type diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index ffc993e868..62157306b1 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -427,8 +427,23 @@ void LLFloaterModelPreview::initModelPreview() { delete mModelPreview; } - auto size = gSavedSettings.getS32("PreviewRenderSize"); - mModelPreview = new LLModelPreview(size, size, this ); + + S32 tex_width = 512; + S32 tex_height = 512; + + S32 max_width = llmin(gSavedSettings.getS32("PreviewRenderSize"), (S32)gPipeline.mScreenWidth); + S32 max_height = llmin(gSavedSettings.getS32("PreviewRenderSize"), (S32)gPipeline.mScreenHeight); + + while ((tex_width << 1) <= max_width) + { + tex_width <<= 1; + } + while ((tex_height << 1) <= max_height) + { + tex_height <<= 1; + } + + mModelPreview = new LLModelPreview(tex_width, tex_height, this); mModelPreview->setPreviewTarget(16.f); mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelPreview::setDetails, this, _1, _2, _3, _4, _5)); mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::toggleCalculateButton, this, _1)); diff --git a/indra/newview/skins/default/xui/en/floater_model_preview.xml b/indra/newview/skins/default/xui/en/floater_model_preview.xml index ec9104d5e7..1b038a0244 100644 --- a/indra/newview/skins/default/xui/en/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_model_preview.xml @@ -1520,7 +1520,6 @@ Analysed: name="right_panel" top="0" left="640" - background_visible="true" width="375"> Preview Spread: @@ -1624,8 +1622,8 @@ Analysed: name="physics_explode" follows="right|bottom" valign="center" - top="15" - left="80" + left="105" + top_delta="-3" min_val="0.0" max_val="3.0" height="20" -- cgit v1.2.3