Let resumed SVG drafts precede a new final-state fingerprint
This commit is contained in:
1 parent
1a2379a6c2
commit
58b0f16998
9 files changed
+519
-84
No files matched your search
@@ -5,7 +5,7 @@
|
||||
//! used to infer an origin. Source IDs are local to this revision, including
|
||||
//! independent opens of the same input stream.
|
||||
use crate::{
|
||||
execution::{GeneratedInput, RevisionExecution, SourceVersion, Span, TokenOrigin},
|
||||
execution::{Execution, GeneratedInput, RevisionExecution, SourceVersion, Span, TokenOrigin},
|
||||
pdf_device::{Affine, PdfGraphics},
|
||||
provenance::PaintSource,
|
||||
render::{DisplayItem, DisplayList, DisplayUnits},
|
||||
@@ -227,14 +227,25 @@ impl SourceMap {
|
||||
pages: &[DisplayList],
|
||||
verify_source_hashes: bool,
|
||||
) -> Result<Self, String> {
|
||||
let execution = &revision.execution;
|
||||
if revision.source_versions.len() != execution.sources.len() {
|
||||
Self::from_execution_checked(
|
||||
revision.revision, &revision.execution, &revision.source_versions, pages, verify_source_hashes,
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn from_execution_checked<F>(
|
||||
revision: u64,
|
||||
execution: &Execution<F>,
|
||||
source_versions: &[SourceVersion],
|
||||
pages: &[DisplayList],
|
||||
verify_source_hashes: bool,
|
||||
) -> Result<Self, String> {
|
||||
if source_versions.len() != execution.sources.len() {
|
||||
return Err("source map version table does not match execution".into());
|
||||
}
|
||||
let sources: Vec<_> = execution
|
||||
.sources
|
||||
.iter()
|
||||
.zip(&revision.source_versions)
|
||||
.zip(source_versions)
|
||||
.enumerate()
|
||||
.map(|(id, (file, version))| {
|
||||
if version.bytes != file.data.len() as u64
|
||||
@@ -542,7 +553,7 @@ impl SourceMap {
|
||||
mapped_pages.push(map);
|
||||
}
|
||||
Ok(Self {
|
||||
revision: revision.revision,
|
||||
revision,
|
||||
sources,
|
||||
pages: mapped_pages,
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user