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.
parent
b5c4487884
commit
88de5ab033
|
|
@ -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();
|
||||
|
||||
//<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);
|
||||
}
|
||||
//if (getActiveSnapshotType(view) == LLSnapshotLivePreview::SNAPSHOT_TEXTURE)
|
||||
//{
|
||||
// new_width = llmin(new_width, MAX_TEXTURE_SIZE);
|
||||
// new_height = llmin(new_height, MAX_TEXTURE_SIZE);
|
||||
//}</FS:JL>*/
|
||||
}
|
||||
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);
|
||||
}
|
||||
//<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>*/
|
||||
}
|
||||
// <FS:Ansariel> 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);
|
||||
}
|
||||
//<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>*/
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
//<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>
|
||||
|
||||
// virtual
|
||||
// virtual </FS:JL>
|
||||
BOOL LLPanelSnapshot::postBuild()
|
||||
{
|
||||
getChild<LLUICtrl>(getImageSizeComboName())->setCommitCallback(boost::bind(&LLPanelSnapshot::onResolutionComboCommit, this, _1));
|
||||
|
|
@ -191,26 +193,30 @@ void LLPanelSnapshot::cancel()
|
|||
void LLPanelSnapshot::onCustomResolutionCommit()
|
||||
{
|
||||
LLSD info;
|
||||
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();
|
||||
}
|
||||
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>
|
||||
LLFloaterSnapshot::getInstance()->notify(LLSD().with("custom-res-change", info));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue