summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2008-04-23 01:04:01 +0000
committerSteven Bennetts <steve@lindenlab.com>2008-04-23 01:04:01 +0000
commit39018947081772bf7226d757c647520c54b18fd2 (patch)
tree74b00b3006878d7e576b84cb3240d98c22d67db9 /indra/newview/llviewerwindow.cpp
parentc01edec021194bacb86dc9a3f5a3cc655a8cb15f (diff)
QAR-488 Viewer 1.20 RC 2
merge Branch_1-20-Viewer -r 84760 : 85100 -> release
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index c6c751147c..a753032180 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4419,19 +4419,11 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
F32 scale_factor = 1.0f ;
if(!keep_window_aspect) //image cropping
- {
- //if(snapshot_width > image_width && snapshot_height > image_height) //crop
- //{
- // snapshot_width = image_width ;
- // snapshot_height = image_height ;
- //}
- //else //crop and enlarge
- {
- F32 ratio = llmin( (F32)window_width / image_width , (F32)window_height / image_height) ;
- snapshot_width = (S32)(ratio * image_width) ;
- snapshot_height = (S32)(ratio * image_height) ;
- scale_factor = llmax(1.0f, 1.0f / ratio) ;
- }
+ {
+ F32 ratio = llmin( (F32)window_width / image_width , (F32)window_height / image_height) ;
+ snapshot_width = (S32)(ratio * image_width) ;
+ snapshot_height = (S32)(ratio * image_height) ;
+ scale_factor = llmax(1.0f, 1.0f / ratio) ;
}
LLRenderTarget target;
@@ -4457,6 +4449,13 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
mWindowRect.set(0, 0, snapshot_width, snapshot_height);
target.bindTarget();
}
+ else //tiling
+ {
+ F32 ratio = llmin( (F32)window_width / image_width , (F32)window_height / image_height) ;
+ snapshot_width = (S32)(ratio * image_width) ;
+ snapshot_height = (S32)(ratio * image_height) ;
+ scale_factor = llmax(1.0f, 1.0f / ratio) ;
+ }
}
S32 buffer_x_offset = llfloor(((window_width - snapshot_width) * scale_factor) / 2.f);