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

Generated
+3 -3
View File
@@ -88,7 +88,7 @@ checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618"
[[package]]
name = "acadrust"
version = "0.5.5"
source = "git+https://github.com/ramox81/cadcodec.git?rev=d290dbe#d290dbe1712666d83dfd0fc63341ee3246f8de76"
source = "git+https://github.com/HakanSeven12/cadcodec.git?rev=d290dbe#d290dbe1712666d83dfd0fc63341ee3246f8de76"
dependencies = [
"ahash 0.8.12",
"anyhow",
@@ -924,7 +924,7 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
[[package]]
name = "cadkernel"
version = "0.1.0"
source = "git+https://github.com/HakanSeven12/cadkernel.git?rev=6eae7c9#6eae7c97fb29a21a818164af7c009f93e3ffe5b8"
source = "git+https://github.com/HakanSeven12/cadkernel.git?rev=4134ae3#4134ae386153a76998c2fbf03e81a5c4a23928cc"
dependencies = [
"acadrust",
"cavalier_contours",
@@ -935,7 +935,7 @@ dependencies = [
[[package]]
name = "cadkernel-constraints"
version = "0.1.0"
source = "git+https://github.com/HakanSeven12/cadkernel.git?rev=6eae7c9#6eae7c97fb29a21a818164af7c009f93e3ffe5b8"
source = "git+https://github.com/HakanSeven12/cadkernel.git?rev=4134ae3#4134ae386153a76998c2fbf03e81a5c4a23928cc"
dependencies = [
"nalgebra",
]
+3 -6
View File
@@ -33,9 +33,9 @@ rfd = "0.17"
clap = { version = "4", features = ["derive", "string"] }
env_logger = "0.11"
log = "0.4"
acadrust = { git = "https://github.com/ramox81/cadcodec.git", rev = "d290dbe", features = ["serde"] }
cadkernel = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "6eae7c9", features = ["acis", "offset"] }
cadkernel-constraints = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "6eae7c9" }
acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "d290dbe", features = ["serde"] }
cadkernel = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "4134ae3", features = ["acis", "offset"] }
cadkernel-constraints = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "4134ae3" }
dwg-thumbnailer = { path = "crates/dwg-thumbnailer" }
flate2 = "1"
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "bmp", "tiff"] }
@@ -81,9 +81,6 @@ objc2-app-kit = { version = "0.2", features = ["NSApplication", "NSResponder", "
block2 = "0.5"
objc2-foundation = { version = "0.2", features = ["NSArray", "NSURL", "NSString", "NSObject", "NSNotification", "NSThread", "NSEnumerator"] }
[patch."https://github.com/HakanSeven12/cadcodec.git"]
acadrust = { git = "https://github.com/ramox81/cadcodec.git", rev = "d290dbe" }
[patch.crates-io]
iced_core = { git = "https://github.com/iced-rs/iced.git", rev = "23604ff22ab0aad9e00b9327cb7b8546ed84db39" }
iced_widget = { git = "https://github.com/iced-rs/iced.git", rev = "23604ff22ab0aad9e00b9327cb7b8546ed84db39" }
+2 -2
View File
@@ -15,7 +15,7 @@ serde_json = { version = "1", optional = true }
# Pulled in only by the `host` feature, which adds the `acadrust`-typed
# `HostApi` runtime surface. The default crate stays dependency-free so engine
# crates and external tooling can depend on the manifest/ribbon contract cheaply.
acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "dd1d7bf", optional = true, features = ["serde"] }
acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "d290dbe", optional = true, features = ["serde"] }
# Runtime IPC and serialization (host feature only).
interprocess = { version = "2", optional = true }
@@ -39,7 +39,7 @@ serde_json = "1"
serde = { version = "1", features = ["derive"] }
cargo-lock = "11"
# acadrust is scanned at build time to generate the embedded type registry.
acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "dd1d7bf", features = ["serde"] }
acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "d290dbe", features = ["serde"] }
[dev-dependencies]
serde_json = "1"
+1 -1
View File
@@ -8,7 +8,7 @@ publish = false
crate-type = ["cdylib"]
[dependencies]
acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "dd1d7bf", features = ["serde"] }
acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "d290dbe", features = ["serde"] }
bincode = "1.3"
serde = { version = "1", features = ["derive"] }
console_error_panic_hook = "0.1"
+2 -2
View File
@@ -7,8 +7,8 @@ reloading it, and comparing entity fields.
**Status (23 September 2026):** the fixes landed in cadcodec as
[#48](https://github.com/HakanSeven12/cadcodec/pull/48) (issues 1-6) and
[#51](https://github.com/HakanSeven12/cadcodec/pull/51) (the first three style findings), and
the block description with commit `dd1d7bf` (cadcodec issue #49). OCS pins `dd1d7bf`, and the
canaries below were flipped against it. What is still open:
the block description with commit `dd1d7bf` (cadcodec issue #49). OCS pins `d290dbe`, which
includes it; the canaries below were flipped against `dd1d7bf`. What is still open:
- **ATTDEF `lock_position`** (issue 1): the reader is complete, but the DXF writer emits no
group 280 at all, neither the version byte nor the lock flag the reader expects after it.
+3 -3
View File
@@ -3520,7 +3520,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE حدد نقطة الإدراج:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3529,8 +3529,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3507,7 +3507,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE Посочи точка на вмъкване:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3516,8 +3516,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3505,7 +3505,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE Zadejte bod vložení:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3514,8 +3514,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3508,7 +3508,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE Einführstelle angeben:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3517,8 +3517,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3508,7 +3508,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE Ορίστε σημείο εισαγωγής:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3517,8 +3517,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3509,7 +3509,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE Specify insertion point:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3518,8 +3518,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3508,7 +3508,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE Especifique el punto de inserción:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3517,8 +3517,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3507,7 +3507,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE Määritä lisäyskohta:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3516,8 +3516,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3508,7 +3508,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE Spécifier le point d'insertion:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3517,8 +3517,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3496,7 +3496,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE निर्दिष्ट सम्मिलन बिंदु:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3505,8 +3505,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3507,7 +3507,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE Beszúrási pont megadása:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3516,8 +3516,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3507,7 +3507,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE Specificare il punto di inserimento:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3516,8 +3516,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3498,7 +3498,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE 挿入点を指定:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3507,8 +3507,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3507,7 +3507,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE 삽입점 지정:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3516,8 +3516,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3506,7 +3506,7 @@ annotate =
.dimradius-select-arc-circle-or-polyline-arc = DIMRADIUS Selecteer een boog, cirkel of polylijnboog:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3515,8 +3515,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3507,7 +3507,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE Określ punkt wstawienia:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3516,8 +3516,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3508,7 +3508,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE Especifique o ponto de inserção:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3517,8 +3517,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3509,7 +3509,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE Укажите точку вставки:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3518,8 +3518,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3495,7 +3495,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE 指定插入点:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3504,8 +3504,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+3 -3
View File
@@ -3507,7 +3507,7 @@ annotate =
.tolerance-specify-insertion-point = TOLERANCE 指定插入點:
insert =
.pdfui-pdf-scale = PDF scale: {scale}:1
.pdfui-pdf-scale = PDF scale: __ocs_fmt_0__:1
.pdfui-specify-insertion-point = Specify insertion point:
.pdfui-no-pdf-underlays = No PDF underlays found.
.pdfui-imports-the-geometry-fills-raster-images-and-text-of-a-pdf-f = Imports the geometry, fills, raster images and text of a PDF file as drawing objects.
@@ -3516,8 +3516,8 @@ insert =
.pdfui-rotation = Rotation:
.pdfui-scale = Scale:
.pdfui-specify-insertion-point-on-screen = Specify insertion point on-screen
.pdfui-page-size-size = Page size: {size}
.pdfui-total-count = Total: {count}
.pdfui-page-size-size = Page size: __ocs_fmt_0__
.pdfui-total-count = Total: __ocs_fmt_0__
.pdfui-page = Page:
.pdfui-page-to-import = Page to import
.pdfui-infer-linetypes-from-collinear-dashes = Infer linetypes from collinear dashes
+1 -1
View File
@@ -5,7 +5,7 @@ version = 4
[[package]]
name = "acadrust"
version = "0.5.5"
source = "git+https://github.com/HakanSeven12/cadcodec.git?rev=dd1d7bf#dd1d7bfe03f4e733d351c0396e2cf82ae9df957d"
source = "git+https://github.com/HakanSeven12/cadcodec.git?rev=d290dbe#d290dbe1712666d83dfd0fc63341ee3246f8de76"
dependencies = [
"ahash 0.8.12",
"anyhow",
+2 -4
View File
@@ -137,6 +137,8 @@ impl OpenCADStudio {
// Options opened from a PDF dialog returns to it.
if self.active_modal == Some(Options) {
if let Some(parent) = self.options_parent.take() {
self.options_saved = None;
self.options_close_confirm = false;
self.active_modal = Some(parent);
return;
}
@@ -1326,9 +1328,7 @@ impl OpenCADStudio {
),
Message::PdfAttachPickResult(Ok((path, bytes))) => {
let i = self.active_tab;
let path_str = path.to_string_lossy().into_owned();
let _ = i;
crate::scene::model::pdf_raster::register_source(&path_str, bytes);
// Pages, placement and path type are chosen in the Attach
// dialog; the definition is created with the underlay.
@@ -1355,9 +1355,7 @@ impl OpenCADStudio {
Message::PdfImportPickResult,
),
Message::PdfImportPickResult(Ok((path, bytes))) => {
let i = self.active_tab;
let path_str = path.to_string_lossy().into_owned();
let _ = i;
crate::scene::model::pdf_raster::register_source(&path_str, bytes);
self.open_pdf_import_file(&path_str);
Task::none()
+3 -3
View File
@@ -1556,13 +1556,13 @@ pub enum CmdResult {
BatchCopy(Vec<Handle>, Vec<EntityTransform>),
/// Erase `handle` and replace with new entities; command stays active.
ReplaceEntity(Handle, Vec<EntityType>),
/// Attach PDF pages: each page's underlay with its file (as stored) and
/// page; the host creates or reuses the definitions and commits them all
/// in one undo step, then ends the command.
/// Open the PDF Import Settings dialog; the command keeps its prompt.
OpenPdfImportSettings,
/// Import a page of a file (PDFIMPORT File); ends the command.
PdfImportFile(crate::modules::insert::pdf_import::PdfFileImport),
/// Attach PDF pages: each page's underlay with its file (as stored) and
/// page; the host creates or reuses the definitions and commits them all
/// in one undo step, then ends the command.
AttachPdfPages {
path: String,
pages: Vec<(String, EntityType)>,
+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))
}
}
+26 -22
View File
@@ -343,28 +343,7 @@ impl Scene {
None
};
// Auto-create an ImageDefinition object for new RasterImage entities
// that don't already reference one.
if let EntityType::RasterImage(ref mut img) = entity {
if img.definition_handle.is_none() {
use acadrust::objects::{ImageDefinition, ObjectType};
let def_handle = Handle::new(self.document.next_handle());
if self.is_recording_undo() {
self.record_undo_object_before(def_handle, None);
}
let mut img_def = ImageDefinition::with_dimensions(
&img.file_path,
img.size.x as u32,
img.size.y as u32,
);
img_def.handle = def_handle;
img_def.is_loaded = true;
self.document
.objects
.insert(def_handle, ObjectType::ImageDefinition(img_def));
img.definition_handle = Some(def_handle);
}
}
self.ensure_image_definition(&mut entity);
// Register the entity's layer if it names one no LAYER command created
// (e.g. a plugin-supplied layer) so it survives a DWG save instead of
@@ -1069,6 +1048,30 @@ impl Scene {
/// caller starts an interactive insert so paste-as-block can prompt for the
/// drop point. The geometry comes from the clipboard rather than live
/// entities, so there is nothing to stage or erase. (#129)
/// Give a new RasterImage the ImageDefinition object it must reference,
/// unless it already names one.
fn ensure_image_definition(&mut self, entity: &mut EntityType) {
let EntityType::RasterImage(img) = entity else {
return;
};
if img.definition_handle.is_some() {
return;
}
use acadrust::objects::{ImageDefinition, ObjectType};
let def_handle = Handle::new(self.document.next_handle());
if self.is_recording_undo() {
self.record_undo_object_before(def_handle, None);
}
let mut img_def =
ImageDefinition::with_dimensions(&img.file_path, img.size.x as u32, img.size.y as u32);
img_def.handle = def_handle;
img_def.is_loaded = true;
self.document
.objects
.insert(def_handle, ObjectType::ImageDefinition(img_def));
img.definition_handle = Some(def_handle);
}
pub fn define_block_from_owned_entities(
&mut self,
entities: Vec<EntityType>,
@@ -1125,6 +1128,7 @@ impl Scene {
Self::reset_clone_subhandles(&mut self.document, &mut entity);
entity.common_mut().handle = Handle::NULL;
entity.common_mut().owner_handle = br_handle;
self.ensure_image_definition(&mut entity);
let handle = self
.document
.add_entity(entity)
+1 -7
View File
@@ -1268,21 +1268,15 @@ fn build_derived_caches_impl(
EntityType::Ole2Frame(ole) => ImageModel::from_ole2frame(ole).map(|m| (handle, m)),
EntityType::Underlay(u) => match doc.objects.get(&u.definition_handle) {
Some(acadrust::objects::ObjectType::UnderlayDefinition(def)) => {
{
// Paper-space underlays adjust to the white sheet.
let model = doc.objects.values().find_map(|object| match object {
acadrust::objects::ObjectType::Layout(l) if l.name == "Model" => Some(l.block_record),
_ => None,
});
let owner = u.common.owner_handle;
let background = if owner.is_null() || model.is_none_or(|m| m == owner) {
let background = if owner.is_null() || owner == model_block {
LOAD_BG
} else {
[1.0, 1.0, 1.0, 1.0]
};
ImageModel::from_underlay(u, def, background).map(|m| (handle, m))
}
}
_ => None,
},
_ => None,
+18 -34
View File
@@ -4,8 +4,8 @@
use std::fmt;
use iced::widget::{
button, column, combo_box, container, image, pick_list, radio, row, scrollable, text,
text_input, Space,
button, column, combo_box, container, image, pick_list, row, scrollable, text, text_input,
Space,
};
use iced::{Background, Border, Element, Fill, Length, Theme};
@@ -14,7 +14,7 @@ use crate::io::xref_model::Pathtype;
use crate::modules::insert::pdf_import::{ImportLayers, PdfImportSettings};
use crate::t;
use crate::ui::style::common::muted_style;
use crate::ui::style::form::{button_style, field_style};
use crate::ui::style::form::{button_style, dialog_button, field_style, form_radio};
use crate::ui::window::block_definition::{group, labeled_checkbox};
/// One edit in any of the PDF dialogs.
@@ -260,18 +260,9 @@ fn read_only<'a>(label: String, value: &'a str, label_width: f32) -> Element<'a,
fn footer<'a>(ok: PdfDialogMsg, help: &'static str) -> iced::widget::Row<'a, Message> {
row![
Space::new().width(Fill),
button(text(t!("OK")).size(11))
.on_press(msg(ok))
.style(button_style(true))
.padding([4, 16]),
button(text(t!("Cancel")).size(11))
.on_press(Message::CloseModal)
.style(button_style(false))
.padding([4, 12]),
button(text(t!("Help")).size(11))
.on_press(msg(PdfDialogMsg::Help(help)))
.style(button_style(false))
.padding([4, 12]),
dialog_button(t!("OK"), msg(ok), true),
dialog_button(t!("Cancel"), Message::CloseModal, false),
dialog_button(t!("Help"), msg(PdfDialogMsg::Help(help)), false),
]
.spacing(6)
.align_y(iced::Center)
@@ -513,10 +504,11 @@ pub fn view_attach<'a>(
} else {
t!("Show Details")
};
let footer = row![button(text(details_label).size(11))
.on_press(msg(PdfDialogMsg::AttachDetails(!state.details)))
.style(button_style(false))
.padding([4, 12])]
let footer = row![dialog_button(
details_label,
msg(PdfDialogMsg::AttachDetails(!state.details)),
false
)]
.push(footer(PdfDialogMsg::AttachOk, "attach"))
.align_y(iced::Center);
@@ -582,13 +574,10 @@ pub fn view_layers<'a>(
.filter(|name| needle.is_empty() || name.to_lowercase().contains(&needle))
.map(|name| {
let on = !t.hidden.contains(name);
let bulb = button(text("●").size(12).style(move |theme: &Theme| text::Style {
color: Some(if on {
theme.palette().warning.base.color
} else {
theme.palette().background.strong.color
}),
}))
let bulb = button(crate::ui::icons::semantic(
crate::ui::icons::layer_visible(on),
14.0,
))
.on_press(msg(PdfDialogMsg::LayersToggle(name.clone())))
.padding([0, 4])
.style(|_: &Theme, _| button::Style::default());
@@ -649,9 +638,7 @@ fn settings_groups<'a>(s: &'a PdfImportSettings) -> (Element<'a, Message>, Eleme
Length::Fill,
);
let layer_radio = |label: std::borrow::Cow<'static, str>, value: ImportLayers| {
radio(label, value, Some(s.layers), |v| msg(PdfDialogMsg::Layers(v)))
.size(14)
.text_size(11)
form_radio(label, value, Some(s.layers), |v| msg(PdfDialogMsg::Layers(v)))
};
let layers = group(
t!("Layers").into_owned(),
@@ -827,11 +814,8 @@ pub fn view_import_file<'a>(
.width(Length::FillPortion(1));
let body = row![container(page_group).width(Length::FillPortion(1)), right].spacing(8);
let footer = row![button(text(t!("Options...")).size(11))
.on_press(msg(PdfDialogMsg::Options))
.style(button_style(false))
.padding([4, 12])]
.push(footer(PdfDialogMsg::ImportOk, "import"))
let footer = row![dialog_button(t!("Options..."), msg(PdfDialogMsg::Options), false)]
.push(footer(PdfDialogMsg::ImportOk, "import"))
.align_y(iced::Center);
column![file_row, body, footer]