commit 592219c1f1c5f27d3bb3274906fc932c4983ee3a
Author: Enrico Forestieri <for...@lyx.org>
Date:   Sun Jun 21 17:21:19 2015 +0200

    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.

diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp
index 7a96976..c3055dc 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)

Reply via email to