diff options
author | Richard Linden <none@none> | 2012-03-01 13:23:01 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2012-03-01 13:23:01 -0800 |
commit | 6b0f0a89fd6a8285f91c13699327182f513efbd5 (patch) | |
tree | 9a080cf7a8727808d99a1d4eaaeca117c312fbc7 /indra/llui | |
parent | 66f101bac591d82b71ab7dc976b6fed0ed451909 (diff) |
CHUI-55 FIX Floaters that have set positions from old viewer versions can appear off screen until user repositions the floaters manually
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llfloater.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index f49b4edb98..d058b4ae44 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -884,22 +884,24 @@ bool LLFloater::applyRectControl() } } - if (!mPosXControl.empty() && !mPosYControl.empty()) - { - LLControlVariablePtr x_control = getControlGroup()->getControl(mPosXControl); - LLControlVariablePtr y_control = getControlGroup()->getControl(mPosYControl); - if (x_control.notNull() - && y_control.notNull() - && !x_control->isDefault() - && !y_control->isDefault()) - { - mPosition.mX = x_control->getValue().asReal(); - mPosition.mY = y_control->getValue().asReal(); - mPositioning = LLFloaterEnums::POSITIONING_RELATIVE; - applyRelativePosition(); + LLControlVariablePtr x_control = getControlGroup()->getControl(mPosXControl); + LLControlVariablePtr y_control = getControlGroup()->getControl(mPosYControl); + if (x_control.notNull() + && y_control.notNull() + && !x_control->isDefault() + && !y_control->isDefault()) + { + mPosition.mX = x_control->getValue().asReal(); + mPosition.mY = y_control->getValue().asReal(); + mPositioning = LLFloaterEnums::POSITIONING_RELATIVE; + applyRelativePosition(); - saved_rect = true; - } + saved_rect = true; + } + else + { + LLRect screen_rect = calcScreenRect(); + mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert(); } } @@ -929,7 +931,6 @@ void LLFloater::applyPositioning(LLFloater* other, bool on_open) break; case LLFloaterEnums::POSITIONING_SPECIFIED: - //translateIntoRect(gFloaterView->getSnapRect()); break; case LLFloaterEnums::POSITIONING_CASCADE_GROUP: @@ -955,7 +956,6 @@ void LLFloater::applyPositioning(LLFloater* other, bool on_open) translate(snap_rect.mLeft, snap_rect.mBottom); } - //mPositioning = LLFloaterEnums::POSITIONING_SPECIFIED; setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); } break; |