Apply review fixes

- crates/metafile/src/canvas.rs
- crates/metafile/src/tests.rs
This commit is contained in:
autocraft-bot[bot]
2026-11-11 02:26:54 +00:00
parent 055e64c091
commit ddf5bbf2b9
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -684,7 +684,7 @@ impl Canvas {
// A pattern brush's pixels count against the byte budget like drawn items.
if let Obj::Brush(Brush { pattern: Some(p), .. }) = &obj {
let cost = p.px.len();
if self.used.saturating_add(cost) > MAX_BYTES {
if self.used.saturating_add(self.held).saturating_add(cost) > MAX_BYTES {
self.full = true;
return;
}
+2 -2
View File
@@ -899,10 +899,10 @@ fn place_fits_the_frame_scales_strokes_and_drops_far_paths() {
#[test]
fn place_counts_the_items_own_clip_region_before_keeping_it() {
// A path of 499,999 elements nearly fills the 500,000 budget; a second one whose new clip
// A path of 499,998 elements nearly fills the 500,000 budget; a second one whose new clip
// region adds elements goes past it and is left out.
let mut segs = vec![Seg::Move(0.0, 0.0)];
segs.extend((0..499_998).map(|i| Seg::Line(1.0 + (i % 50) as f32, 1.0)));
segs.extend((0..499_997).map(|i| Seg::Line(1.0 + (i % 50) as f32, 1.0)));
let big = Item::Path { segs, fill: None, stroke: None, even_odd: false, region: None };
let small = Item::Path {
segs: vec![Seg::Move(0.0, 0.0), Seg::Line(1.0, 1.0)],