diff options
author | Jacek Antonelli | 2008-08-15 23:45:58 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:58 -0500 |
commit | ff5503706786f0365d8c63d41a0e5a4a6ca7c81a (patch) | |
tree | 48941045bbd4eb09337e02f0263a5918f35a1ae5 /linden/indra/newview/llfloatersnapshot.cpp | |
parent | Second Life viewer sources 1.20.11 (diff) | |
download | meta-impy-ff5503706786f0365d8c63d41a0e5a4a6ca7c81a.zip meta-impy-ff5503706786f0365d8c63d41a0e5a4a6ca7c81a.tar.gz meta-impy-ff5503706786f0365d8c63d41a0e5a4a6ca7c81a.tar.bz2 meta-impy-ff5503706786f0365d8c63d41a0e5a4a6ca7c81a.tar.xz |
Second Life viewer sources 1.20.12
Diffstat (limited to 'linden/indra/newview/llfloatersnapshot.cpp')
-rw-r--r-- | linden/indra/newview/llfloatersnapshot.cpp | 83 |
1 files changed, 42 insertions, 41 deletions
diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp index f3ad4a7..857b3fa 100644 --- a/linden/indra/newview/llfloatersnapshot.cpp +++ b/linden/indra/newview/llfloatersnapshot.cpp | |||
@@ -1475,11 +1475,11 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde | |||
1475 | { | 1475 | { |
1476 | LLSnapshotLivePreview *previewp = getPreviewView(view) ; | 1476 | LLSnapshotLivePreview *previewp = getPreviewView(view) ; |
1477 | 1477 | ||
1478 | if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE == getTypeIndex(view)) | 1478 | //if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE == getTypeIndex(view)) |
1479 | { | 1479 | //{ |
1480 | previewp->mKeepAspectRatio = FALSE ; | 1480 | // previewp->mKeepAspectRatio = FALSE ; |
1481 | return ; | 1481 | // return ; |
1482 | } | 1482 | //} |
1483 | 1483 | ||
1484 | if(!index) //current window size | 1484 | if(!index) //current window size |
1485 | { | 1485 | { |
@@ -1494,7 +1494,7 @@ void LLFloaterSnapshot::Impl::checkAspectRatio(LLFloaterSnapshot *view, S32 inde | |||
1494 | else if(-1 == index) //custom | 1494 | else if(-1 == index) //custom |
1495 | { | 1495 | { |
1496 | sAspectRatioCheckOff = FALSE ; | 1496 | sAspectRatioCheckOff = FALSE ; |
1497 | if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE != gSavedSettings.getS32("LastSnapshotType")) | 1497 | //if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE != gSavedSettings.getS32("LastSnapshotType")) |
1498 | { | 1498 | { |
1499 | view->childSetEnabled("keep_aspect_check", TRUE) ; | 1499 | view->childSetEnabled("keep_aspect_check", TRUE) ; |
1500 | 1500 | ||
@@ -1631,22 +1631,23 @@ BOOL LLFloaterSnapshot::Impl::checkImageSize(LLSnapshotLivePreview* previewp, S3 | |||
1631 | S32 h = height ; | 1631 | S32 h = height ; |
1632 | 1632 | ||
1633 | //if texture, ignore aspect ratio setting, round image size to power of 2. | 1633 | //if texture, ignore aspect ratio setting, round image size to power of 2. |
1634 | if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE == gSavedSettings.getS32("LastSnapshotType")) | 1634 | //if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE == gSavedSettings.getS32("LastSnapshotType")) |
1635 | { | 1635 | //{ |
1636 | if(width > max_value) | 1636 | // if(width > max_value) |
1637 | { | 1637 | // { |
1638 | width = max_value ; | 1638 | // width = max_value ; |
1639 | } | 1639 | // } |
1640 | if(height > max_value) | 1640 | // if(height > max_value) |
1641 | { | 1641 | // { |
1642 | height = max_value ; | 1642 | // height = max_value ; |
1643 | } | 1643 | // } |
1644 | 1644 | ||
1645 | //round to nearest power of 2 | 1645 | // //round to nearest power of 2 |
1646 | width = get_nearest_power_two(width, MAX_TEXTURE_SIZE) ; | 1646 | // width = get_nearest_power_two(width, MAX_TEXTURE_SIZE) ; |
1647 | height = get_nearest_power_two(height, MAX_TEXTURE_SIZE) ; | 1647 | // height = get_nearest_power_two(height, MAX_TEXTURE_SIZE) ; |
1648 | } | 1648 | //} |
1649 | else if(previewp && previewp->mKeepAspectRatio) | 1649 | //else |
1650 | if(previewp && previewp->mKeepAspectRatio) | ||
1650 | { | 1651 | { |
1651 | if(gViewerWindow->getWindowDisplayWidth() < 1 || gViewerWindow->getWindowDisplayHeight() < 1) | 1652 | if(gViewerWindow->getWindowDisplayWidth() < 1 || gViewerWindow->getWindowDisplayHeight() < 1) |
1652 | { | 1653 | { |
@@ -1729,25 +1730,25 @@ void LLFloaterSnapshot::Impl::onCommitCustomResolution(LLUICtrl *ctrl, void* dat | |||
1729 | { | 1730 | { |
1730 | BOOL update_ = FALSE ; | 1731 | BOOL update_ = FALSE ; |
1731 | //if to upload a snapshot, process spinner input in a special way. | 1732 | //if to upload a snapshot, process spinner input in a special way. |
1732 | if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE == gSavedSettings.getS32("LastSnapshotType")) | 1733 | //if(LLSnapshotLivePreview::SNAPSHOT_TEXTURE == gSavedSettings.getS32("LastSnapshotType")) |
1733 | { | 1734 | //{ |
1734 | S32 spinner_increment = (S32)((LLSpinCtrl*)ctrl)->getIncrement() ; | 1735 | // S32 spinner_increment = (S32)((LLSpinCtrl*)ctrl)->getIncrement() ; |
1735 | S32 dw = w - curw ; | 1736 | // S32 dw = w - curw ; |
1736 | S32 dh = h - curh ; | 1737 | // S32 dh = h - curh ; |
1737 | dw = (dw == spinner_increment) ? 1 : ((dw == -spinner_increment) ? -1 : 0) ; | 1738 | // dw = (dw == spinner_increment) ? 1 : ((dw == -spinner_increment) ? -1 : 0) ; |
1738 | dh = (dh == spinner_increment) ? 1 : ((dh == -spinner_increment) ? -1 : 0) ; | 1739 | // dh = (dh == spinner_increment) ? 1 : ((dh == -spinner_increment) ? -1 : 0) ; |
1739 | 1740 | ||
1740 | if(dw) | 1741 | // if(dw) |
1741 | { | 1742 | // { |
1742 | w = (dw > 0) ? curw << dw : curw >> -dw ; | 1743 | // w = (dw > 0) ? curw << dw : curw >> -dw ; |
1743 | update_ = TRUE ; | 1744 | // update_ = TRUE ; |
1744 | } | 1745 | // } |
1745 | if(dh) | 1746 | // if(dh) |
1746 | { | 1747 | // { |
1747 | h = (dh > 0) ? curh << dh : curh >> -dh ; | 1748 | // h = (dh > 0) ? curh << dh : curh >> -dh ; |
1748 | update_ = TRUE ; | 1749 | // update_ = TRUE ; |
1749 | } | 1750 | // } |
1750 | } | 1751 | //} |
1751 | 1752 | ||
1752 | previewp->setMaxImageSize((S32)((LLSpinCtrl *)ctrl)->getMaxValue()) ; | 1753 | previewp->setMaxImageSize((S32)((LLSpinCtrl *)ctrl)->getMaxValue()) ; |
1753 | if(checkImageSize(previewp, w, h, w != curw, previewp->getMaxImageSize()) || update_) | 1754 | if(checkImageSize(previewp, w, h, w != curw, previewp->getMaxImageSize()) || update_) |