From 592219c1f1c5f27d3bb3274906fc932c4983ee3a Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Sun, 21 Jun 2015 17:21:19 +0200 Subject: [PATCH] Properly reschedule refresh of previews If the zoom factor is changed right while the previews are being regenerated, the refreshPreviews() method is a no-op. So, reschedule the refresh until everything is ready. --- src/graphics/PreviewLoader.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index 7a969763fb..c3055dc61e 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -450,6 +450,11 @@ PreviewLoader::Impl::preview(string const & latex_snippet) const void PreviewLoader::Impl::refreshPreviews() { font_scaling_factor_ = int(buffer_.fontScalingFactor()); + // Reschedule refresh until the previous process completed. + if (!finished_generating_) { + delay_refresh_->start(1000); + return; + } Cache::const_iterator cit = cache_.begin(); Cache::const_iterator cend = cache_.end(); while (cit != cend)