fix: align white paper fill with entity borders
- paper_entity_extents() computes the bounding box of actual DXF entities so the white fill always matches the drawn title-block / frame borders, regardless of whether Layout min/max_limits match entity positions - Falls back to paper_limits() (→ A4 297×210) when layout has no entities - Removed paper_boundary_wire: the white fill now acts as the visual paper edge so the near-white wire (invisible on white) was redundant - LayoutCreate sets limits to A4 landscape immediately after add_layout() to override acadrust's imperial default (12×9) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0a291c877b
commit
f63858876d
3 changed files with 50 additions and 37 deletions
|
|
@ -2268,6 +2268,18 @@ impl H7CAD {
|
|||
self.push_undo_snapshot(i, "LAYOUT");
|
||||
match self.tabs[i].scene.document.add_layout(&new_name) {
|
||||
Ok(_) => {
|
||||
// Override the acadrust default limits (12×9 imperial) with A4 landscape.
|
||||
for obj in self.tabs[i].scene.document.objects.values_mut() {
|
||||
if let acadrust::objects::ObjectType::Layout(l) = obj {
|
||||
if l.name == new_name {
|
||||
l.min_limits = (0.0, 0.0);
|
||||
l.max_limits = (297.0, 210.0);
|
||||
l.min_extents = (0.0, 0.0, 0.0);
|
||||
l.max_extents = (297.0, 210.0, 0.0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
self.tabs[i].scene.current_layout = new_name.clone();
|
||||
self.tabs[i].scene.deselect_all();
|
||||
self.tabs[i].scene.fit_all();
|
||||
|
|
|
|||
Loading…
Reference in a new issue