Attach Underlay ribbon menu, DWF/DGN attach dialog, DGN true colours

- Insert > Reference: the PDF Attach button becomes an Attach Underlay menu
  (PDF / DWF / DGN); its face runs the last one chosen.
- DWFATTACH, DGNATTACH and ATTACH on a .dwf/.dwfx/.dgn open the Attach
  dialog for that kind: sheets or models with thumbnails (one chosen),
  placement, path type, file details with the sheet / model size, and for
  DGN the conversion units (sub units offer 1 / sub units per master as the
  scale).
- DGN V8 true colours come from the ExtendedColors record packed in the
  non-model attributes stream; the colour word's high part numbers them.
- A DGN model's extent includes each text's box (its length along the
  baseline and 1.5 x its height), as the reference sizes a model.
- DWFx text uses the family named in its embedded (deobfuscated) font.
- DWF contrast pivots at 0.73 once colours are turned over for a dark
  background.
- Hairline strokes are drawn solid one pixel wide, and underlay rasters are
  made at or below their size on screen so those lines stay unbroken.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ramox81andClaude Opus 5.5 committed 2026-09-28 17:08:06 +03:00
1 parent fecbcd8138
commit 5b6cbff5b2
33 files changed
+745 -59

No files matched your search

+19 -2
View File
@@ -402,8 +402,25 @@ impl OpenCADStudio {
} else {
codec::entities::UnderlayType::Dwf
};
let i = self.active_tab;
self.start_underlay_attach(i, kind, &path.to_string_lossy());
let path = path.to_string_lossy().into_owned();
match std::fs::read(&path) {
Ok(bytes) => {
crate::scene::model::pdf_raster::register_source(&path, std::sync::Arc::new(bytes));
crate::scene::model::underlay_vector::forget(&path);
if crate::scene::model::underlay_vector::item_names(kind, &path).is_some_and(|n| !n.is_empty()) {
self.open_underlay_attach_dialog(kind, &path);
} else {
self.command_line.push_error(&format!(
"{} not found.",
crate::entities::underlay::display_path(&path)
));
}
}
Err(_) => self.command_line.push_error(&format!(
"{} not found.",
crate::entities::underlay::display_path(&path)
)),
}
Task::none()
}
"png" | "jpg" | "jpeg" | "bmp" | "tif" | "tiff" => {