diff options
author | Ulf Hermann <[email protected]> | 2015-05-18 13:07:30 +0200 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2015-05-18 12:35:21 +0000 |
commit | 84ae26e8086a6ee6a74c5763b808a5fb17f34f19 (patch) | |
tree | cb725bc3869774d491847ab5fd17375a38e34520 | |
parent | 2ce83b5193e1e103c17fb8a1676d608872354c27 (diff) |
Timeline: If range moves out of window, completely rebuild the window
The previous code miraculously moved window and range to the right
places, but went through a series of invalid states in between.
Change-Id: Id6b1fd6d615d7900beda914a0415720a57d464b5
Reviewed-by: Joerg Bornemann <[email protected]>
-rw-r--r-- | src/libs/timeline/timelinezoomcontrol.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs/timeline/timelinezoomcontrol.cpp b/src/libs/timeline/timelinezoomcontrol.cpp index 7e087c60908..6833c227628 100644 --- a/src/libs/timeline/timelinezoomcontrol.cpp +++ b/src/libs/timeline/timelinezoomcontrol.cpp @@ -100,7 +100,8 @@ void TimelineZoomControl::rebuildWindow() m_windowStart = m_traceStart; m_windowEnd = m_traceEnd; } else if (windowDuration() / shownDuration > MAX_ZOOM_FACTOR || - windowDuration() / shownDuration * 2 < MAX_ZOOM_FACTOR) { + windowDuration() / shownDuration * 2 < MAX_ZOOM_FACTOR || + m_rangeStart < m_windowStart || m_rangeEnd > m_windowEnd) { qint64 keep = shownDuration * MAX_ZOOM_FACTOR / 2 - shownDuration; m_windowStart = m_rangeStart - keep; if (m_windowStart < m_traceStart) { |