diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index d13679899..44139e811 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -2645,6 +2645,12 @@ BOOL LLFloaterSnapshot::postBuild() return TRUE; } +LLRect LLFloaterSnapshot::getThumbnailAreaRect() +{ + // getRect() includes shadows and the title bar, therefore the real corners are as follows: + return LLRect(1, getRect().getHeight() - 17, getRect().getWidth() - 1, getRect().getHeight() - 17 - THUMBHEIGHT); +} + void LLFloaterSnapshot::draw() { LLSnapshotLivePreview* previewp = impl.getPreviewView(this); @@ -2661,17 +2667,13 @@ void LLFloaterSnapshot::draw() { if(previewp->getThumbnailImage()) { - // getRect() includes shadows and the title bar, therefore the real corners are as follows: - S32 const left = 1; - S32 const right = getRect().getWidth() - 1; - S32 const top = getRect().getHeight() - 17; - S32 const bottom = top - THUMBHEIGHT; + LLRect const thumb_area = getThumbnailAreaRect(); // The offset needed to center the thumbnail is: center - thumbnailSize/2 = - S32 offset_x = (left + right - previewp->getThumbnailWidth()) / 2; - S32 offset_y = (bottom + top - previewp->getThumbnailHeight()) / 2; + S32 offset_x = (thumb_area.mLeft + thumb_area.mRight - previewp->getThumbnailWidth()) / 2; + S32 offset_y = (thumb_area.mBottom + thumb_area.mTop - previewp->getThumbnailHeight()) / 2; gGL.matrixMode(LLRender::MM_MODELVIEW); - gl_rect_2d(left, top, right, bottom, LLColor4::grey4, true); + gl_rect_2d(thumb_area, LLColor4::grey4, true); gl_draw_scaled_image(offset_x, offset_y, previewp->getThumbnailWidth(), previewp->getThumbnailHeight(), previewp->getThumbnailImage(), LLColor4::white); @@ -2776,6 +2778,34 @@ BOOL LLFloaterSnapshot::handleKeyHere(KEY key, MASK mask) return LLFloater::handleKeyHere(key, mask); } +BOOL LLFloaterSnapshot::handleMouseDown(S32 x, S32 y, MASK mask) +{ + if (mask == MASK_NONE) + { + LLRect thumb_area = getThumbnailAreaRect(); + if (thumb_area.pointInRect(x, y)) + { + return TRUE; + } + } + return LLFloater::handleMouseDown(x, y, mask); +} + +BOOL LLFloaterSnapshot::handleMouseUp(S32 x, S32 y, MASK mask) +{ + if (mask == MASK_NONE) + { + // In FreezeTime mode, show preview again (after user pressed ESC) when + // clicking on the thumbnail area. + LLRect thumb_area = getThumbnailAreaRect(); + if (thumb_area.pointInRect(x, y)) + { + impl.updateControls(this); + return TRUE; + } + } + return LLFloater::handleMouseUp(x, y, mask); +} ///---------------------------------------------------------------------------- /// Class LLSnapshotFloaterView diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h index 68821e895..2ca66c1cd 100644 --- a/indra/newview/llfloatersnapshot.h +++ b/indra/newview/llfloatersnapshot.h @@ -54,11 +54,15 @@ public: LLFloaterSnapshot(); virtual ~LLFloaterSnapshot(); + LLRect getThumbnailAreaRect(); + /*virtual*/ BOOL postBuild(); /*virtual*/ void draw(); /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void onOpen(); /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); static void show(void*); static void hide(void*); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 12a4c8e80..b78fdf983 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2878,7 +2878,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) if (mFreezeTimeHidden) { - return TRUE; + return; } checkTextureLoading() ; diff --git a/indra/newview/skins/default/xui/en-us/floater_snapshot.xml b/indra/newview/skins/default/xui/en-us/floater_snapshot.xml index 54496858d..91d3de89e 100644 --- a/indra/newview/skins/default/xui/en-us/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en-us/floater_snapshot.xml @@ -1,6 +1,6 @@ File size: [SIZE] KB