forked from 1b-agent/opencadstudio-upstream
PDF underlays: attach prompts and definitions, display adjustments and clipping, Properties, snapping, PDFCLIP and PDFIMPORT
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cc9d5edbff
commit
0c50013ca7
50 files changed
+2770
-325
No files matched your search
+21
-1
@@ -673,6 +673,25 @@ impl Scene {
|
||||
/// or drop them all if the handle is now absent. Mirrors the reseed block in
|
||||
/// [`Scene::update_entity`]; used by delta-undo when it re-applies an
|
||||
/// entity's before / after image so the fills and meshes follow.
|
||||
/// Rebuild every underlay's raster and wire, after a setting they draw
|
||||
/// or snap by (PDFOSNAP / UOSNAP) changed.
|
||||
pub(crate) fn reseed_underlays(&mut self) {
|
||||
let handles: Vec<Handle> = self
|
||||
.document
|
||||
.entities()
|
||||
.filter(|entity| matches!(entity, EntityType::Underlay(_)))
|
||||
.map(|entity| entity.common().handle)
|
||||
.collect();
|
||||
for handle in &handles {
|
||||
self.reseed_derived_caches(*handle);
|
||||
}
|
||||
let changes: Vec<_> = handles
|
||||
.iter()
|
||||
.map(|handle| (*handle, crate::scene::ChangeKind::Modified))
|
||||
.collect();
|
||||
self.bump_entities(&changes);
|
||||
}
|
||||
|
||||
pub(crate) fn reseed_derived_caches(&mut self, handle: Handle) {
|
||||
let (hatch_seed, image_seed) = match self.document.get_entity(handle) {
|
||||
None => (None, None),
|
||||
@@ -2387,9 +2406,10 @@ impl Scene {
|
||||
match entity {
|
||||
EntityType::RasterImage(img) => ImageModel::from_raster_image(img),
|
||||
EntityType::Ole2Frame(ole) => ImageModel::from_ole2frame(ole),
|
||||
EntityType::Underlay(u) if self.unloaded_underlay_definitions.contains(&u.definition_handle) => None,
|
||||
EntityType::Underlay(u) => match self.document.objects.get(&u.definition_handle) {
|
||||
Some(acadrust::objects::ObjectType::UnderlayDefinition(def)) => {
|
||||
ImageModel::from_underlay(u, def)
|
||||
ImageModel::from_underlay(u, def, self.bg_color)
|
||||
}
|
||||
_ => None,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user