fix: use PlotSettings paper dimensions for correct paper-space rendering

paper_limits() now reads paper_width/paper_height/plot_rotation from the
Layout object (populated by a patched acadrust from the embedded DWG
PlotSettings). This fixes layouts where min/max_limits do not match the
physical paper size (e.g. A4 portrait content inside A3 landscape limits).

DXF files use codes 44/45/73 from raw_plot_settings_codes; DWG files use
the PlotSettings block embedded in the LAYOUT object. Both fall back to
min/max_limits when paper_width is zero.

Depends on HakanSeven12/acadrust feat/layout-paper-dimensions (PR #21 on
hakanaktt/acadrust); using that fork until the PR is merged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-05-01 08:04:35 +03:00
commit 3298ebff91
3 changed files with 33 additions and 14 deletions

3
Cargo.lock generated
View file

@ -41,8 +41,7 @@ checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618"
[[package]]
name = "acadrust"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2545729000aceb2c30e7002bdc26050532d5fa806bb6a6fef37175ebe6c8c5d2"
source = "git+https://github.com/HakanSeven12/acadrust.git?branch=feat%2Flayout-paper-dimensions#2eaa7aacce3c5de4d6f15a0474fd365db0da9fba"
dependencies = [
"ahash",
"anyhow",