fix(pdf): follow-ups to the PDF underlay merge

- Pin cadcodec upstream at d290dbe (the merged underlay change) and
  cadkernel at 4134ae3, which follows it; drop the fork patch, move the
  plugin-API and web-worker crates and the Python plugin lock to the same
  codec so one copy is built.
- "Import as block" with raster images left IMAGE entities without an
  image definition: block definition now creates it like add_entity does,
  through one shared helper.
- The three preview outlines (attach frame, clip boundary, import area)
  stay f64 instead of casting world points to f32.
- Page size / total / PDF scale entries use the catalog's positional
  placeholder; the bare {name} form failed to format in 20 locales.
- The Underlay Layers bulb is the SVG layer icon, not a text glyph.
- PDF dialogs use the shared dialog buttons and radios.
- Options opened from a PDF dialog clears its saved state on return.
- Paper-space underlay background reuses the model block handle already
  resolved; dead `let _ = i` lines and a misplaced doc comment removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-09-24 23:24:51 +03:00
1 parent 2e60c4da1b
commit d5016c7044
34 files changed
+129 -156

No files matched your search

+3 -6
View File
@@ -329,15 +329,12 @@ impl PdfAttachCommand {
}
}
fn frame_at(&self, pt: DVec3) -> Vec<[f32; 3]> {
fn frame_at(&self, pt: DVec3) -> Vec<[f64; 3]> {
let (w, h) = (self.page_size.0 * self.scale, self.page_size.1 * self.scale);
let x = self.plane.vector_to_world(DVec3::new(w, 0.0, 0.0));
let y = self.plane.vector_to_world(DVec3::new(0.0, h, 0.0));
let corners = [pt, pt + x, pt + x + y, pt + y, pt];
corners
.iter()
.map(|p| [p.x as f32, p.y as f32, p.z as f32])
.collect()
corners.iter().map(|p| p.to_array()).collect()
}
}
@@ -434,7 +431,7 @@ impl CadCommand for PdfAttachCommand {
if self.step != Step::Insertion || self.page_size.0 <= 0.0 {
return None;
}
Some(WireModel::solid(
Some(WireModel::solid_f64(
"pdf_attach_frame".into(),
self.frame_at(pt),
WireModel::CYAN,
+2 -2
View File
@@ -336,9 +336,9 @@ impl CadCommand for PdfClipCommand {
}
_ => return None,
};
let mut points: Vec<[f32; 3]> = ring.iter().map(|p| [p.x as f32, p.y as f32, p.z as f32]).collect();
let mut points: Vec<[f64; 3]> = ring.iter().map(|p| p.to_array()).collect();
points.push(points[0]);
Some(WireModel::solid("pdf_clip_boundary".into(), points, WireModel::CYAN, false))
Some(WireModel::solid_f64("pdf_clip_boundary".into(), points, WireModel::CYAN, false))
}
}
+2 -3
View File
@@ -414,10 +414,9 @@ impl CadCommand for PdfImportCommand {
}
_ => return None,
};
let mut points: Vec<[f32; 3]> =
ring.iter().map(|p| [p.x as f32, p.y as f32, p.z as f32]).collect();
let mut points: Vec<[f64; 3]> = ring.iter().map(|p| p.to_array()).collect();
points.push(points[0]);
Some(WireModel::solid("pdf_import_area".into(), points, WireModel::CYAN, false))
Some(WireModel::solid_f64("pdf_import_area".into(), points, WireModel::CYAN, false))
}
}