Fix progress bar applying filters (fix #2152)

Regression introduced in 4264f199cdf398659fd90db4c572f42c47fd5988
This commit is contained in:
David Capello 2019-09-24 15:57:26 -03:00
parent ccb9dc6f25
commit 1659401642

View File

@ -1990,9 +1990,10 @@ void Editor::onPaint(ui::PaintEvent& ev)
// Editor with sprite // Editor with sprite
else { else {
try { try {
// Lock the sprite to read/render it. We wait 1/4 secs in case // Lock the sprite to read/render it. Here we don't wait if the
// the background thread is making a backup. // document is locked (e.g. a filter is being applied to the
DocReader documentReader(m_document, 250); // sprite) to avoid locking the UI.
DocReader documentReader(m_document, 0);
// Draw the sprite in the editor // Draw the sprite in the editor
renderChrono.reset(); renderChrono.reset();
@ -2030,8 +2031,9 @@ void Editor::onPaint(ui::PaintEvent& ev)
} }
} }
catch (const LockedDocException&) { catch (const LockedDocException&) {
// The sprite is locked to be read, so we can draw an opaque // The sprite is locked, so we cannot render it, we can draw an
// background only. // opaque background now, and defer the rendering of the sprite
// for later.
g->fillRect(theme->colors.editorFace(), rc); g->fillRect(theme->colors.editorFace(), rc);
defer_invalid_rect(g->getClipBounds().offset(bounds().origin())); defer_invalid_rect(g->getClipBounds().offset(bounds().origin()));
} }