PDF import and export: rustfmt

This commit is contained in:
bflatastic
2026-10-24 04:49:07 +07:00
parent 4b8e69981e
commit 2e71ab5476
2 changed files with 9 additions and 2 deletions
+4 -1
View File
@@ -154,7 +154,10 @@ pub(crate) fn warnings(set: &PdfSettings) -> Vec<String> {
out.push(format!("{} encryption covers the metadata too: plaintext metadata needs PDF 1.5 or later", set.compatibility.label()));
}
if s.protected() && set.compatibility == Compatibility::Pdf13 {
out.push(format!("{} encrypts with a 40-bit key, which can be searched in minutes: choose PDF 1.6 or later for stronger protection", set.compatibility.label()));
out.push(format!(
"{} encrypts with a 40-bit key, which can be searched in minutes: choose PDF 1.6 or later for stronger protection",
set.compatibility.label()
));
}
out
}
+5 -1
View File
@@ -987,7 +987,11 @@ fn stroke_layer(paint: Paint, opacity: f32, p: &StrokeProps, scale: f64) -> Stro
};
st.miter_limit = p.miter_limit as f64;
// (Every stroke keeps its own copy: a dash array has a few entries, and one with thousands is cut.)
let dash = Dash { pattern: p.dash_array.iter().take(MAX_DASH_ENTRIES).map(|v| *v as f64 * scale).collect(), offset: p.dash_offset as f64 * scale, align_corners: false };
let dash = Dash {
pattern: p.dash_array.iter().take(MAX_DASH_ENTRIES).map(|v| *v as f64 * scale).collect(),
offset: p.dash_offset as f64 * scale,
align_corners: false,
};
// An invalid dash array (a negative value, or all zeros) strokes solid.
st.dash = dash.is_dashed().then_some(dash);
st