diff options
author | Bryan O'Sullivan <bos@lindenlab.com> | 2009-09-14 14:31:25 -0700 |
---|---|---|
committer | Bryan O'Sullivan <bos@lindenlab.com> | 2009-09-14 14:31:25 -0700 |
commit | 562006aa5585a42418cae978516505035cd34d8d (patch) | |
tree | f42488d1b07907937f5b9e236617d9f02297d32d /indra/llui/lldockcontrol.cpp | |
parent | 9a8042d5a3edfd07727793a1939c3ab361ceec9a (diff) | |
parent | 7cd1020f2953b776e1878e7b4e365d4b23e6b07b (diff) |
Merge with SVN viewer-2.0.0-3 branch
Diffstat (limited to 'indra/llui/lldockcontrol.cpp')
-rw-r--r-- | indra/llui/lldockcontrol.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp index bec7f04cc0..d666f2be56 100644 --- a/indra/llui/lldockcontrol.cpp +++ b/indra/llui/lldockcontrol.cpp @@ -48,12 +48,25 @@ LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater, { off(); } + + if (dockWidget != NULL) { + repositionDockable(); + } } LLDockControl::~LLDockControl() { } +void LLDockControl::setDock(LLView* dockWidget) +{ + mDockWidget = dockWidget; + if (mDockWidget != NULL) + { + repositionDockable(); + } +} + void LLDockControl::repositionDockable() { if (mEnabled) @@ -65,11 +78,14 @@ void LLDockControl::repositionDockable() void LLDockControl::calculateDockablePosition() { LLRect dockRect = mDockWidget->calcScreenRect(); - if (mPrevDockRect != dockRect || mRecalculateDocablePosition) + LLRect rootRect = mDockableFloater->getRootView()->getRect(); + + // recalculate dockable position if dock position changed + // or root view rect changed or recalculation is forced + if (mPrevDockRect != dockRect || mRootRect != rootRect + || mRecalculateDocablePosition) { LLRect dockableRect = mDockableFloater->calcScreenRect(); - LLRect rootRect = mDockableFloater->getRootView()->getRect(); - S32 x = 0; S32 y = 0; switch (mDockAt) @@ -100,6 +116,7 @@ void LLDockControl::calculateDockablePosition() mDockableFloater->screenPointToLocal(mDockTongueX, mDockTongueY, &mDockTongueX, &mDockTongueY); mPrevDockRect = dockRect; + mRootRect = rootRect; mRecalculateDocablePosition = false; } } |