commit eed452077bdcc17975c715c4bc173dad8d637c29
Author: Enrico Forestieri <[email protected]>
Date:   Tue Apr 28 22:06:58 2015 +0200

    Preserve numbering of previewed math formulas on zoom
    
    The preview snippets are cached in a seemingly random order, such
    that, when regenerating them on zoom, the math previews would be
    numbered accordingly. Hence, we have to go through the insets to
    get the correct order. This is a bit slower but unavoidable.

diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp
index 6dfec9b..7d1cb54 100644
--- a/src/graphics/PreviewLoader.cpp
+++ b/src/graphics/PreviewLoader.cpp
@@ -417,12 +417,9 @@ PreviewLoader::Impl::preview(string const & latex_snippet) 
const
                font_scaling_factor_ = fs;
                Cache::const_iterator cit = cache_.begin();
                Cache::const_iterator cend = cache_.end();
-               while (cit != cend) {
-                       string const snippet = (cit++)->first;
-                       parent_.remove(snippet);
-                       parent_.add(snippet);
-               }
-               parent_.startLoading(false);
+               while (cit != cend)
+                       parent_.remove((cit++)->first);
+               buffer_.updatePreviews();
        }
        Cache::const_iterator it = cache_.find(latex_snippet);
        return (it == cache_.end()) ? 0 : it->second.get();

Reply via email to