From 39018947081772bf7226d757c647520c54b18fd2 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Wed, 23 Apr 2008 01:04:01 +0000 Subject: QAR-488 Viewer 1.20 RC 2 merge Branch_1-20-Viewer -r 84760 : 85100 -> release --- indra/newview/llviewerwindow.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'indra/newview/llviewerwindow.cpp') 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); -- cgit v1.2.3