Prepare document snapshots before legacy saves

This commit is contained in:
2026-06-05 18:14:50 +02:00
parent f4f6eb903e
commit 9a75782891
9 changed files with 134 additions and 14 deletions

View File

@@ -5994,6 +5994,7 @@ int plan_canvas_document_snapshot(int argc, char** argv)
const auto& value = result.value();
const auto& document = value.document;
const auto& active_layer = document.layers()[document.active_layer_index()];
const auto save_report = pp::app::make_document_canvas_save_snapshot_report(value);
std::cout << "{\"ok\":true,\"command\":\"plan-canvas-document-snapshot\""
<< ",\"state\":{\"hasCanvas\":" << json_bool(args.has_canvas)
<< ",\"width\":" << args.width
@@ -6018,6 +6019,9 @@ int plan_canvas_document_snapshot(int argc, char** argv)
<< ",\"requiresRendererPayloadReadback\":"
<< json_bool(value.requires_renderer_payload_readback)
<< ",\"documentFacePayloads\":" << document.face_pixel_payload_count()
<< ",\"saveReport\":{\"payloadComplete\":" << json_bool(save_report.payload_complete)
<< ",\"canExportPpi\":" << json_bool(save_report.can_export_ppi)
<< "}"
<< "}}\n";
return 0;
}