Replacing placed pictures from a host without losing how they fit their frame.
set_manifest_data() can replace pictures and keep their fit. A new value for its second
argument, 'refit', keeps an image set to Scale to fit or Scale to fill in that mode, recomputed
for the new picture, and gives an image the user sized by hand Scale to fill. The new picture
always keeps its own proportions, and an alignment the user chose stays. A third argument,
'Scale_to_Fit', gives images sized by hand Scale to fit instead:
await doc.set_manifest_data(manifest, 'refit');
await doc.set_manifest_data(manifest, 'refit', 'Scale_to_Fit');
set_manifest_url(url, replace, preserve_geometry, refit_scale) takes the same values.
Before, false turned every replaced picture into Scale to fit, also one set to Scale to fill,
and true drew a new picture with other proportions stretched into an image the user had sized
by hand. true (the default) and false behave as before.
refit_scale is an argument, never a key in the manifest: the manifest's shape belongs to the
document schema, which refuses a key it does not know.
PageElementImage.set_asset() (canvas src/page.ts) takes
'refit' and a refit_scale; set_manifest_data(), set_manifest_url() and
refresh_image_asset() (src/typograph_document.ts) pass them on, to grouped images too. Like
true, 'refit' leaves an image that already shows the same web_url alone. See canvas
docs/HostContract.md, "Replacing placed pictures".set_manifest_data() with false or 'refit'; this is for hosts.'refit' in the editor integration guide; it merges once this release is
live.