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.
This commit is contained in:
Enrico Forestieri 2015-06-21 17:21:19 +02:00
parent 2973108a62
commit 592219c1f1

View File

@ -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)