diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-08-11 21:27:52 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-08-11 21:28:05 +0300 |
commit | 777e896ee4035c61d312563810c507b2bb5382be (patch) | |
tree | 07ba364aabbd61b12b1565691250638ae606694d /indra | |
parent | 3239f3518b835fcc9d709e0ced312e4e82a05118 (diff) |
DRTVWR-482 Use proper reshape procedure and fix hidden borders
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 39 | ||||
-rw-r--r-- | indra/newview/llfloatermodelpreview.h | 1 |
2 files changed, 22 insertions, 18 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index ff024e1d44..ae9350867f 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -280,6 +280,24 @@ BOOL LLFloaterModelPreview::postBuild() } //----------------------------------------------------------------------------- +// reshape() +//----------------------------------------------------------------------------- + +void LLFloaterModelPreview::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + LLFloaterModelUploadBase::reshape(width, height, called_from_parent); + + LLView* preview_panel = getChild<LLView>("preview_panel"); + LLRect rect = preview_panel->getRect(); + + if (rect != mPreviewRect) + { + mModelPreview->refresh(); + mPreviewRect = preview_panel->getRect(); + } +} + +//----------------------------------------------------------------------------- // LLFloaterModelPreview() //----------------------------------------------------------------------------- LLFloaterModelPreview::~LLFloaterModelPreview() @@ -692,29 +710,14 @@ void LLFloaterModelPreview::draw3dPreview() gGL.getTexUnit(0)->bind(mModelPreview); - - LLView* preview_panel = getChild<LLView>("preview_panel"); - - if (!preview_panel) - { - LL_WARNS() << "preview_panel not found in floater definition" << LL_ENDL; - } - LLRect rect = preview_panel->getRect(); - - if (rect != mPreviewRect) - { - mModelPreview->refresh(); - mPreviewRect = preview_panel->getRect(); - } - gGL.begin( LLRender::QUADS ); { gGL.texCoord2f(0.f, 1.f); - gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mTop-1); + gGL.vertex2i(mPreviewRect.mLeft+1, mPreviewRect.mTop-1); gGL.texCoord2f(0.f, 0.f); - gGL.vertex2i(mPreviewRect.mLeft, mPreviewRect.mBottom); + gGL.vertex2i(mPreviewRect.mLeft+1, mPreviewRect.mBottom+1); gGL.texCoord2f(1.f, 0.f); - gGL.vertex2i(mPreviewRect.mRight-1, mPreviewRect.mBottom); + gGL.vertex2i(mPreviewRect.mRight-1, mPreviewRect.mBottom+1); gGL.texCoord2f(1.f, 1.f); gGL.vertex2i(mPreviewRect.mRight-1, mPreviewRect.mTop-1); } diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index bee64fb501..8a01b0c307 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -70,6 +70,7 @@ public: virtual ~LLFloaterModelPreview(); virtual BOOL postBuild(); + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); void initModelPreview(); |