13.19g: a raster commit's continuation runs where the commit ends, as Swift's await returns; nothing lands between

This commit is contained in:
ZacharyZhang-NY committed 2026-10-03 22:54:20 -04:00
1 parent 28f6337d13
commit 8bd3fc3264
5 files changed
+184 -10

No files matched your search

+4 -7
View File
@@ -300,14 +300,10 @@ void EditorSession::commitPaintSnapshot(const BrushStroke &stroke)
// A raster edit assembled off the UI thread; one step.
void EditorSession::commitRasterEdit(std::shared_ptr<const BrushStroke> stroke, const QString &name, std::function<void()> alsoApply, std::function<void()> done)
{
// The caller resumes from the event loop, like await.
const auto finish = [this, done] {
if (done)
QMetaObject::invokeMethod(this, done, Qt::QueuedConnection);
};
if (!stroke->committedTransform().isValid()) {
setBrushError(QString::fromUtf8(ProjectError(ProjectError::Kind::tooLarge).what()));
finish();
if (done)
done();
return;
}
setIsProjectBusy(true);
@@ -331,8 +327,9 @@ void EditorSession::finishRasterCommit()
setIsProjectBusy(false);
++m_brushRevision;
notify();
// Swift's caller resumes in the same job, nothing between.
if (pending.done)
QMetaObject::invokeMethod(this, pending.done, Qt::QueuedConnection);
pending.done();
};
if (made.failure) {
setBrushError(made.failure);