diff options
author | Jacek Antonelli | 2008-12-12 23:24:52 -0600 |
---|---|---|
committer | Jacek Antonelli | 2008-12-12 23:25:00 -0600 |
commit | d1345838c6e36c35dbe3a6b683eb8ffe274b024a (patch) | |
tree | 5e727fcabbd5cf0337c11192bfe4db6191c7b044 /linden/indra/newview/llfloatersnapshot.cpp | |
parent | Second Life viewer sources 1.22.2-RC (diff) | |
download | meta-impy-d1345838c6e36c35dbe3a6b683eb8ffe274b024a.zip meta-impy-d1345838c6e36c35dbe3a6b683eb8ffe274b024a.tar.gz meta-impy-d1345838c6e36c35dbe3a6b683eb8ffe274b024a.tar.bz2 meta-impy-d1345838c6e36c35dbe3a6b683eb8ffe274b024a.tar.xz |
Second Life viewer sources 1.22.3-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloatersnapshot.cpp | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp index afa0785..61ae4c2 100644 --- a/linden/indra/newview/llfloatersnapshot.cpp +++ b/linden/indra/newview/llfloatersnapshot.cpp | |||
@@ -899,6 +899,13 @@ void LLSnapshotLivePreview::getSize(S32& w, S32& h) const | |||
899 | 899 | ||
900 | LLFloaterPostcard* LLSnapshotLivePreview::savePostcard() | 900 | LLFloaterPostcard* LLSnapshotLivePreview::savePostcard() |
901 | { | 901 | { |
902 | if(mViewerImage[mCurImageIndex].isNull()) | ||
903 | { | ||
904 | //this should never happen!! | ||
905 | llwarns << "The snapshot image has not been generated!" << llendl ; | ||
906 | return NULL ; | ||
907 | } | ||
908 | |||
902 | // calculate and pass in image scale in case image data only use portion | 909 | // calculate and pass in image scale in case image data only use portion |
903 | // of viewerimage buffer | 910 | // of viewerimage buffer |
904 | LLVector2 image_scale(1.f, 1.f); | 911 | LLVector2 image_scale(1.f, 1.f); |
@@ -1636,6 +1643,9 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL | |||
1636 | LLSnapshotLivePreview* previewp = getPreviewView(view); | 1643 | LLSnapshotLivePreview* previewp = getPreviewView(view); |
1637 | if (previewp && combobox->getCurrentIndex() >= 0) | 1644 | if (previewp && combobox->getCurrentIndex() >= 0) |
1638 | { | 1645 | { |
1646 | S32 original_width = 0 , original_height = 0 ; | ||
1647 | previewp->getSize(original_width, original_height) ; | ||
1648 | |||
1639 | if (width == 0 || height == 0) | 1649 | if (width == 0 || height == 0) |
1640 | { | 1650 | { |
1641 | // take resolution from current window size | 1651 | // take resolution from current window size |
@@ -1660,19 +1670,24 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL | |||
1660 | { | 1670 | { |
1661 | resetSnapshotSizeOnUI(view, width, height) ; | 1671 | resetSnapshotSizeOnUI(view, width, height) ; |
1662 | } | 1672 | } |
1663 | previewp->setSize(width, height); | 1673 | |
1664 | |||
1665 | if(view->childGetValue("snapshot_width").asInteger() != width || view->childGetValue("snapshot_height").asInteger() != height) | 1674 | if(view->childGetValue("snapshot_width").asInteger() != width || view->childGetValue("snapshot_height").asInteger() != height) |
1666 | { | 1675 | { |
1667 | view->childSetValue("snapshot_width", width); | 1676 | view->childSetValue("snapshot_width", width); |
1668 | view->childSetValue("snapshot_height", height); | 1677 | view->childSetValue("snapshot_height", height); |
1669 | // hide old preview as the aspect ratio could be wrong | 1678 | } |
1670 | checkAutoSnapshot(previewp, FALSE); | 1679 | |
1680 | if(original_width != width || original_height != height) | ||
1681 | { | ||
1682 | previewp->setSize(width, height); | ||
1683 | |||
1684 | // hide old preview as the aspect ratio could be wrong | ||
1685 | checkAutoSnapshot(previewp, FALSE); | ||
1671 | getPreviewView(view)->updateSnapshot(FALSE, TRUE); | 1686 | getPreviewView(view)->updateSnapshot(FALSE, TRUE); |
1672 | if(do_update) | 1687 | if(do_update) |
1673 | { | 1688 | { |
1674 | updateControls(view); | 1689 | updateControls(view); |
1675 | } | 1690 | } |
1676 | } | 1691 | } |
1677 | } | 1692 | } |
1678 | } | 1693 | } |