From 3c423061f6dc186c200535b975cdf4a9d0488e7c Mon Sep 17 00:00:00 2001 From: Le Tan Date: Wed, 22 Aug 2018 20:08:58 +0800 Subject: [PATCH] LivePreview: update live preview when using old cache --- src/vlivepreviewhelper.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/vlivepreviewhelper.cpp b/src/vlivepreviewhelper.cpp index bdf4908a..a72bb996 100644 --- a/src/vlivepreviewhelper.cpp +++ b/src/vlivepreviewhelper.cpp @@ -169,9 +169,16 @@ void VLivePreviewHelper::updateCodeBlocks(TimeStamp p_timeStamp, const QVector &entry = it.value(); + // If this cache is not used at the last timestamp, we still need to + // update the live preview. + if (entry->m_ts < m_timeStamp - 1) { + oldCache = true; + } + entry->m_ts = m_timeStamp; cached = true; m_codeBlocks[idx].setImageData(entry->m_imgFormat, entry->m_imgData); @@ -193,7 +200,7 @@ void VLivePreviewHelper::updateCodeBlocks(TimeStamp p_timeStamp, const QVector= cursorBlock) { - if (lastIndex == idx && cached) { + if (lastIndex == idx && cached && !oldCache) { needUpdate = false; }