diff options
author | Merov Linden <merov@lindenlab.com> | 2011-04-20 23:48:03 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2011-04-20 23:48:03 -0700 |
commit | 5e12569b76593c5dc64894674cc629040654c68a (patch) | |
tree | 05cfbd4a03e980c69b7f60f7424de802df738ba6 | |
parent | 0bc8b0fd5bd230ce11b47fd4a41ebfa1dc9c27c7 (diff) | |
parent | 968a26799be75df68527594a727a6ca12d9530f7 (diff) |
merge EXP-737
-rw-r--r-- | indra/newview/llpreviewtexture.cpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 6cfb708112..18d6731fcb 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -143,10 +143,7 @@ void LLPreviewTexture::onSaveAsBtn(void* data) void LLPreviewTexture::draw() { - if (mUpdateDimensions) - { - updateDimensions(); - } + updateDimensions(); LLPreview::draw(); @@ -396,27 +393,32 @@ void LLPreviewTexture::onFileLoadedForSave(BOOL success, void LLPreviewTexture::updateDimensions() { if (!mImage) + { return; - - if(mImage->getFullWidth() == 0 || mImage->getFullHeight() == 0) + } + if ((mImage->getFullWidth() * mImage->getFullHeight()) == 0) { return; } - mUpdateDimensions = FALSE; - - getChild<LLUICtrl>("dimensions")->setTextArg("[WIDTH]", llformat("%d", mImage->getFullWidth())); + // Update the width/height display every time + getChild<LLUICtrl>("dimensions")->setTextArg("[WIDTH]", llformat("%d", mImage->getFullWidth())); getChild<LLUICtrl>("dimensions")->setTextArg("[HEIGHT]", llformat("%d", mImage->getFullHeight())); - - //reshape floater - reshape(getRect().getWidth(), getRect().getHeight()); + // Reshape the floater only when required + if (mUpdateDimensions) + { + mUpdateDimensions = FALSE; + + //reshape floater + reshape(getRect().getWidth(), getRect().getHeight()); - gFloaterView->adjustToFitScreen(this, FALSE); + gFloaterView->adjustToFitScreen(this, FALSE); - LLRect dim_rect(getChildView("dimensions")->getRect()); - LLRect aspect_label_rect(getChildView("aspect_ratio")->getRect()); - getChildView("aspect_ratio")->setVisible( dim_rect.mRight < aspect_label_rect.mLeft); + LLRect dim_rect(getChildView("dimensions")->getRect()); + LLRect aspect_label_rect(getChildView("aspect_ratio")->getRect()); + getChildView("aspect_ratio")->setVisible( dim_rect.mRight < aspect_label_rect.mLeft); + } } |