Backed out changeset 82a3a2987537 for LL fix
parent
980ac325ca
commit
4fc901d703
|
|
@ -862,14 +862,13 @@ 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();
|
||||
//<FS:JL> 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);
|
||||
//}</FS:JL>*/
|
||||
if (getActiveSnapshotType(view) == LLSnapshotLivePreview::SNAPSHOT_TEXTURE)
|
||||
{
|
||||
new_width = llmin(new_width, MAX_TEXTURE_SIZE);
|
||||
new_height = llmin(new_height, MAX_TEXTURE_SIZE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -907,13 +906,11 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL
|
|||
{
|
||||
getWidthSpinner(view)->setValue(width);
|
||||
getHeightSpinner(view)->setValue(height);
|
||||
//<FS:JL> 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);
|
||||
//}</FS:JL>*/
|
||||
if (getActiveSnapshotType(view) == LLSnapshotLivePreview::SNAPSHOT_TEXTURE)
|
||||
{
|
||||
getWidthSpinner(view)->setIncrement(width >> 1);
|
||||
getHeightSpinner(view)->setIncrement(height >> 1);
|
||||
}
|
||||
}
|
||||
// <FS:Ansariel> Store settings at logout; Only update spinners when using custom resolution
|
||||
}
|
||||
|
|
@ -1039,13 +1036,11 @@ void LLFloaterSnapshot::Impl::setImageSizeSpinnersValues(LLFloaterSnapshot *view
|
|||
{
|
||||
getWidthSpinner(view)->forceSetValue(width);
|
||||
getHeightSpinner(view)->forceSetValue(height);
|
||||
//<FS:JL> 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);
|
||||
//}</FS:JL>*/
|
||||
if (getActiveSnapshotType(view) == LLSnapshotLivePreview::SNAPSHOT_TEXTURE)
|
||||
{
|
||||
getWidthSpinner(view)->setIncrement(width >> 1);
|
||||
getHeightSpinner(view)->setIncrement(height >> 1);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
|||
|
|
@ -39,20 +39,18 @@
|
|||
|
||||
const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512
|
||||
|
||||
//<FS:JL> 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;
|
||||
//}</FS:JL>
|
||||
S32 power_of_two(S32 sz, S32 upper)
|
||||
{
|
||||
S32 res = upper;
|
||||
while( upper >= sz)
|
||||
{
|
||||
res = upper;
|
||||
upper >>= 1;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
// virtual </FS:JL>
|
||||
// virtual
|
||||
BOOL LLPanelSnapshot::postBuild()
|
||||
{
|
||||
getChild<LLUICtrl>(getImageSizeComboName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onResolutionComboCommit, this, _1));
|
||||
|
|
@ -193,30 +191,26 @@ void LLPanelSnapshot::cancel()
|
|||
void LLPanelSnapshot::onCustomResolutionCommit()
|
||||
{
|
||||
LLSD info;
|
||||
info["w"] = getChild<LLUICtrl>(getWidthSpinnerName())->getValue().asInteger();
|
||||
info["h"] = getChild<LLUICtrl>(getHeightSpinnerName())->getValue().asInteger();
|
||||
//<FS:JL> 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<LLSpinCtrl>(getWidthSpinnerName());
|
||||
//LLSpinCtrl *heightSpinner = getChild<LLSpinCtrl>(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();
|
||||
//}</FS:JL>
|
||||
LLSpinCtrl *widthSpinner = getChild<LLSpinCtrl>(getWidthSpinnerName());
|
||||
LLSpinCtrl *heightSpinner = getChild<LLSpinCtrl>(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));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue