diff --git a/src/apps/debuganalyzer/gui/chart/Chart.cpp b/src/apps/debuganalyzer/gui/chart/Chart.cpp index 1a66539232..a100965785 100644 --- a/src/apps/debuganalyzer/gui/chart/Chart.cpp +++ b/src/apps/debuganalyzer/gui/chart/Chart.cpp @@ -65,6 +65,7 @@ Chart::Chart(ChartRenderer* renderer, const char* name) fVScrollSize(0), fHScrollValue(0), fVScrollValue(0), + fIgnoreScrollEvent(0), fDomainZoomLimit(0), fLastMousePos(-1, -1), fDraggingStartPos(-1, -1) @@ -407,6 +408,9 @@ printf("Chart::Draw((%f, %f) - (%f, %f))\n", updateRect.left, updateRect.top, up void Chart::ScrollTo(BPoint where) { + if (fIgnoreScrollEvent > 0) + return; + _ScrollTo(where.x, true); _ScrollTo(where.y, false); } @@ -531,8 +535,9 @@ Chart::_UpdateScrollBar(bool horizontal) } if (scrollBar != NULL) { + fIgnoreScrollEvent++; scrollBar->SetRange(0, scrollSize); -// TODO: If the scroll range changes, we might need to reset the scroll value. + fIgnoreScrollEvent--; scrollBar->SetValue(scrollValue); scrollBar->SetProportion(proportion); } diff --git a/src/apps/debuganalyzer/gui/chart/Chart.h b/src/apps/debuganalyzer/gui/chart/Chart.h index d4d10665c2..b2cc114dda 100644 --- a/src/apps/debuganalyzer/gui/chart/Chart.h +++ b/src/apps/debuganalyzer/gui/chart/Chart.h @@ -107,6 +107,7 @@ private: float fVScrollSize; float fHScrollValue; float fVScrollValue; + int32 fIgnoreScrollEvent; double fDomainZoomLimit; BPoint fLastMousePos; BPoint fDraggingStartPos;