mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
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.
This commit is contained in:
parent
558451a51d
commit
eed452077b
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user