forked from qt-creator/qt-creator
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 <joerg.bornemann@theqtcompany.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user