From f4e6f5a90f92c804822bac1e3ba6da5163d03dcb Mon Sep 17 00:00:00 2001 From: Liny Date: Sun, 29 Jun 2014 18:56:34 -0700 Subject: [PATCH] Making the ledgend part of fast timers scrollable again after viewer-interesting merge --- indra/newview/llfasttimerview.cpp | 52 ++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index caecaef099..9643572c57 100755 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -94,6 +94,10 @@ LLFastTimerView::LLFastTimerView(const LLSD& key) mRecording(NUM_FRAMES_HISTORY) { mTimerBarRows.resize(NUM_FRAMES_HISTORY); + // Making the ledgend part of fast timers scrollable + mOverLegend = false; + mScrollOffset = 0; + // } LLFastTimerView::~LLFastTimerView() @@ -225,6 +229,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) } mHoverTimer = NULL; mHoverID = NULL; + mOverLegend = false; // Making the ledgend part of fast timers scrollable if(mPauseHistory && mBarRect.pointInRect(x, y)) { @@ -291,6 +296,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) { mHoverID = timer_id; } + mOverLegend = true; // Making the ledgend part of fast timers scrollable } return LLFloater::handleHover(x, y, mask); @@ -352,10 +358,36 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask) BOOL LLFastTimerView::handleScrollWheel(S32 x, S32 y, S32 clicks) { - setPauseState(true); - mScrollIndex = llclamp( mScrollIndex + clicks, - 0, - llmin((S32)mRecording.getNumRecordedPeriods(), (S32)mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY)); + //setPauseState(true); + //mScrollIndex = llclamp( mScrollIndex + clicks, + //0, + //llmin((S32)mRecording.getNumRecordedPeriods(), (S32)mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY)); + // Making the ledgend part of fast timers scrollable + if(mOverLegend) + { + mScrollOffset += clicks; + S32 count = 0; + for (block_timer_tree_df_iterator_t it = LLTrace::begin_block_timer_tree_df(FTM_FRAME); + it != block_timer_tree_df_iterator_t(); + ++it) + { + count++; + BlockTimerStatHandle* idp = (*it); + if (idp->getTreeNode().mCollapsed) + { + it.skipDescendants(); + } + } + mScrollOffset = llclamp(mScrollOffset,0,count-5); + } + else + { + setPauseState(true); + mScrollIndex = llclamp( mScrollIndex + clicks, + 0, + llmin((S32)mRecording.getNumRecordedPeriods(), (S32)mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY)); + } + // return TRUE; } @@ -1196,11 +1228,23 @@ void LLFastTimerView::drawLegend() S32 cur_line = 0; ft_display_idx.clear(); std::map display_line; + S32 mScrollOffset_tmp = mScrollOffset; // Making the ledgend part of fast timers scrollable for (block_timer_tree_df_iterator_t it = LLTrace::begin_block_timer_tree_df(FTM_FRAME); it != block_timer_tree_df_iterator_t(); ++it) { BlockTimerStatHandle* idp = (*it); + // Making the ledgend part of fast timers scrollable + if(mScrollOffset_tmp) + { + --mScrollOffset_tmp; + if (idp->getTreeNode().mCollapsed) + { + it.skipDescendants(); + } + continue; + } + // display_line[idp] = cur_line; ft_display_idx.push_back(idp); cur_line++;