aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpreviewtexture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llpreviewtexture.cpp')
-rw-r--r--linden/indra/newview/llpreviewtexture.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/linden/indra/newview/llpreviewtexture.cpp b/linden/indra/newview/llpreviewtexture.cpp
index d309d4a..b054db5 100644
--- a/linden/indra/newview/llpreviewtexture.cpp
+++ b/linden/indra/newview/llpreviewtexture.cpp
@@ -199,7 +199,7 @@ void LLPreviewTexture::draw()
199 199
200 LLPreview::draw(); 200 LLPreview::draw();
201 201
202 if (!mMinimized) 202 if (!isMinimized())
203 { 203 {
204 LLGLSUIDefault gls_ui; 204 LLGLSUIDefault gls_ui;
205 LLGLSNoTexture gls_notex; 205 LLGLSNoTexture gls_notex;
@@ -214,7 +214,6 @@ void LLPreviewTexture::draw()
214 214
215 if ( mImage.notNull() ) 215 if ( mImage.notNull() )
216 { 216 {
217 LLGLSTexture gls_no_texture;
218 // Draw the texture 217 // Draw the texture
219 glColor3f( 1.f, 1.f, 1.f ); 218 glColor3f( 1.f, 1.f, 1.f );
220 gl_draw_scaled_image(interior.mLeft, 219 gl_draw_scaled_image(interior.mLeft,
@@ -255,7 +254,7 @@ void LLPreviewTexture::draw()
255 const S32 BAR_HEIGHT = 12; 254 const S32 BAR_HEIGHT = 12;
256 const S32 BAR_LEFT_PAD = 80; 255 const S32 BAR_LEFT_PAD = 80;
257 S32 left = interior.mLeft + 4 + BAR_LEFT_PAD; 256 S32 left = interior.mLeft + 4 + BAR_LEFT_PAD;
258 S32 bar_width = mRect.getWidth() - left - RESIZE_HANDLE_WIDTH - 2; 257 S32 bar_width = getRect().getWidth() - left - RESIZE_HANDLE_WIDTH - 2;
259 S32 top = interior.mBottom + 4 + BAR_HEIGHT; 258 S32 top = interior.mBottom + 4 + BAR_HEIGHT;
260 S32 right = left + bar_width; 259 S32 right = left + bar_width;
261 S32 bottom = top - BAR_HEIGHT; 260 S32 bottom = top - BAR_HEIGHT;
@@ -434,8 +433,8 @@ void LLPreviewTexture::updateAspectRatio()
434 mLastWidth = client_width; 433 mLastWidth = client_width;
435 mLastHeight = client_height; 434 mLastHeight = client_height;
436 435
437 S32 old_top = mRect.mTop; 436 S32 old_top = getRect().mTop;
438 S32 old_left = mRect.mLeft; 437 S32 old_left = getRect().mLeft;
439 if (getHost()) 438 if (getHost())
440 { 439 {
441 getHost()->growToFit(view_width, view_height); 440 getHost()->growToFit(view_width, view_height);
@@ -443,7 +442,7 @@ void LLPreviewTexture::updateAspectRatio()
443 else 442 else
444 { 443 {
445 reshape( view_width, view_height ); 444 reshape( view_width, view_height );
446 S32 new_bottom = old_top - mRect.getHeight(); 445 S32 new_bottom = old_top - getRect().getHeight();
447 setOrigin( old_left, new_bottom ); 446 setOrigin( old_left, new_bottom );
448 // Try to keep whole view onscreen, don't allow partial offscreen. 447 // Try to keep whole view onscreen, don't allow partial offscreen.
449 gFloaterView->adjustToFitScreen(this, FALSE); 448 gFloaterView->adjustToFitScreen(this, FALSE);
@@ -454,20 +453,20 @@ void LLPreviewTexture::updateAspectRatio()
454 if (!mUserResized) 453 if (!mUserResized)
455 { 454 {
456 // clamp texture size to fit within actual size of floater after attempting resize 455 // clamp texture size to fit within actual size of floater after attempting resize
457 client_width = llmin(client_width, mRect.getWidth() - horiz_pad); 456 client_width = llmin(client_width, getRect().getWidth() - horiz_pad);
458 client_height = llmin(client_height, mRect.getHeight() - PREVIEW_HEADER_SIZE 457 client_height = llmin(client_height, getRect().getHeight() - PREVIEW_HEADER_SIZE
459 - (2 * CLIENT_RECT_VPAD) - LLPANEL_BORDER_WIDTH - info_height); 458 - (2 * CLIENT_RECT_VPAD) - LLPANEL_BORDER_WIDTH - info_height);
460 459
461 460
462 } 461 }
463 else 462 else
464 { 463 {
465 client_width = mRect.getWidth() - horiz_pad; 464 client_width = getRect().getWidth() - horiz_pad;
466 client_height = llround(client_width * inv_aspect_ratio); 465 client_height = llround(client_width * inv_aspect_ratio);
467 } 466 }
468 467
469 468
470 S32 max_height = mRect.getHeight() - PREVIEW_BORDER - button_height 469 S32 max_height = getRect().getHeight() - PREVIEW_BORDER - button_height
471 - CLIENT_RECT_VPAD - info_height - CLIENT_RECT_VPAD - PREVIEW_HEADER_SIZE; 470 - CLIENT_RECT_VPAD - info_height - CLIENT_RECT_VPAD - PREVIEW_HEADER_SIZE;
472 max_height = llmax(max_height, 1); 471 max_height = llmax(max_height, 1);
473 472
@@ -478,7 +477,7 @@ void LLPreviewTexture::updateAspectRatio()
478 client_width = llround(client_height * aspect_ratio); 477 client_width = llround(client_height * aspect_ratio);
479 } 478 }
480 479
481 LLRect window_rect(0, mRect.getHeight(), mRect.getWidth(), 0); 480 LLRect window_rect(0, getRect().getHeight(), getRect().getWidth(), 0);
482 window_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD); 481 window_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD);
483 window_rect.mBottom += PREVIEW_BORDER + button_height + CLIENT_RECT_VPAD + info_height + CLIENT_RECT_VPAD; 482 window_rect.mBottom += PREVIEW_BORDER + button_height + CLIENT_RECT_VPAD + info_height + CLIENT_RECT_VPAD;
484 483