From 88de5ab033fc4c7d4ffb98a5243799f5149c10f9 Mon Sep 17 00:00:00 2001 From: Jessica Date: Sun, 5 Apr 2015 15:48:16 -0400 Subject: [PATCH] FIRE-15794 Very ugly backout of MAINT-4341 because breaking the ability to capture full screen snapshots is worse than mismatched pixel height and width problems. --- indra/newview/llfloatersnapshot.cpp | 37 +++++++++------- indra/newview/llpanelsnapshot.cpp | 68 ++++++++++++++++------------- 2 files changed, 58 insertions(+), 47 deletions(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 51d63f89ca..35333d5426 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -829,13 +829,14 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL LL_DEBUGS() << "Loading typed res from panel " << spanel->getName() << LL_ENDL; new_width = spanel->getTypedPreviewWidth(); new_height = spanel->getTypedPreviewHeight(); - + // FIRE-15794. Back out MAINT-4341 FIXED Pixel width and height of the preview is not matched to value of Width or Height text-box in the ?Snapshot to inventory? window + // Because having cropped snapshots of UI is worse than having mismatched values. // Limit custom size for inventory snapshots to 512x512 px. - if (getActiveSnapshotType(view) == LLSnapshotLivePreview::SNAPSHOT_TEXTURE) - { - new_width = llmin(new_width, MAX_TEXTURE_SIZE); - new_height = llmin(new_height, MAX_TEXTURE_SIZE); - } + //if (getActiveSnapshotType(view) == LLSnapshotLivePreview::SNAPSHOT_TEXTURE) + //{ + // new_width = llmin(new_width, MAX_TEXTURE_SIZE); + // new_height = llmin(new_height, MAX_TEXTURE_SIZE); + //}*/ } else { @@ -873,11 +874,13 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL { getWidthSpinner(view)->setValue(width); getHeightSpinner(view)->setValue(height); - if (getActiveSnapshotType(view) == LLSnapshotLivePreview::SNAPSHOT_TEXTURE) - { - getWidthSpinner(view)->setIncrement(width >> 1); - getHeightSpinner(view)->setIncrement(height >> 1); - } + // FIRE-15794. Back out MAINT-4341 FIXED Pixel width and height of the preview is not matched to value of Width or Height text-box in the ?Snapshot to inventory? window + // Because having cropped snapshots of UI is worse than having mismatched values. + //if (getActiveSnapshotType(view) == LLSnapshotLivePreview::SNAPSHOT_TEXTURE) + //{ + // getWidthSpinner(view)->setIncrement(width >> 1); + // getHeightSpinner(view)->setIncrement(height >> 1); + //}*/ } // Store settings at logout; Only update spinners when using custom resolution } @@ -1003,11 +1006,13 @@ void LLFloaterSnapshot::Impl::setImageSizeSpinnersValues(LLFloaterSnapshot *view { getWidthSpinner(view)->forceSetValue(width); getHeightSpinner(view)->forceSetValue(height); - if (getActiveSnapshotType(view) == LLSnapshotLivePreview::SNAPSHOT_TEXTURE) - { - getWidthSpinner(view)->setIncrement(width >> 1); - getHeightSpinner(view)->setIncrement(height >> 1); - } + // FIRE-15794. Back out MAINT-4341 FIXED Pixel width and height of the preview is not matched to value of Width or Height text-box in the ?Snapshot to inventory? window + // Because having cropped snapshots of UI is worse than having mismatched values. + //if (getActiveSnapshotType(view) == LLSnapshotLivePreview::SNAPSHOT_TEXTURE) + //{ + // getWidthSpinner(view)->setIncrement(width >> 1); + // getHeightSpinner(view)->setIncrement(height >> 1); + //}*/ } // static diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp index 149faf7b90..47a50d344a 100755 --- a/indra/newview/llpanelsnapshot.cpp +++ b/indra/newview/llpanelsnapshot.cpp @@ -39,18 +39,20 @@ const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512 -S32 power_of_two(S32 sz, S32 upper) -{ - S32 res = upper; - while( upper >= sz) - { - res = upper; - upper >>= 1; - } - return res; -} +// FIRE-15794. Back out MAINT-4341 FIXED Pixel width and height of the preview is not matched to value of Width or Height text-box in the ?Snapshot to inventory? window + // Because having cropped snapshots of UI is worse than having mismatched values. +//S32 power_of_two(S32 sz, S32 upper) +//{ +// S32 res = upper; +// while( upper >= sz) +// { +// res = upper; +// upper >>= 1; +// } +// return res; +//} -// virtual +// virtual BOOL LLPanelSnapshot::postBuild() { getChild(getImageSizeComboName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onResolutionComboCommit, this, _1)); @@ -191,26 +193,30 @@ void LLPanelSnapshot::cancel() void LLPanelSnapshot::onCustomResolutionCommit() { LLSD info; - LLSpinCtrl *widthSpinner = getChild(getWidthSpinnerName()); - LLSpinCtrl *heightSpinner = getChild(getHeightSpinnerName()); - if (getName() == "panel_snapshot_inventory") - { - S32 width = widthSpinner->getValue().asInteger(); - width = power_of_two(width, MAX_TEXTURE_SIZE); - info["w"] = width; - widthSpinner->setIncrement(width >> 1); - widthSpinner->forceSetValue(width); - S32 height = heightSpinner->getValue().asInteger(); - height = power_of_two(height, MAX_TEXTURE_SIZE); - heightSpinner->setIncrement(height >> 1); - heightSpinner->forceSetValue(height); - info["h"] = height; - } - else - { - info["w"] = widthSpinner->getValue().asInteger(); - info["h"] = heightSpinner->getValue().asInteger(); - } + info["w"] = getChild(getWidthSpinnerName())->getValue().asInteger(); + info["h"] = getChild(getHeightSpinnerName())->getValue().asInteger(); + // FIRE-15794. Back out MAINT-4341 FIXED Pixel width and height of the preview is not matched to value of Width or Height text-box in the ?Snapshot to inventory? window + // Because having cropped snapshots of UI is worse than having mismatched values. + //LLSpinCtrl *widthSpinner = getChild(getWidthSpinnerName()); + //LLSpinCtrl *heightSpinner = getChild(getHeightSpinnerName()); + //if (getName() == "panel_snapshot_inventory") + //{ + // S32 width = widthSpinner->getValue().asInteger(); + // width = power_of_two(width, MAX_TEXTURE_SIZE); + // info["w"] = width; + // widthSpinner->setIncrement(width >> 1); + // widthSpinner->forceSetValue(width); + // S32 height = heightSpinner->getValue().asInteger(); + // height = power_of_two(height, MAX_TEXTURE_SIZE); + // heightSpinner->setIncrement(height >> 1); + // heightSpinner->forceSetValue(height); + // info["h"] = height; + //} + //else + //{ + // info["w"] = widthSpinner->getValue().asInteger(); + // info["h"] = heightSpinner->getValue().asInteger(); + //} LLFloaterSnapshot::getInstance()->notify(LLSD().with("custom-res-change", info)); }