Regenerate previews after zoom (#11919)

This commit is contained in:
Juergen Spitzmueller 2022-11-20 18:18:59 +01:00
parent 3917cab408
commit e26a60edef
6 changed files with 25 additions and 0 deletions

View File

@ -4253,6 +4253,13 @@ void Buffer::updateTitles() const
}
void Buffer::scheduleRedrawWorkAreas() const
{
if (d->wa_)
d->wa_->scheduleRedraw();
}
void Buffer::resetAutosaveTimers() const
{
if (d->gui_)

View File

@ -666,6 +666,8 @@ public:
void setBusy(bool on) const;
/// Update window titles of all users.
void updateTitles() const;
/// Schedule redraw of work areas
void scheduleRedrawWorkAreas() const;
/// Reset autosave timers for all users.
void resetAutosaveTimers() const;
///

View File

@ -62,6 +62,13 @@ void WorkAreaManager::updateTitles()
}
void WorkAreaManager::scheduleRedraw()
{
for (WorkArea * wa : work_areas_)
wa->scheduleRedraw(true);
}
} // namespace frontend
} // namespace lyx

View File

@ -44,6 +44,8 @@ public:
/// Update window titles of all users and the external modifications
/// warning.
void updateTitles();
/// Schedule redraw of work areas
void scheduleRedraw();
/// If there is no work area, create a new one in the current view using the
/// buffer buf. Returns false if not possible.
bool unhide(Buffer * buf) const;

View File

@ -69,6 +69,8 @@
#include "Toolbars.h"
#include "version.h"
#include "graphics/PreviewLoader.h"
#include "support/convert.h"
#include "support/debug.h"
#include "support/ExceptionMessage.h"
@ -4891,6 +4893,10 @@ void GuiView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
lyxrc.currentZoom, lyxrc.defaultZoom));
guiApp->fontLoader().update();
// Regenerate instant previews
if (lyxrc.preview != LyXRC::PREVIEW_OFF
&& doc_buffer && doc_buffer->loader())
doc_buffer->loader()->refreshPreviews();
dr.screenUpdate(Update::ForceAll | Update::FitCursor);
break;
}

View File

@ -799,6 +799,7 @@ void PreviewLoader::Impl::finishedGenerating(pid_t pid, int retval)
imageReady(*nit->get());
}
finished_generating_ = true;
buffer_.scheduleRedrawWorkAreas();
}