diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index 42e5b19cc0..b5a246be50 100755 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -55,6 +55,7 @@ #include "llpreviewnotecard.h" #include "llpreviewscript.h" // [/SL:KB] +#include "llpreviewtexture.h" // Constants @@ -512,6 +513,14 @@ void LLMultiPreview::tabOpen(LLFloater* opened_floater, bool from_click) opened_preview->loadAsset(); } + // Update preview dimensions for multi texture preview upon tab change + LLPreviewTexture* texture_preview = dynamic_cast(opened_floater); + if (texture_preview) + { + texture_preview->setUpdateDimensions(TRUE); + } + // + // [SL:KB] - Patch: UI-FloaterSearchReplace | Checked: 2010-11-05 (Catznip-2.3.0a) | Added: Catznip-2.3.0a LLFloaterSearchReplace* pSearchFloater = LLFloaterReg::getTypedInstance("search_replace"); if ( (pSearchFloater) && (pSearchFloater->getDependee() == this) ) diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index edf6b92b24..ad7fc9b213 100755 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -606,7 +606,7 @@ void LLPreviewTexture::updateDimensions() { mUpdateDimensions = FALSE; - // : Show image at full resolution if possible + // : Show image at full resolution if possible //reshape floater //reshape(getRect().getWidth(), getRect().getHeight()); @@ -760,16 +760,17 @@ void LLPreviewTexture::updateDimensions() floater_target_height = llmax(floater_target_height, getMinHeight()); // Resize floater - if (getHost()) + LLMultiFloater* host = getHost(); + if (host) { - getHost()->growToFit(floater_target_width, floater_target_height); + S32 old_height = host->getRect().getHeight(); + host->reshape(getMinWidth(), getMinHeight()); + host->translate(0, old_height - getMinHeight()); + host->growToFit(floater_target_width, floater_target_height); } - else - { - reshape(floater_target_width, floater_target_height); - gFloaterView->adjustToFitScreen(this, FALSE); - } - // : Show image at full resolution if possible + reshape(floater_target_width, floater_target_height); + gFloaterView->adjustToFitScreen(this, FALSE); + // : Show image at full resolution if possible LLRect dim_rect(getChildView("dimensions")->getRect()); LLRect aspect_label_rect(getChildView("aspect_ratio")->getRect()); diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h index 183a56f4ee..ec87598921 100755 --- a/indra/newview/llpreviewtexture.h +++ b/indra/newview/llpreviewtexture.h @@ -91,6 +91,9 @@ public: void onButtonClickUUID(); static void onTextureLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); // + + // For requesting dimensions update + void setUpdateDimensions(BOOL update) { mUpdateDimensions = update; } protected: void init();