Merge main into fix/retype-remeasure-budget

This commit is contained in:
dotCooCoo committed 2026-11-20 05:43:18 -08:00
commit 869d645b3b
102 files changed
+4581 -815

No files matched your search

+15
View File
@@ -24,6 +24,21 @@ jobs:
# Same craft-fonts commit as release.yml.
craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
timeout-minutes: 90
# The gate's test binaries carry no debug info and no symbols (CARGO_PROFILE_TEST_DEBUG=0,
# CARGO_PROFILE_TEST_STRIP=symbols), as photocraft's do: linking ~100 test binaries with line
# tables ran the hosted runner out of resources, and it stopped mid-link with "received a
# shutdown signal" (exit 143). Panics still name file and line; local builds keep Cargo.toml's
# line tables.
dev-strip: true
# The workspace crates also build without line tables. A panic still names its file and line.
dev-debug: "0"
# Five legs instead of one: shards 1 to 4 each build and run the tests of their own crates,
# and shard 5 runs the other `cargo xtask ci` steps (xtask/src/shards.rs). `gate (<os>)`
# passes only when all five did. On pushes to main, a `cache warm` leg builds what every
# shard builds and saves the dependency cache.
test-shards: 5
shard-command: cargo xtask ci shard
warm-command: cargo xtask ci warm
packages: >-
pkg-config libxkbcommon-dev libwayland-dev libx11-dev libxcb1-dev libxcursor-dev
libxrandr-dev libxi-dev libfontconfig1-dev libfreetype-dev mesa-vulkan-drivers
+1
View File
@@ -155,6 +155,7 @@ Generated-in-code art is original and has no file to list. This covers the defau
| `assets/icons/dc-draw-inside.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-draw-normal.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-ellipse.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-fill-area.svg` | VectorCraft contributors | Original work, drawn for VectorCraft: three crossing lines with the triangle they enclose filled | MIT OR Apache-2.0 | |
| `assets/icons/dc-fill-none.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-filter.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-flare.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
Generated
+52 -40
View File
@@ -1001,7 +1001,7 @@ dependencies = [
[[package]]
name = "craft-affinity"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"crc32fast",
"flate2",
@@ -1012,7 +1012,7 @@ dependencies = [
[[package]]
name = "craft-cms"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"md-5",
"rayon",
@@ -1021,12 +1021,12 @@ dependencies = [
[[package]]
name = "craft-codepage"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
[[package]]
name = "craft-dds"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"rayon",
]
@@ -1034,12 +1034,12 @@ dependencies = [
[[package]]
name = "craft-docpath"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
[[package]]
name = "craft-dxf"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"craft-codepage",
"encoding_rs",
@@ -1051,7 +1051,12 @@ dependencies = [
[[package]]
name = "craft-eps"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec#cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec"
[[package]]
name = "craft-eps"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
[[package]]
name = "craft-font-catalog"
@@ -1070,12 +1075,12 @@ dependencies = [
[[package]]
name = "craft-fonts-build"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
[[package]]
name = "craft-gif"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"gif",
]
@@ -1083,7 +1088,7 @@ dependencies = [
[[package]]
name = "craft-gzip"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"flate2",
]
@@ -1091,7 +1096,7 @@ dependencies = [
[[package]]
name = "craft-i18n"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"fixed_decimal",
"icu_decimal",
@@ -1114,7 +1119,7 @@ dependencies = [
[[package]]
name = "craft-image-codecs"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"craft-dds",
"craft-jpeg",
@@ -1141,7 +1146,7 @@ dependencies = [
[[package]]
name = "craft-jpeg"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"thiserror 2.0.21",
]
@@ -1149,7 +1154,7 @@ dependencies = [
[[package]]
name = "craft-jxl"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"brotli-decompressor 5.0.3",
"jixel",
@@ -1160,7 +1165,7 @@ dependencies = [
[[package]]
name = "craft-keymap"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"egui",
"serde",
@@ -1170,7 +1175,7 @@ dependencies = [
[[package]]
name = "craft-metadata"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"brotli-decompressor 6.3.2",
"chrono",
@@ -1182,7 +1187,7 @@ dependencies = [
[[package]]
name = "craft-metafile"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"encoding_rs",
"image",
@@ -1193,7 +1198,7 @@ dependencies = [
[[package]]
name = "craft-mime"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"chrono",
"craft-codepage",
@@ -1203,7 +1208,7 @@ dependencies = [
[[package]]
name = "craft-pdf"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"hayro-interpret",
"hayro-syntax",
@@ -1214,7 +1219,7 @@ dependencies = [
[[package]]
name = "craft-plotter"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"kurbo 0.13.1",
"thiserror 2.0.21",
@@ -1223,7 +1228,7 @@ dependencies = [
[[package]]
name = "craft-print"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"craft-winprint-gdi",
"log",
@@ -1237,7 +1242,7 @@ dependencies = [
[[package]]
name = "craft-proof"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"log",
"miniz_oxide 0.9.1",
@@ -1248,16 +1253,21 @@ dependencies = [
[[package]]
name = "craft-ps"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec#cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec"
dependencies = [
"craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec)",
"flate2",
"kurbo 0.13.1",
"miniz_oxide 0.8.9",
"pdf-writer",
"skrifa 0.47.0",
"weezl 0.1.12",
]
[[package]]
name = "craft-psd"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"encoding_rs",
"flate2",
@@ -1268,7 +1278,7 @@ dependencies = [
[[package]]
name = "craft-stream-codecs"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"fax",
"hayro-ccitt",
@@ -1279,7 +1289,7 @@ dependencies = [
[[package]]
name = "craft-svg"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"craft-image-codecs",
"craft-xml",
@@ -1300,7 +1310,7 @@ dependencies = [
[[package]]
name = "craft-tiff"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"serde",
"thiserror 2.0.21",
@@ -1309,7 +1319,7 @@ dependencies = [
[[package]]
name = "craft-ui"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"craft-fonts-build",
"craft-i18n",
@@ -1330,7 +1340,7 @@ dependencies = [
[[package]]
name = "craft-update"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"chrono",
"dunce",
@@ -1357,7 +1367,7 @@ dependencies = [
[[package]]
name = "craft-vectorcraft-format"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"flate2",
"serde",
@@ -1379,7 +1389,7 @@ dependencies = [
[[package]]
name = "craft-window"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"egui",
"objc2 0.6.5",
@@ -1398,7 +1408,7 @@ dependencies = [
[[package]]
name = "craft-xml"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"quick-xml 0.41.0",
"serde",
@@ -2505,7 +2515,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a"
[[package]]
name = "hayro-cmap"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"brotli",
"hayro-postscript",
@@ -2514,7 +2524,7 @@ dependencies = [
[[package]]
name = "hayro-interpret"
version = "0.7.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"bitflags 2.13.2",
"hayro-cmap",
@@ -2532,7 +2542,7 @@ dependencies = [
[[package]]
name = "hayro-jbig2"
version = "0.3.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"fearless_simd",
"hayro-ccitt",
@@ -2550,12 +2560,12 @@ dependencies = [
[[package]]
name = "hayro-postscript"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
[[package]]
name = "hayro-syntax"
version = "0.7.2"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"flate2",
"hayro-ccitt",
@@ -3355,7 +3365,7 @@ dependencies = [
[[package]]
name = "krilla"
version = "0.8.2"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"base64 0.22.1",
"bumpalo",
@@ -3464,7 +3474,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4"
[[package]]
name = "linesweeper"
version = "0.5.0"
source = "git+https://github.com/storytold/craft-libs?rev=50b0ee7bf811e363b5f238382b5c77318cf33e46#50b0ee7bf811e363b5f238382b5c77318cf33e46"
source = "git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0#d7c9632bfb3040cf45db394e7500cc93c81c49e0"
dependencies = [
"arrayvec",
"kurbo 0.13.1",
@@ -6673,6 +6683,7 @@ dependencies = [
"craft-image-codecs",
"crc32fast",
"proptest",
"vectorcraft-affinity",
]
[[package]]
@@ -6866,7 +6877,7 @@ dependencies = [
name = "vectorcraft-eps"
version = "0.24.1"
dependencies = [
"craft-eps",
"craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=d7c9632bfb3040cf45db394e7500cc93c81c49e0)",
"craft-image-codecs",
"craft-pdf",
"craft-ps",
@@ -7034,6 +7045,7 @@ dependencies = [
"vectorcraft-doc",
"vectorcraft-effects",
"vectorcraft-geom 0.24.1",
"vectorcraft-pdf",
"vectorcraft-testkit",
"vectorcraft-text",
]
+33 -33
View File
@@ -11,41 +11,41 @@ rust-version = "1.95"
repository = "https://github.com/storytold/vectorcraft"
[workspace.dependencies]
craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46", default-features = false, features = ["interpret", "write"] }
craft-print = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46", features = ["serde"] }
craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0", default-features = false, features = ["interpret", "write"] }
craft-print = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0", features = ["serde"] }
craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
# Decides who draws the window frame (desktop vs. app) so the suite shares one native titlebar per
# desktop. The `egui` feature adds `craft_window::decorate`. (craft-libs#217.)
craft-window = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46", features = ["egui"] }
craft-window = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0", features = ["egui"] }
# The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON.
craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
# craft-update: app-specific pretend versions apply to startup and manual checks.
# Native Affinity documents (craft-libs#914).
craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
# SVG parsing, limits, SVGZ and writer (craft-libs#778).
craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46", features = ["tree"] }
craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0", features = ["tree"] }
craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
# EPS container, previews, ASCII85 and DSC comments (craft-libs#778).
craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
# DXF tags, reader and writer (craft-libs#778, #926, #927).
craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
# WMF, EMF and EMF+ reader (craft-libs#778).
craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46", default-features = false, features = ["write"] }
craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46", features = ["egui"] }
craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "cfcc86242d56fe68117cd5dc2e5dd3b7a0e5b0ec", default-features = false, features = ["read", "write"] }
craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0", features = ["egui"] }
# internal
vectorcraft-geom = { path = "crates/geom" }
vectorcraft-color = { path = "crates/color" }
@@ -186,13 +186,13 @@ lto = "thin"
codegen-units = 1
[patch.crates-io]
hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
krilla = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "50b0ee7bf811e363b5f238382b5c77318cf33e46" }
hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
krilla = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "d7c9632bfb3040cf45db394e7500cc93c81c49e0" }
ecolor = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
emath = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
epaint = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+3 -1
View File
@@ -46,6 +46,8 @@ winreg = "0.55"
# Which GPU drives which display (EnumDisplayDevices, src/gpu.rs), so the window is drawn on the
# GPU that shows it: drawing on a GPU without a monitor reset the display driver. Safe wrappers over
# Win32 (MIT); the `user` feature is User32.dll only. Only the wgpu renderer chooses an adapter.
# It also lists each monitor's work area for floating panels (src/window.rs), so a build without
# the `wgpu` feature keeps the panels to the monitors' whole rects.
winsafe = { version = "0.0.29", default-features = false, features = ["user"], optional = true }
# Waits for Direct3D 12's adapter list before the window starts (src/gpu.rs, #4150). MIT OR
# Apache-2.0, already in the build through eframe.
@@ -73,7 +75,7 @@ vectorcraft-render = { workspace = true }
# with default features off). Pinned exactly: review the diff before bumping.
muda = { version = "=0.21.2", default-features = false }
objc2 = "0.6"
objc2-app-kit = { version = "0.3", default-features = false, features = ["std", "block2", "objc2-core-foundation", "objc2-quartz-core", "NSApplication", "NSCursor", "NSImage", "NSImageRep", "NSBitmapImageRep", "NSButton", "NSColor", "NSColorSampler", "NSColorSpace", "NSControl", "NSMenu", "NSEvent", "NSPasteboard", "NSPopUpButton", "NSResponder", "NSSavePanel", "NSTextField", "NSTextInputContext", "NSView", "NSWindow"] }
objc2-app-kit = { version = "0.3", default-features = false, features = ["std", "block2", "objc2-core-foundation", "objc2-quartz-core", "NSApplication", "NSCursor", "NSImage", "NSImageRep", "NSBitmapImageRep", "NSButton", "NSColor", "NSColorSampler", "NSColorSpace", "NSControl", "NSMenu", "NSEvent", "NSPasteboard", "NSPopUpButton", "NSResponder", "NSSavePanel", "NSScreen", "NSTextField", "NSTextInputContext", "NSView", "NSWindow"] }
# Files opened from Finder and the Dock (src/open_documents.rs), pasted bitmaps (src/clipboard.rs) and the control channel's App Nap activity (src/control_server.rs); both already come with winit, muda and rfd.
objc2-foundation = { version = "0.3", default-features = false, features = ["std", "block2", "NSArray", "NSData", "NSGeometry", "NSNotification", "NSOperation", "NSProcessInfo", "NSString", "NSURL"] }
block2 = "0.6"
+213 -13
View File
@@ -11,26 +11,51 @@ use winit::dpi::{LogicalSize, PhysicalPosition, PhysicalSize};
pub const DEFAULT_SIZE: [f32; 2] = [1440.0, 900.0];
/// The smallest window, in points.
pub const MIN_SIZE: [f32; 2] = [800.0, 500.0];
/// Room the first window leaves around itself for a taskbar, Dock or menu bar (the system doesn't
/// say how much of the screen they take): a monitor with less room opens it maximized.
/// Room the first window leaves around itself for a taskbar, Dock or menu bar when it decides
/// whether to open maximized: a monitor with less room opens it maximized. This check uses the
/// fixed allowance on every platform, including where the system reports a work area.
const SCREEN_ROOM: [f32; 2] = [64.0, 128.0];
/// Seconds between readings of the monitor list, which picks up a monitor connected while the app runs.
const MONITORS_EVERY: f64 = 1.0;
/// A monitor: its top-left corner and size in physical pixels, and its scale factor.
/// A monitor: its top-left corner and size in physical pixels, its scale factor, and the part
/// windows may use where the system reports one.
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Monitor {
pos: [i64; 2],
size: [i64; 2],
scale: f32,
/// `[x, y, width, height]` in physical pixels, without the taskbar, Dock or menu bar.
work: Option<[i64; 4]>,
}
/// A monitor's rect and its work area as the system lists them, `[x, y, width, height]` in
/// physical pixels. Only Windows and macOS list them.
#[derive(Clone, Copy, Debug, PartialEq)]
#[cfg_attr(not(any(all(windows, feature = "wgpu"), target_os = "macos")), allow(dead_code))]
pub struct WorkArea {
monitor: [i64; 4],
work: [i64; 4],
}
impl Monitor {
pub fn new(pos: PhysicalPosition<i32>, size: PhysicalSize<u32>, scale: f64) -> Self {
let scale = scale as f32;
let scale = if scale.is_finite() && scale > 0.0 { scale } else { 1.0 };
Self { pos: [pos.x.into(), pos.y.into()], size: [size.width.into(), size.height.into()], scale }
Self { pos: [pos.x.into(), pos.y.into()], size: [size.width.into(), size.height.into()], scale, work: None }
}
/// This monitor with the work area of the entry in `areas` whose monitor rect matches its own,
/// to the pixel either way to allow for rounding. Without a match, or when the matching work
/// area has no width or height, it has none.
fn with_work_area(self, areas: &[WorkArea]) -> Self {
let [x, y] = self.pos;
let [w, h] = self.size;
let rect = [x, y, w, h];
let work =
areas.iter().find(|a| a.monitor.iter().zip(rect).all(|(a, b)| a.abs_diff(b) <= 1)).map(|a| a.work).filter(|&[_, _, w, h]| w > 0 && h > 0);
Self { work, ..self }
}
/// Its size in points.
@@ -38,6 +63,19 @@ impl Monitor {
self.size.map(|s| s as f32 / self.scale)
}
/// This monitor with its work area made smaller by a window frame of `frame` physical pixels
/// (outer size less inner size), so a window whose inner size fits the result fits the work area
/// with its frame.
fn less_frame(self, frame: [i64; 2]) -> Self {
let work = self.work.map(|[x, y, w, h]| [x, y, (w - frame[0].max(0)).max(1), (h - frame[1].max(0)).max(1)]);
Self { work, ..self }
}
/// The size of its work area in points, or of the whole monitor when it has none.
fn work_points(&self) -> [f32; 2] {
self.work.map_or_else(|| self.points(), |[_, _, w, h]| [w, h].map(|s| s as f32 / self.scale))
}
/// Its size in points less room for a taskbar, Dock or menu bar.
fn usable(&self) -> [f32; 2] {
let points = self.points();
@@ -61,24 +99,31 @@ impl Monitor {
}
/// The top-left corner nearest to `pos` (centred when none) that keeps a window of `size`
/// points on this monitor.
/// points on this monitor, inside its work area when it has one. A window bigger than the area
/// gets the area's top-left corner.
fn keep_on(&self, pos: Option<[i32; 2]>, size: [f32; 2]) -> [i32; 2] {
let px = self.pixels(size);
let [x, y] = self.pos;
let [w, h] = self.size;
let [ax, ay, aw, ah] = self.work.unwrap_or([x, y, w, h]);
let (start, extent) = ([ax, ay], [aw, ah]);
std::array::from_fn(|i| {
let lo = self.pos[i];
let hi = lo + self.size[i].saturating_sub(px[i]).max(0);
let lo = start[i];
let hi = lo + extent[i].saturating_sub(px[i]).max(0);
let want = pos.map_or(lo + (hi - lo) / 2, |p| i64::from(p[i]));
i32::try_from(want.max(lo).min(hi)).unwrap_or_default()
})
}
/// This monitor for floating panels, in the points egui reports for a window on it: physical
/// pixels divided by the monitor's scale factor and the UI zoom.
/// pixels divided by the monitor's scale factor and the UI zoom. The work area is converted the
/// same way.
fn docking(&self, name: Option<String>, zoom: f32) -> DockMonitor {
let scale = self.scale * zoom;
let [x, y] = self.pos;
let [w, h] = self.size;
DockMonitor { name, rect: [x, y, w, h].map(|v| v as f32 / scale), scale, work_area: None }
let points = |rect: [i64; 4]| rect.map(|v| v as f32 / scale);
DockMonitor { name, rect: points([x, y, w, h]), scale, work_area: self.work.map(points) }
}
}
@@ -108,7 +153,10 @@ pub fn place(saved: Option<WindowGeometry>, monitors: &[Monitor], home: Option<u
// Bigger than its monitor (a smaller screen than last time): maximized, like the first window.
let room = m.points();
let too_big = (0..2).any(|i| saved.size[i] > room[i]);
let size = fit(saved.size, if too_big { m.usable() } else { room });
// No bigger than the work area either, so the window fits below or beside the taskbar.
let work = m.work_points();
let room = if too_big { m.usable() } else { room };
let size = fit(saved.size, std::array::from_fn(|i| room[i].min(work[i])));
WindowGeometry {
// Moved fully onto its monitor, or centred on the home monitor.
pos: saved.pos.map(|p| m.keep_on(shown.map(|_| p), size)),
@@ -128,12 +176,94 @@ pub fn monitors_due(listed: Option<(f64, f32)>, now: f64, zoom: f32) -> bool {
listed.is_none_or(|(at, listed_zoom)| listed_zoom != zoom || now - at >= MONITORS_EVERY)
}
/// The connected monitors for floating panels (`Services::dock_monitors`).
/// The connected monitors for floating panels (`Services::dock_monitors`), with the work area the
/// system reports for each (Windows and macOS).
pub fn dock_monitors(window: &winit::window::Window, zoom: f32) -> Vec<DockMonitor> {
let monitors: Vec<_> = window.available_monitors().map(|m| (Monitor::new(m.position(), m.size(), m.scale_factor()), m.name())).collect();
let areas = work_areas::list();
let monitors: Vec<_> =
window.available_monitors().map(|m| (Monitor::new(m.position(), m.size(), m.scale_factor()).with_work_area(&areas), m.name())).collect();
docking_list(&monitors, zoom, cfg!(target_os = "macos"))
}
/// A rect in macOS screen coordinates (points, origin at the bottom-left of the primary screen,
/// y up) in the physical pixels winit gives a monitor's position and size: points from the top-left
/// of the primary screen, `primary_height` points tall, times `scale`.
#[cfg(any(target_os = "macos", test))]
fn from_bottom_left([x, y, w, h]: [f64; 4], primary_height: f64, scale: f64) -> Option<[i64; 4]> {
let rect = [x, primary_height - (y + h), w, h].map(|v| (v * scale).round());
// `as` saturates; a coordinate of 1e12 pixels or more is not a monitor's.
rect.iter().all(|v| v.is_finite() && v.abs() < 1e12).then(|| rect.map(|v| v as i64))
}
/// Each monitor's rect and work area as the system reports them.
mod work_areas {
pub use platform::list;
/// `GetMonitorInfo` for every monitor: `rcMonitor` and `rcWork`, in the physical pixels winit
/// reports for a per-monitor DPI aware process.
#[cfg(all(windows, feature = "wgpu"))]
mod platform {
use super::super::WorkArea;
use winsafe::prelude::Handle;
use winsafe::{HDC, RECT};
pub fn list() -> Vec<WorkArea> {
let rect = |r: RECT| {
let [left, top, right, bottom] = [r.left, r.top, r.right, r.bottom].map(i64::from);
[left, top, right - left, bottom - top]
};
let mut areas = Vec::new();
// Without a list the panels keep to the monitors' whole rects, as before.
let _ = HDC::NULL.EnumDisplayMonitors(None, |monitor, _, _| {
if let Ok(info) = monitor.GetMonitorInfo() {
areas.push(WorkArea { monitor: rect(info.rcMonitor), work: rect(info.rcWork) });
}
true
});
areas
}
}
/// `NSScreen`'s `frame` and `visibleFrame` for every screen, turned into the top-left origin
/// and physical pixels winit uses for its monitors.
#[cfg(target_os = "macos")]
mod platform {
use super::super::{WorkArea, from_bottom_left};
use objc2_app_kit::NSScreen;
use objc2_foundation::{MainThreadMarker, NSRect};
pub fn list() -> Vec<WorkArea> {
// `NSScreen::screens` needs the main thread, where the UI frame runs.
let Some(mtm) = MainThreadMarker::new() else {
return Vec::new();
};
let screens: Vec<_> = NSScreen::screens(mtm).iter().collect();
// The first screen holds the menu bar and is the origin of the screen coordinates.
let Some(primary) = screens.first().map(|s| s.frame().size.height) else {
return Vec::new();
};
let rect = |r: NSRect| [r.origin.x, r.origin.y, r.size.width, r.size.height];
screens
.iter()
.filter_map(|s| {
let scale = s.backingScaleFactor();
let monitor = from_bottom_left(rect(s.frame()), primary, scale)?;
let work = from_bottom_left(rect(s.visibleFrame()), primary, scale)?;
Some(WorkArea { monitor, work })
})
.collect()
}
}
/// No work areas: the panels keep to the monitors' whole rects.
#[cfg(not(any(all(windows, feature = "wgpu"), target_os = "macos")))]
mod platform {
pub fn list() -> Vec<super::super::WorkArea> {
Vec::new()
}
}
}
/// The list for floating panels, empty when `monitors` have different scales and `shared_points` is
/// false. macOS has one desktop of points. Elsewhere a new window multiplies its saved position by the
/// scale of the monitor it is created on, which can put a window saved on another scale off every
@@ -154,7 +284,19 @@ fn docking_list(monitors: &[(Monitor, Option<String>)], zoom: f32, shared_points
/// until the host reports maximized (fixes #3635).
pub fn restore(window: &winit::window::Window, saved: Option<WindowGeometry>) -> WindowGeometry {
let handles: Vec<_> = window.available_monitors().collect();
let monitors: Vec<Monitor> = handles.iter().map(|m| Monitor::new(m.position(), m.size(), m.scale_factor())).collect();
let areas = work_areas::list();
// The system title bar and border, which the inner size leaves out, in points: each monitor
// draws them at its own scale.
let (outer, inner, scale) = (window.outer_size(), window.inner_size(), window.scale_factor());
let scale = if scale.is_finite() && scale > 0.0 { scale } else { 1.0 };
let frame = [outer.width.saturating_sub(inner.width), outer.height.saturating_sub(inner.height)].map(|px| f64::from(px) / scale);
let monitors: Vec<Monitor> = handles
.iter()
.map(|m| {
let px = frame.map(|f| (f * m.scale_factor()).ceil().min(1e6) as i64);
Monitor::new(m.position(), m.size(), m.scale_factor()).with_work_area(&areas).less_frame(px)
})
.collect();
let home = window.current_monitor().or_else(|| window.primary_monitor()).and_then(|c| handles.iter().position(|m| *m == c));
let g = place(saved, &monitors, home);
if let Some([x, y]) = g.pos {
@@ -257,6 +399,64 @@ mod tests {
assert_eq!(zoomed, DockMonitor { name: Some("m".into()), rect: [-2048.0, 0.0, 2048.0, 1152.0], scale: 1.25, work_area: None });
}
#[test]
fn floating_panels_get_each_monitors_work_area_in_the_same_points() {
// A 4K monitor at 200% with a 96-pixel taskbar along its bottom, and one at 100% to its
// right with a 48-pixel taskbar along its left edge.
let areas = [
WorkArea { monitor: [0, 0, 3840, 2160], work: [0, 0, 3840, 2064] },
WorkArea { monitor: [3840, 0, 1920, 1080], work: [3888, 0, 1872, 1080] },
];
let left = monitor(0, 0, 3840, 2160, 2.0).with_work_area(&areas);
assert_eq!(left.docking(None, 1.0).work_area, Some([0.0, 0.0, 1920.0, 1032.0]));
// The UI zoom divides the work area as it divides the rect.
assert_eq!(left.docking(None, 1.25).work_area, Some([0.0, 0.0, 1536.0, 825.6]));
// Rounding of a fractional scale can move a rect by a pixel.
let right = monitor(3841, 0, 1919, 1080, 1.0).with_work_area(&areas);
assert_eq!(right.docking(None, 1.0).work_area, Some([3888.0, 0.0, 1872.0, 1080.0]));
// A monitor the system did not list keeps to its whole rect.
let other = monitor(5760, 0, 1920, 1080, 1.0).with_work_area(&areas);
assert_eq!(other.docking(None, 1.0).work_area, None);
assert_eq!(monitor(0, 0, 3840, 2160, 2.0).with_work_area(&[]).docking(None, 1.0).work_area, None);
// A work area with no height is left out, so the monitor keeps to its whole rect.
let flat = [WorkArea { monitor: [0, 0, 1920, 1080], work: [0, 1080, 1920, 0] }];
assert_eq!(monitor(0, 0, 1920, 1080, 1.0).with_work_area(&flat).docking(None, 1.0).work_area, None);
}
#[test]
fn a_restored_window_keeps_its_title_bar_out_of_a_taskbar_along_the_top() {
// A 1920 × 1080 monitor with a 48-pixel taskbar along its top edge.
let areas = [WorkArea { monitor: [0, 0, 1920, 1080], work: [0, 48, 1920, 1032] }];
let m = [monitor(0, 0, 1920, 1080, 1.0).with_work_area(&areas)];
// A window saved at the top edge moves down below the taskbar.
let g = place(saved(Some([100, 0]), [1000.0, 700.0], false), &m, Some(0));
assert_eq!(g.pos, Some([100, 48]));
// A window that fits below the taskbar keeps its place.
assert_eq!(place(saved(Some([100, 200]), [1000.0, 700.0], false), &m, Some(0)).pos, Some([100, 200]));
// A window taller than the work area is made as tall as the work area and placed in it.
let tall = place(saved(Some([0, 0]), [1900.0, 1060.0], false), &m, Some(0));
assert_eq!((tall.pos, tall.size), (Some([0, 48]), [1900.0, 1032.0]));
// With a system frame of 16 × 39 pixels the inner size leaves room for it.
let framed = [m[0].less_frame([16, 39])];
let tall = place(saved(Some([0, 0]), [1900.0, 1060.0], false), &framed, Some(0));
assert_eq!((tall.pos, tall.size), (Some([0, 48]), [1900.0, 993.0]));
// Without a work area the frame leaves the monitor's rect as it was.
assert_eq!(monitor(0, 0, 1920, 1080, 1.0).less_frame([16, 39]).work, None);
}
#[test]
fn macos_screen_rects_turn_into_winits_top_left_pixels() {
// A 1512 × 982 point primary screen at 2× with a 37-point menu bar and an 80-point Dock,
// and a 1920 × 1080 screen at 1× above it, its bottom-left 200 points right of the
// primary's top-left.
let primary = 982.0;
assert_eq!(from_bottom_left([0.0, 0.0, 1512.0, 982.0], primary, 2.0), Some([0, 0, 3024, 1964]));
assert_eq!(from_bottom_left([0.0, 80.0, 1512.0, 865.0], primary, 2.0), Some([0, 74, 3024, 1730]));
assert_eq!(from_bottom_left([200.0, 982.0, 1920.0, 1080.0], primary, 1.0), Some([200, -1080, 1920, 1080]));
assert_eq!(from_bottom_left([f64::NAN, 0.0, 1.0, 1.0], primary, 1.0), None);
assert_eq!(from_bottom_left([0.0, 0.0, 1e300, 1.0], primary, 1.0), None);
}
#[test]
fn monitors_of_different_scales_are_listed_only_on_a_desktop_of_shared_points() {
let named = |m: Monitor, name: &str| (m, Some(name.to_string()));
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M7 9h10l-5 8.7z" fill="currentColor" stroke="none"/><path d="M3 9h18"/><path d="M5 5.5 14.5 22"/><path d="M19 5.5 9.5 22"/></svg>

After

Width:  |  Height:  |  Size: 321 B

+3
View File
@@ -21,3 +21,6 @@ proptest = { workspace = true }
# The tests build containers and decode previews.
crc32fast = { workspace = true }
craft-image-codecs = { workspace = true }
# tests/it's `import_limits`, `outline_limits` and `text` modules need `synth`, also when this crate
# is tested without vectorcraft-engine (`cargo xtask ci shard`).
vectorcraft-affinity = { path = ".", features = ["synth"] }
+3 -53
View File
@@ -639,8 +639,7 @@ fn jpeg_icc(bytes: &[u8]) -> Option<Vec<u8>> {
craft_image_codecs::jpeg_inks::jpeg_icc_profile(bytes)
}
/// The bytes after an `ICC_PROFILE` APP2 segment's length: its name, then the segment's number and
/// the count of segments.
#[cfg(test)]
const ICC_SEGMENT: &[u8; 12] = b"ICC_PROFILE\0";
/// JPEG `bytes` carrying `icc` in place of the ICC profile they carry, if any: every
@@ -649,63 +648,14 @@ const ICC_SEGMENT: &[u8; 12] = b"ICC_PROFILE\0";
/// for bytes whose segments before the scan can't be read, an empty `icc`, and one longer than 255
/// segments hold.
pub fn jpeg_with_icc(bytes: &[u8], icc: &[u8]) -> Option<Vec<u8>> {
// A segment's length counts itself (2 bytes) and the name, number and count (14).
const CHUNK: usize = 0xFFFF - 2 - ICC_SEGMENT.len() - 2;
let chunks: Vec<&[u8]> = icc.chunks(CHUNK).collect();
let count = u8::try_from(chunks.len()).ok().filter(|n| *n > 0)?;
let mut segments = Vec::with_capacity(icc.len() + 18 * chunks.len());
for (i, chunk) in chunks.iter().enumerate() {
let len = u16::try_from(chunk.len() + 2 + ICC_SEGMENT.len() + 2).ok()?;
segments.extend_from_slice(&[0xFF, 0xE2]);
segments.extend_from_slice(&len.to_be_bytes());
segments.extend_from_slice(ICC_SEGMENT);
segments.extend_from_slice(&[u8::try_from(i + 1).ok()?, count]);
segments.extend_from_slice(chunk);
}
with_icc_segments(bytes, segments)
craft_image_codecs::jpeg_inks::jpeg_with_icc(bytes, icc)
}
/// JPEG `bytes` without the ICC profile they carry: every `ICC_PROFILE` APP2 segment before the
/// scan taken out, and the other segments and the scan as they are. `None` for bytes whose
/// segments before the scan can't be read.
pub fn jpeg_without_icc(bytes: &[u8]) -> Option<Vec<u8>> {
with_icc_segments(bytes, vec![])
}
/// JPEG `bytes` with every `ICC_PROFILE` APP2 segment before the scan taken out and `segments`
/// written after the leading application segments; `None` when the bytes don't start a JPEG or
/// their segments before the scan can't be read.
fn with_icc_segments(bytes: &[u8], segments: Vec<u8>) -> Option<Vec<u8>> {
if !bytes.starts_with(&[0xFF, 0xD8]) {
return None;
}
let mut out = Vec::with_capacity(bytes.len() + segments.len());
out.extend_from_slice(&[0xFF, 0xD8]);
let mut icc_segments = Some(segments);
let mut at = 2;
// The segments before the scan (SOS), each with its length; a marker without one ends them.
// Fill bytes (0xFF) before a marker are left out.
loop {
while bytes.get(at..at + 2) == Some(&[0xFF, 0xFF]) {
at += 1;
}
let (Some(&0xFF), Some(&marker)) = (bytes.get(at), bytes.get(at + 1)) else { return None };
let app = (0xE0..=0xEF).contains(&marker);
if !app && let Some(s) = icc_segments.take() {
out.extend_from_slice(&s);
}
if matches!(marker, 0xDA | 0xD8 | 0xD9 | 0x01 | 0xD0..=0xD7) {
break;
}
let len = usize::from(u16::from_be_bytes(bytes.get(at + 2..at + 4)?.try_into().ok()?));
let segment = bytes.get(at..(at + 2).checked_add(len)?).filter(|_| len >= 2)?;
if !(marker == 0xE2 && segment.get(4..16) == Some(ICC_SEGMENT.as_slice())) {
out.extend_from_slice(segment);
}
at += segment.len();
}
out.extend_from_slice(bytes.get(at..)?);
Some(out)
craft_image_codecs::jpeg_inks::jpeg_without_icc(bytes)
}
/// `icc` when it is a profile of CMYK colors, which the samples of a CMYK image are in.
+2 -2
View File
@@ -198,8 +198,8 @@ pub fn effect_catalog() -> Vec<EffectInfo> {
INFLATE,
"Inflate…",
&["Effect", "3D and Materials"],
"{depth: pt (0..2000, 0; flat depth between front and back), twist: degrees (0..360, 0; the back turned against the front), taper: % (1..100, 100; the back's size), cap: bool (true: solid; false: no back, a shell open behind), volume: % (0..100, 50; 50 rounds the edge like a half sphere), bothSides: bool (false: flat back), rotationX: degrees (-180..180, -21.88), rotationY: degrees (-180..180, -23.4), rotationZ: degrees (-180..180, 9.06; the defaults are the Off-Axis Front position), perspectiveAngle: degrees (0..160, 0; 0 is none, wider brings the eye nearer), perspective: % (0..100; the earlier form, read as the perspectiveAngle that shows the same view), shade: bool (true), lightColor: #rrggbb (white, #ffffff; legacy directional light color), lights: null or array of 1..10 objects (color: #rrggbb, intensity: % 0..100, rotation: degrees -180..180, height: degrees 0..90, softness: % 0..100, behind: bool; overrides the single-light fields; ambient is shared), lightRotation: degrees (-180..180, 125.26; round the object on the page, 0 on its right, counterclockwise), lightHeight: degrees (0..90, 30; 0 beside the object, 90 straight in front), lightBehind: bool (false; true lights it from behind), lightIntensity: % (0..100, 80), lightSoftness: % (0..100, 0; how far round the object the light reaches, and how much it blurs the shadow), ambient: % (0..200, 25; Ambient Light), lightAzimuth: degrees (the earlier form: with lightElevation, read as the lightRotation, lightHeight and lightBehind of the same light), lightElevation: degrees (the earlier form, with lightAzimuth), shadow: bool (false; the first light casts a shadow, black at 50% times the art's opacity, hard-edged at the first light's softness 0 and blurred above it), shadowPosition: behind|below (behind; behind: on a plane square to the view, below: on the floor under the object, turned with it), shadowDistance: % (0..100, 0; how far the plane is from the object, as a share of its largest size), shadowBounds: % (10..400, 100; how far the plane reaches: at 100 it is four times the object's largest size across), render: object ({mode: shaded}; mode: shaded|wireframe, as Revolve's)}. Painted with the top fill (else the top stroke).",
json!({"depth":0.0,"twist":0.0,"taper":100.0,"cap":true,"volume":50.0,"bothSides":false,"rotationX":-21.88,"rotationY":-23.4,"rotationZ":9.06,"perspectiveAngle":0.0,"shade":true,"lightColor":"#ffffff","lights":null,"lightRotation":125.26438968275465,"lightHeight":30.0,"lightBehind":false,"lightIntensity":80.0,"lightSoftness":0.0,"ambient":25.0,"shadow":false,"shadowPosition":"behind","shadowDistance":0.0,"shadowBounds":100.0,"render":{"mode":"shaded"}}),
"{depth: pt (0..2000, 0; flat depth between front and back), twist: degrees (0..360, 0; the back turned against the front), taper: % (1..100, 100; the back's size), cap: bool (true: solid; false: no back, a shell open behind), volume: % (0..100, 50; 50 rounds the edge like a half sphere), bothSides: bool (false: flat back), rotationX: degrees (-180..180, -21.88), rotationY: degrees (-180..180, -23.4), rotationZ: degrees (-180..180, 9.06; the defaults are the Off-Axis Front position), perspectiveAngle: degrees (0..160, 0; 0 is none, wider brings the eye nearer), perspective: % (0..100; the earlier form, read as the perspectiveAngle that shows the same view), shade: bool (true), lightColor: #rrggbb (white, #ffffff; legacy directional light color), lights: null or array of 1..10 objects (color: #rrggbb, intensity: % 0..100, rotation: degrees -180..180, height: degrees 0..90, softness: % 0..100, behind: bool; overrides the single-light fields; ambient is shared), lightRotation: degrees (-180..180, 125.26; round the object on the page, 0 on its right, counterclockwise), lightHeight: degrees (0..90, 30; 0 beside the object, 90 straight in front), lightBehind: bool (false; true lights it from behind), lightIntensity: % (0..100, 80), lightSoftness: % (0..100, 0; how far round the object the light reaches, and how much it blurs the shadow), ambient: % (0..200, 25; Ambient Light), lightAzimuth: degrees (the earlier form: with lightElevation, read as the lightRotation, lightHeight and lightBehind of the same light), lightElevation: degrees (the earlier form, with lightAzimuth), shadow: bool (false; the first light casts a shadow, black at 50% times the art's opacity, hard-edged at the first light's softness 0 and blurred above it), shadowPosition: behind|below (behind; behind: on a plane square to the view, below: on the floor under the object, turned with it), shadowDistance: % (0..100, 0; how far the plane is from the object, as a share of its largest size), shadowBounds: % (10..400, 100; how far the plane reaches: at 100 it is four times the object's largest size across), graphics: array of 0..64 objects ([]; the 3D and Materials panel's Graphics on the puffed front and back, see threeD.mapGraphic: symbol: name of a document symbol, face: front|back (front; the back reads left to right as seen from behind and takes graphics with bothSides and cap on), x: pt (0; the offset of the graphic's center from the center of the object's bounds, in the art's plane), y: pt (0), scale: % (1..10000, 100; of the symbol's own size), rotation: degrees (-360..360, 0; counterclockwise); carried straight out from the art's plane onto the puffed face, twist and taper turning and shrinking the back's with it, shaded with the surface and drawn only where its outside faces the viewer), render: object ({mode: shaded}; mode: shaded|wireframe, as Revolve's)}. Painted with the top fill (else the top stroke).",
json!({"depth":0.0,"twist":0.0,"taper":100.0,"cap":true,"volume":50.0,"bothSides":false,"rotationX":-21.88,"rotationY":-23.4,"rotationZ":9.06,"perspectiveAngle":0.0,"shade":true,"lightColor":"#ffffff","lights":null,"lightRotation":125.26438968275465,"lightHeight":30.0,"lightBehind":false,"lightIntensity":80.0,"lightSoftness":0.0,"ambient":25.0,"shadow":false,"shadowPosition":"behind","shadowDistance":0.0,"shadowBounds":100.0,"graphics":[],"render":{"mode":"shaded"}}),
),
g(
ROTATE,
+11 -2
View File
@@ -229,11 +229,20 @@ pub(crate) fn seamed_fill(path: &vectorcraft_geom::PathData, seam: f64) -> Optio
/// footprints. Where two facets' antialiased edges meet, the underlay fills what they leave
/// uncovered with the neighbors' own colors, so the background does not show through. `None` unless
/// every face is a facet a surface draws: a path filled and stroked by its seam, or a facet composed
/// in a clip of its footprint, neither with an opacity mask.
/// in a clip of its footprint, neither with an opacity mask. A face drawn with the parts of Inflate's
/// graphics on it, a group of the facet and those parts, takes its facet's underlay and stays in the
/// order with its parts, which are cut to the facet's outline, so the clip keeps them.
pub(crate) fn sealed(id: vectorcraft_doc::NodeId, faces: &[std::sync::Arc<vectorcraft_doc::Node>]) -> Option<vectorcraft_doc::Node> {
use std::sync::Arc;
use vectorcraft_doc::{Node, NodeKind};
let (clip, mut underlay) = underlay(id, faces)?;
let facets: Vec<Arc<Node>> = faces
.iter()
.map(|face| match &face.kind {
NodeKind::Group { children, clip: false } if face.extras().mask.is_none() => children.first().cloned(),
_ => Some(face.clone()),
})
.collect::<Option<_>>()?;
let (clip, mut underlay) = underlay(id, &facets)?;
underlay.extend(faces.iter().cloned());
Some(Node::new(id, NodeKind::Group { children: vec![Arc::new(clip), Arc::new(Node::group(id, underlay))], clip: true }))
}
+2 -1
View File
@@ -382,7 +382,8 @@ fn revolve_takes_graphics_on_its_side_only() {
let kept = three_d_params_as(crate::EXTRUDE, &both, REVOLVE);
assert_eq!(kept["graphics"].as_array().map(Vec::len), Some(1));
assert_eq!(kept["graphics"][0]["symbol"], "Red");
assert_eq!(three_d_params_as(REVOLVE, &front, crate::INFLATE).get("graphics"), None);
// Inflate keeps them, and its front takes them.
assert_eq!(three_d_params_as(REVOLVE, &front, crate::INFLATE)["graphics"], front["graphics"]);
}
#[test]
+136 -35
View File
@@ -98,13 +98,15 @@ pub fn three_d_params_as(from: &str, params: &Value, to: &str) -> Value {
}
}
// A plane has only a front, and Revolve's graphics go on its side, named the front, so graphics
// on the back cap and on Extrude & Bevel's side are dropped.
if (to == ROTATE || to == crate::REVOLVE)
// on the back cap and on Extrude & Bevel's side are dropped. Inflate takes graphics on its front
// and back, so it drops those on the side.
if (to == ROTATE || to == crate::REVOLVE || to == INFLATE)
&& let Some(Value::Array(list)) = out.get_mut(GRAPHICS)
{
let back = to != INFLATE;
list.retain(|g| {
let face = g.get("face").and_then(Value::as_str);
face != Some(PlanarFace::Back.id()) && face != Some(PlanarFace::Side.id())
!(back && face == Some(PlanarFace::Back.id())) && face != Some(PlanarFace::Side.id())
});
}
Value::Object(out)
@@ -259,6 +261,7 @@ pub fn inflate_options(p: &Value) -> Inflate {
twist: num(p, "twist", 0.0),
taper: num(p, "taper", 100.0) / 100.0,
cap: flag(p, "cap", true),
map_surface: false,
}
}
@@ -444,7 +447,8 @@ pub fn validate_solid_in(doc: Option<&Document>, n: &Node, id: &str, p: &Value)
/// Inflate or Rotate, as drawn, or a new one after its other effects when it has none.
fn validate_solid_for(doc: Option<&Document>, n: &Node, id: &str, p: &Value, at: (Option<usize>, Option<usize>)) -> Result<(), String> {
validate_solid_params(id, p)?;
if let Some(doc) = doc {
// In wireframe mode the edges are drawn with no graphics, and their art is not checked.
if let Some(doc) = doc.filter(|_| !wireframe::wireframe_params(id, p)) {
graphics::validate_symbols(doc, p)?;
}
let label = label_of(id);
@@ -461,7 +465,8 @@ fn validate_solid_for(doc: Option<&Document>, n: &Node, id: &str, p: &Value, at:
let b = union_bounds(&shapes).ok_or_else(|| format!("{label} requires a group holding a shape with at least two anchors"))?;
check_profiles(id, p, &shapes, b)?;
check_solids(id, p, &shapes)?;
return check_side_graphics(doc, n, id, p, &shapes);
check_side_graphics(doc, n, id, p, &shapes)?;
return check_membrane_graphics(doc, n, id, p, &shapes);
}
let (path, rule) = object_profile(n, label)?;
let anchors = || format!("{label} requires a shape with at least two anchors");
@@ -479,7 +484,8 @@ fn validate_solid_for(doc: Option<&Document>, n: &Node, id: &str, p: &Value, at:
let shapes = [Profile { path, rule, items, opacity: 1.0, scopes: vec![] }];
check_profiles(id, p, &shapes, b)?;
check_solids(id, p, &shapes)?;
check_side_graphics(doc, n, id, p, &shapes)
check_side_graphics(doc, n, id, p, &shapes)?;
check_membrane_graphics(doc, n, id, p, &shapes)
}
/// Does 3D effect `id` with parameters `p` cast a shadow: is it Extrude & Bevel, Inflate or Rotate
@@ -493,6 +499,30 @@ fn visible(item: &AppearanceItem, member: f32) -> bool {
paint_of(item, member).1 > 0.0
}
/// An error when the graphics of Inflate `id` with parameters `p`, with the symbols of `doc`, are
/// past their limits on the front and puffed back of the solids of `shapes`: their art, or the
/// parts they draw on its pieces ([`graphics::surface_parts`]), or when the solids can't be built
/// with their pieces carrying the graphics. They are built as the art builds them
/// ([`surfaces_with`]). Without `doc` nothing is drawn, and nothing is checked. In wireframe mode no
/// graphics are drawn, and none are checked.
fn check_membrane_graphics(doc: Option<&Document>, n: &Node, id: &str, p: &Value, shapes: &[Profile]) -> Result<(), String> {
let Some(doc) = doc else { return Ok(()) };
if id != INFLATE || wireframe::wireframe_params(id, p) || mapped_graphics(p).is_empty() {
return Ok(());
}
for face in [PlanarFace::Front, PlanarFace::Back] {
graphics::validate_surface_symbols(doc, p, face)?;
}
let fx = Effect { id: id.into(), params: p.clone(), visible: true };
let mut dropped = false;
// Art that can't be built with the graphics draws without them.
let built = surfaces_with(Some(doc), n, &fx, shapes, false, true, &mut dropped);
if dropped || built.is_none() {
return Err("The graphics are too complex: simplify the symbols' art".into());
}
Ok(())
}
/// An error when the graphics on the side of Extrude & Bevel `id` with parameters `p`, with the
/// symbols of `doc`, are past their limits on the side of the solid of `shapes` that takes them
/// ([`side_carrier`]): their art, or the parts they draw on its pieces
@@ -521,7 +551,7 @@ fn check_side_graphics(doc: Option<&Document>, n: &Node, id: &str, p: &Value, sh
let fx = Effect { id: id.into(), params: p.clone(), visible: true };
let mut dropped = false;
// Art that can't be built draws the source path, without the side's graphics.
let built = surfaces_with(Some(doc), n, &fx, shapes, false, &mut dropped);
let built = surfaces_with(Some(doc), n, &fx, shapes, false, false, &mut dropped);
if dropped || built.is_none() {
return Err("The graphics are too complex: simplify the symbols' art".into());
}
@@ -572,7 +602,7 @@ fn check_solids(id: &str, p: &Value, shapes: &[Profile]) -> Result<(), String> {
if !cast {
return built_solids(id, p, &parts, bounds, MAX_OBJECT_FACES).try_for_each(|r| r.map(|_| ()));
}
let built = built_solids_cast(id, p, &parts, bounds, MAX_OBJECT_FACES, true, None)
let built = built_solids_cast(id, p, &parts, bounds, MAX_OBJECT_FACES, true, false, None)
.map(|r| r.map(|solid| solid.and_then(|(_, faces)| faces)))
.collect::<Result<Vec<_>, String>>()?;
cast_built(id, p, shapes, built).map(|_| ())
@@ -846,11 +876,37 @@ fn surface(n: &Node, facets: Vec<Facet>, paint: &Paint, opacity: f32, blend: Ble
group
}
/// The parts of `graphics` that fall on each of `facets`, the facets of one of Inflate's solids in
/// drawing order, built with their front and puffed back carrying the graphics
/// ([`vectorcraft_three_d::Inflate::map_surface`]): for each facet, the parts of the graphics on
/// its face to draw right after it ([`graphics::surface_parts`]), shaded as a solid color is on
/// that facet. `copies` counts the bytes of the paint copies of the object's graphics. `None` past
/// the graphics' limits.
fn membrane_parts(
doc: Option<&Document>,
id: NodeId,
graphics: &[MappedGraphic],
facets: &[Facet],
copies: &mut usize,
) -> Option<Vec<Vec<Arc<Node>>>> {
let shade = |f: &graphics::OnFace<'_>, c: vectorcraft_doc::color::Color| Paint::solid(crate::lighting::shade(c, f.facet.illumination));
let mut out: Vec<Vec<Arc<Node>>> = vec![vec![]; facets.len()];
for face in [PlanarFace::Front, PlanarFace::Back].into_iter().filter(|face| graphics.iter().any(|g| g.face == *face)) {
let on: Vec<graphics::OnFace<'_>> = facets.iter().map(|facet| graphics::OnFace { facet, face }).collect();
let parts = graphics::surface_parts(doc, id, (graphics, face), &on, &shade, copies)?;
for (slot, extra) in out.iter_mut().zip(parts) {
slot.extend(extra);
}
}
Some(out)
}
/// `surface`, a plain group of one face for each facet ([`surface`]), with each face followed by
/// the parts of the side's graphics that `parts` holds for its facet ([`graphics::surface_parts`]):
/// a face with parts becomes a group of the face and its parts, so nearer faces drawn after it
/// cover them too. `surface` is returned as it is when no facet has a part or it is not such a group.
fn with_side_parts(id: NodeId, mut surface: Node, parts: Vec<Vec<Arc<Node>>>) -> Node {
/// the parts of the graphics that `parts` holds for its facet (on Extrude & Bevel's side
/// [`graphics::surface_parts`], on Inflate's front and back [`membrane_parts`]): a face with parts
/// becomes a group of the face and its parts, so nearer faces drawn after it cover them too.
/// `surface` is returned as it is when no facet has a part or it is not such a group.
fn with_surface_parts(id: NodeId, mut surface: Node, parts: Vec<Vec<Arc<Node>>>) -> Node {
if parts.iter().all(Vec::is_empty) {
return surface;
}
@@ -984,7 +1040,7 @@ fn built_solids<'a>(
bounds: Rect,
limit: usize,
) -> impl Iterator<Item = Result<Option<Vec<Facet>>, String>> + 'a {
built_solids_cast(id, p, parts, bounds, limit, false, None).map(|r| r.map(|s| s.map(|(f, _)| f)))
built_solids_cast(id, p, parts, bounds, limit, false, false, None).map(|r| r.map(|s| s.map(|(f, _)| f)))
}
/// One solid's facets and, when its shadow is cast, the faces it is cast from.
@@ -995,9 +1051,12 @@ type CastingSolid = (Vec<Facet>, Option<SolidFaces>);
type SurfacesAndFaces = (Vec<Arc<Node>>, Vec<Option<SolidFaces>>);
/// [`built_solids`], and with `cast` for Extrude & Bevel or Inflate each solid's faces its shadow
/// is cast from, from the same build ([`SolidFaces`]). The solid of part `side`, when there is one,
/// is built with the pieces of its side carrying where they lie on it unrolled, for the graphics
/// on Extrude & Bevel's side ([`side_carrier`]).
/// is cast from, from the same build ([`SolidFaces`]). With `membrane`, Inflate's solids are built
/// with the pieces of their front and puffed back carrying where they lie in the art's plane, for
/// the graphics drawn on them ([`vectorcraft_three_d::Inflate::map_surface`]). The solid of part
/// `side`, when there is one, is built with the pieces of its side carrying where they lie on it
/// unrolled, for the graphics on Extrude & Bevel's side ([`side_carrier`]).
#[allow(clippy::too_many_arguments)] // the build's inputs and the two surfaces that carry graphics
fn built_solids_cast<'a>(
id: &'a str,
p: &'a Value,
@@ -1005,12 +1064,13 @@ fn built_solids_cast<'a>(
bounds: Rect,
limit: usize,
cast: bool,
membrane: bool,
side: Option<usize>,
) -> impl Iterator<Item = Result<Option<CastingSolid>, String>> + 'a {
// Inflate's eye is placed for every puff together, as far away as the highest needs.
let mut inflated = (id == INFLATE).then(|| -> Box<dyn Iterator<Item = Result<CastingSolid, String>>> {
let shapes: Vec<(&PathData, FillRule)> = parts.iter().map(|(_, _, area, rule, _, _)| (area, *rule)).collect();
let (o, view) = (inflate_options(p), view_options(p));
let (o, view) = (Inflate { map_surface: membrane, ..inflate_options(p) }, view_options(p));
if cast {
Box::new(vectorcraft_three_d::inflate_shadowed(&shapes, bounds, o, view).map(|r| r.map(|(f, faces)| (f, Some(faces)))))
} else {
@@ -1962,14 +2022,33 @@ fn seen_ends(f: &[Facet]) -> impl Iterator<Item = &Facet> {
/// [`art_for`] without the shadow: the solids' surfaces, with the graphics mapped onto their planar
/// faces drawn right after the last of the solids' surfaces that holds that face. With `cast`, each
/// solid built also keeps the faces its shadow is cast from, from the same build, in the order the
/// solids are built ([`cast_built`]); `None` for a stroke's solid left out of the art.
/// solids are built ([`cast_built`]); `None` for a stroke's solid left out of the art. Inflate's
/// graphics are drawn on the pieces of its front and puffed back; when its solids can't be built
/// with those pieces, or the graphics are past their limits on them, the solids draw without them.
fn surfaces_for(doc: Option<&Document>, n: &Node, fx: &Effect, shapes: &[Profile], cast: bool) -> Option<SurfacesAndFaces> {
surfaces_with(doc, n, fx, shapes, cast, &mut false)
let p = crate::merged_params(&fx.id, &fx.params);
if fx.id == INFLATE && doc.is_some() && !mapped_graphics(&p).is_empty() {
let mut dropped = false;
if let Some(built) = surfaces_with(doc, n, fx, shapes, cast, true, &mut dropped).filter(|_| !dropped) {
return Some(built);
}
}
surfaces_with(doc, n, fx, shapes, cast, false, &mut false)
}
/// [`surfaces_for`], setting `side_dropped` when the graphics on Extrude & Bevel's side are past
/// their limits on the pieces drawn, and the solid that takes them draws without them.
fn surfaces_with(doc: Option<&Document>, n: &Node, fx: &Effect, shapes: &[Profile], cast: bool, side_dropped: &mut bool) -> Option<SurfacesAndFaces> {
/// [`surfaces_for`], with `membrane` building Inflate's solids with their front and puffed back
/// carrying the graphics ([`built_solids_cast`]), and setting `dropped` when those graphics, or the
/// graphics on Extrude & Bevel's side, are past their limits on the pieces drawn and the solid that
/// takes them draws without them.
fn surfaces_with(
doc: Option<&Document>,
n: &Node,
fx: &Effect,
shapes: &[Profile],
cast: bool,
membrane: bool,
dropped: &mut bool,
) -> Option<SurfacesAndFaces> {
let b = union_bounds(shapes)?;
let p = crate::merged_params(&fx.id, &fx.params);
let classic = fx.id == CLASSIC_EXTRUDE || fx.id == CLASSIC_ROTATE;
@@ -2025,7 +2104,7 @@ fn surfaces_with(doc: Option<&Document>, n: &Node, fx: &Effect, shapes: &[Profil
let map_art = MapArt::of(doc, &fx.id, &p).filter(|_| fx.id == CLASSIC_EXTRUDE);
let mut layouts: Vec<SolidLayout> = vec![];
let mut surfaces_before = 0usize;
let made = built_solids_cast(&fx.id, &p, &parts, bounds, MAX_OBJECT_FACES, cast, carrier);
let made = built_solids_cast(&fx.id, &p, &parts, bounds, MAX_OBJECT_FACES, cast, membrane, carrier);
for (k, ((item, opacity, area, rule, scopes, member), f)) in parts.iter().zip(made).enumerate() {
let item: &AppearanceItem = item;
let layout = map_art.as_ref().map(|_| {
@@ -2044,11 +2123,12 @@ fn surfaces_with(doc: Option<&Document>, n: &Node, fx: &Effect, shapes: &[Profil
layouts.extend(layout);
built.push(faces);
}
// A stroke's outline past the limits is left out; the fill's solid still draws, and
// A stroke's outline past the limits is left out; the fill's solid still draws. Built
// with the graphics' pieces, a stroke past the limits draws without the graphics, and
// the side's graphics on that outline are not drawn.
Ok(None) => {
built.push(None);
*side_dropped |= carrier == Some(k);
*dropped |= membrane || carrier == Some(k);
}
// A loaded file or a shape edited past the limits (its own, or those of the object's
// solids together) keeps drawing its source path instead of failing the frame;
@@ -2161,8 +2241,10 @@ fn surfaces_with(doc: Option<&Document>, n: &Node, fx: &Effect, shapes: &[Profil
// ([`in_one_order`], [`underlaid_surface`]).
let seals: Vec<bool> = solids.iter().map(|(.., f, _)| underlaid(f, colored)).collect();
let seal = |range: std::ops::Range<usize>| seals.get(range).is_some_and(|s| s.iter().any(|s| *s));
let membrane_graphics = if membrane && graphics_on { mapped_graphics(&p) } else { vec![] };
let side_graphics = carrier.map(|_| mapped_graphics(&p)).unwrap_or_default();
// The paint copies of the side's graphics, apart from those of the surfaces, as on Revolve.
// The paint copies of Inflate's graphics and of the side's, apart from those of the surfaces,
// as on Revolve.
let mut graphic_copies = 0usize;
let surfaces: Vec<BuiltSurface> = solids
.into_iter()
@@ -2171,22 +2253,29 @@ fn surfaces_with(doc: Option<&Document>, n: &Node, fx: &Effect, shapes: &[Profil
let depths: Vec<Placed> = f.iter().map(|f| Placed::of(f, shape, paints)).collect();
let ends = f.iter().map(|f| f.end.filter(|_| !f.away)).collect();
let (paint, opacity, blend) = paint_of(item, member);
// The carrier's pieces draw the parts of the side's graphics that fall on them; past
// the graphics' limits the solid draws without them.
let parts = if side_graphics.is_empty() || !f.iter().any(|f| f.surface.is_some()) {
// The pieces of Inflate's front and back, and the carrier's pieces of Extrude & Bevel's
// side, draw the parts of the graphics that fall on them; past the graphics' limits the
// solid draws without them.
let parts = if !f.iter().any(|f| f.surface.is_some()) {
vec![]
} else {
} else if !membrane_graphics.is_empty() {
let parts = membrane_parts(doc, n.id, &membrane_graphics, &f, &mut graphic_copies);
*dropped |= parts.is_none();
parts.unwrap_or_default()
} else if !side_graphics.is_empty() {
let shade = |f: &Facet, c: vectorcraft_doc::color::Color| Paint::solid(crate::lighting::shade(c, f.illumination));
let parts = graphics::surface_parts(doc, n.id, (&side_graphics, PlanarFace::Side), &f, &shade, &mut graphic_copies);
*side_dropped |= parts.is_none();
*dropped |= parts.is_none();
parts.unwrap_or_default()
} else {
vec![]
};
let drawn = parts.iter().any(|p| !p.is_empty());
let art = if classic {
classic_arts.next().unwrap_or_else(|| Node::group(n.id, vec![]))
} else {
let faces = drawn || (split && shared.get(shape).copied().unwrap_or(false));
with_side_parts(n.id, surface(n, f, &paint, opacity, blend, colored, faces), parts)
with_surface_parts(n.id, surface(n, f, &paint, opacity, blend, colored, faces), parts)
};
(depths, art, scopes, ends)
})
@@ -2476,14 +2565,15 @@ fn group_solid_art(doc: Option<&Document>, n: &Node) -> Option<Node> {
/// Where the graphics of the 3D effect of `n` (on the object itself with `item` `None`, else on its
/// fill or stroke `item`) are drawn: the bounds its solids are built with and the maps of their
/// planar faces ([`graphics::GraphicFrame`]). `None` when `n` has no visible Extrude & Bevel or
/// Rotate there, or its art can't be built.
/// planar faces, or Inflate's puffed faces ([`graphics::GraphicFrame`]). `None` when `n` has no
/// visible Extrude & Bevel, Inflate or Rotate there, or its art can't be built.
pub fn graphic_frame(doc: Option<&Document>, n: &Node, item: Option<usize>) -> Option<graphics::GraphicFrame> {
frame_of(doc, n, item, &solid)
}
/// [`graphic_frame`] of the 3D effect at `index` in that list, which must be a visible Extrude &
/// Bevel, Rotate or Revolve. Revolve's frame is its unrolled side seen from the front, centered on
/// Bevel, Rotate, Revolve or Inflate. Inflate's frame places handles on the pieces of its puffed
/// front and back the viewer sees. Revolve's frame is its unrolled side seen from the front, centered on
/// the origin, with no face maps: it sizes a new graphic and places no handles.
pub fn graphic_frame_at(doc: Option<&Document>, n: &Node, item: Option<usize>, index: usize) -> Option<graphics::GraphicFrame> {
frame_of(doc, n, item, &|fx: &[Effect]| fx.get(index).filter(|e| e.visible && is_three_d(&e.id)).map(|e| (index, e)))
@@ -2546,6 +2636,17 @@ fn frame_of(doc: Option<&Document>, n: &Node, item: Option<usize>, pick: &Pick<'
return Some(graphics::GraphicFrame::new(b, plane, None));
}
let (parts, bounds) = solid_parts(&shapes, b);
if fx.id == INFLATE {
// Inflate's graphics lie on its puffed front and back: the pieces the viewer sees place
// their handles. A stroke left out places none of its own. When a fill's solid can't be
// built, or the solids together pass the limit, the art draws its source and no piece
// places a handle.
let built: Vec<Facet> = built_solids_cast(INFLATE, &p, &parts, bounds, MAX_OBJECT_FACES, false, true, None)
.collect::<Result<Vec<_>, String>>()
.map(|solids| solids.into_iter().flatten().flat_map(|(f, _)| f).collect())
.unwrap_or_default();
return Some(graphics::GraphicFrame::inflated(bounds, graphics::MembraneFrame::of(&built)));
}
let options = extrude_options(&p);
let map = |face| vectorcraft_three_d::extrude_face_map(bounds, options, view, face);
let frame = graphics::GraphicFrame::new(bounds, map(PlanarFace::Front), map(PlanarFace::Back));
+242 -56
View File
@@ -16,7 +16,14 @@
//! Bevel's side (face `side`) lie on its walls and bevels unrolled the same way, x along the
//! outline and y from the front toward the back, drawn on the pieces of the side of the solid with
//! the longest outline.
//!
//! On Inflate the graphics lie on the puffed front, and on the puffed back when Both Sides is on:
//! each is placed in the art's plane as on Extrude & Bevel's caps and carried straight out onto
//! the surface above it, so it follows the puff. Each piece of the surface draws the part of the
//! graphics that falls on it, as on Revolve's side, and the twist and taper carry the back's
//! graphics with the back.
use std::borrow::Cow;
use std::sync::Arc;
use serde_json::{Map, Value, json};
@@ -24,7 +31,7 @@ use vectorcraft_doc::color::{BlendMode, Paint};
use vectorcraft_doc::{Appearance, AppearanceItem, Document, FillLayer, Node, NodeId, NodeKind, Symbol};
use vectorcraft_geom::kurbo::{CubicBez, ParamCurve, PathEl, Shape};
use vectorcraft_geom::{Affine, BezPath, FillRule, PathData, Point, Rect, SubPath, Vec2};
use vectorcraft_three_d::{FaceMap, Facet, PlanarFace};
use vectorcraft_three_d::{DepthPlane, FaceMap, Facet, PlanarFace};
/// The effect parameter that holds the graphics.
pub const GRAPHICS: &str = "graphics";
@@ -50,7 +57,7 @@ const MAX_NESTING: usize = 8;
const MAX_LEVELS: usize = 4 * vectorcraft_doc::MAX_DEPTH;
/// The error for graphics on a 3D effect that takes none.
pub const NOT_TAKEN: &str = "Graphics map onto the Plane, Extrude and Revolve object types";
pub const NOT_TAKEN: &str = "Graphics map onto the Plane, Extrude, Revolve and Inflate object types";
/// The buckets around the unrolled side surface that the pieces of Revolve's graphics are sorted
/// into, so each face looks only at the pieces near it.
@@ -151,10 +158,10 @@ impl MappedGraphic {
}
}
/// The 3D effects that take graphics: Extrude & Bevel (its caps and its side), Rotate (the plane)
/// and Revolve (its swept side).
/// The 3D effects that take graphics: Extrude & Bevel (its caps and its side), Rotate (the plane),
/// Revolve (its swept side) and Inflate (its puffed front and back).
pub fn takes_graphics(id: &str) -> bool {
id == super::EXTRUDE || id == super::ROTATE || id == crate::REVOLVE
id == super::EXTRUDE || id == super::ROTATE || id == crate::REVOLVE || id == super::INFLATE
}
/// The graphics in parameters `p`, leaving out entries that are not valid (a file may hold
@@ -166,9 +173,9 @@ pub fn mapped_graphics(p: &Value) -> Vec<MappedGraphic> {
}
}
/// Are the graphics in parameters `p` of 3D effect `id` valid? Only Extrude & Bevel, Rotate and
/// Revolve take graphics; a plane has only a front, and Revolve's graphics go on its side, named
/// the front. Only Extrude & Bevel takes graphics on its side.
/// Are the graphics in parameters `p` of 3D effect `id` valid? Only Extrude & Bevel, Rotate,
/// Revolve and Inflate take graphics; a plane has only a front, and Revolve's graphics go on its
/// side, named the front. Only Extrude & Bevel takes graphics on its side.
pub fn validate(id: &str, p: &Value) -> Result<(), String> {
// Map Art's maps are checked with the graphics: an effect that takes none refuses them.
map_art::validate(id, p)?;
@@ -194,6 +201,9 @@ pub fn validate(id: &str, p: &Value) -> Result<(), String> {
if id == crate::REVOLVE && g.face != PlanarFace::Front {
return Err("Revolve maps graphics onto its side: map them onto the front".into());
}
if id == super::INFLATE && g.face == PlanarFace::Side {
return Err("Inflate maps graphics onto its front and back, not onto a side".into());
}
}
Ok(())
}
@@ -629,10 +639,11 @@ struct Unrolled {
place: Affine,
}
/// The areas of `graphics` on `face` (the front, for Revolve's side, or Extrude & Bevel's side)
/// placed on the unrolled side surface, cut into straight pieces. A graphic whose symbol `doc` does
/// not have, or whose art is past the limits of [`pieces_of`], is left out. `None` when the pieces
/// take more than [`MAX_ELEMENTS`] points together.
/// The areas of `graphics` on `face` (the front, for Revolve's side; Extrude & Bevel's side;
/// Inflate's front or back) placed on the unrolled side surface, or in the art's plane about the
/// center of the object's bounds, cut into straight pieces. A graphic whose symbol `doc` does not
/// have, or whose art is past the limits of [`pieces_of`], is left out. `None` when the pieces take
/// more than [`MAX_ELEMENTS`] points together.
fn unrolled(doc: &Document, graphics: &[MappedGraphic], face: PlanarFace) -> Option<Vec<Unrolled>> {
let mut pieces = vec![];
let mut points = 0usize;
@@ -713,9 +724,9 @@ fn straight_pieces(path: &BezPath, points: &mut usize) -> Option<Vec<Vec<Point>>
(*points <= MAX_ELEMENTS).then_some(polygons)
}
/// Do the graphics on `face` in parameters `p` (the front of Revolve, Extrude & Bevel's side) fit
/// the limits with the symbols of `doc`? Their art, cut into straight pieces on the side surface,
/// may take up to [`MAX_ELEMENTS`] points together.
/// Do the graphics on `face` in parameters `p` (the front of Revolve; Extrude & Bevel's side;
/// Inflate's front or back) fit the limits with the symbols of `doc`? Their art, cut into straight
/// pieces on the surface, may take up to [`MAX_ELEMENTS`] points together.
pub(crate) fn validate_surface_symbols(doc: &Document, p: &Value, face: PlanarFace) -> Result<(), String> {
let list = mapped_graphics(p);
if !list.iter().any(|g| g.face == face) || unrolled(doc, &list, face).is_some() {
@@ -724,16 +735,16 @@ pub(crate) fn validate_surface_symbols(doc: &Document, p: &Value, face: PlanarFa
Err("The graphics are too complex: simplify the symbols' art".into())
}
/// A face of a side surface that graphics are drawn on ([`surface_parts`]): a face of Revolve's
/// swept side, or a piece of Extrude & Bevel's walls and bevels.
/// A face of a surface that graphics are drawn on ([`surface_parts`]): a face of Revolve's swept
/// side, a piece of Extrude & Bevel's walls and bevels, or a piece of Inflate's front or back.
pub(crate) trait SurfaceFace {
/// Where the face lies on the side unrolled, when it is a face of the side that shows its
/// outside to the viewer.
/// Where the face lies on the surface, when it carries graphics and shows the surface's outside
/// to the viewer.
fn outer_cell(&self) -> Option<&vectorcraft_three_d::SurfaceCell>;
/// The outline the face's parts are cut to, when it is not the polygon of its cell's corners:
/// its curved outline, when its edges along an end are curved, or the outline of a piece cut
/// from a larger face.
fn curved(&self) -> Option<std::borrow::Cow<'_, PathData>>;
fn curved(&self) -> Option<Cow<'_, PathData>>;
fn rgb_light(&self) -> Option<vectorcraft_three_d::RgbGradient>;
fn light(&self) -> [f64; 3];
fn outline_path(&self) -> PathData;
@@ -743,8 +754,8 @@ impl SurfaceFace for vectorcraft_three_d::Face {
fn outer_cell(&self) -> Option<&vectorcraft_three_d::SurfaceCell> {
self.surface.as_ref().filter(|c| c.outward && !self.cap)
}
fn curved(&self) -> Option<std::borrow::Cow<'_, PathData>> {
self.outline.as_ref().map(std::borrow::Cow::Borrowed)
fn curved(&self) -> Option<Cow<'_, PathData>> {
self.outline.as_ref().map(Cow::Borrowed)
}
fn rgb_light(&self) -> Option<vectorcraft_three_d::RgbGradient> {
self.rgb_gradient
@@ -757,17 +768,18 @@ impl SurfaceFace for vectorcraft_three_d::Face {
}
}
/// A piece of Extrude & Bevel's side ([`Facet::surface`]).
impl SurfaceFace for Facet {
fn outer_cell(&self) -> Option<&vectorcraft_three_d::SurfaceCell> {
self.surface.as_ref().filter(|c| c.outward)
}
fn curved(&self) -> Option<std::borrow::Cow<'_, PathData>> {
fn curved(&self) -> Option<Cow<'_, PathData>> {
if let Some(outline) = &self.outline {
return Some(std::borrow::Cow::Borrowed(outline));
return Some(Cow::Borrowed(outline));
}
// A piece of a stroke's face cut where it passes through a wall keeps its face's cell.
let cut = self.surface.as_ref().is_some_and(|c| self.contours.len() != 1 || self.contours.first() != Some(&c.page));
cut.then(|| std::borrow::Cow::Owned(self.path()))
cut.then(|| Cow::Owned(self.path()))
}
fn rgb_light(&self) -> Option<vectorcraft_three_d::RgbGradient> {
self.rgb_gradient
@@ -780,18 +792,48 @@ impl SurfaceFace for Facet {
}
}
/// The parts of the graphics on `face` of `graphics` (the front of Revolve, Extrude & Bevel's side)
/// that fall on each of `faces`, a side surface's faces in drawing order, for an object with id
/// `id`: for each face, the nodes to draw right after it. Only faces of the side that show their
/// outside to the viewer carry a part, so a graphic narrows toward the silhouette, is hidden past
/// it and is covered by the nearer faces drawn after it. `shade` gives the paint of a solid color
/// on a face, as the surface under it is shaded; the colors of gradients and patterns are
/// multiplied by the face's light. A graphic whose symbol `doc` does not have, or that is past the
/// limits of its art, draws nothing. `None` past [`MAX_ELEMENTS`] points together before they are
/// cut at the faces, [`MAX_SURFACE_POINTS`] after, [`MAX_SURFACE_CUTS`] points cut, or when the
/// copies of their paints in the parts take `copies`, the bytes of the copies of the object's
/// graphics so far, past Revolve's budget for them: commands refuse such graphics, and a loaded
/// file draws the surface without them.
/// A piece of Inflate's front or back ([`Facet::membrane`]) that carries graphics on `face` only.
pub(crate) struct OnFace<'a> {
pub(crate) facet: &'a Facet,
pub(crate) face: PlanarFace,
}
impl SurfaceFace for OnFace<'_> {
fn outer_cell(&self) -> Option<&vectorcraft_three_d::SurfaceCell> {
self.facet.surface.as_ref().filter(|c| c.outward && self.facet.membrane == Some(self.face))
}
fn curved(&self) -> Option<Cow<'_, PathData>> {
if let Some(outline) = &self.facet.outline {
return Some(Cow::Borrowed(outline));
}
// A piece of a stroke's face cut where it passes through another face keeps its face's
// cell, and its parts are cut to its own outline.
let cut = self.facet.surface.as_ref().is_some_and(|c| self.facet.contours.len() != 1 || self.facet.contours.first() != Some(&c.page));
cut.then(|| Cow::Owned(self.facet.path()))
}
fn rgb_light(&self) -> Option<vectorcraft_three_d::RgbGradient> {
self.facet.rgb_gradient
}
fn light(&self) -> [f64; 3] {
self.facet.illumination
}
fn outline_path(&self) -> PathData {
self.facet.path()
}
}
/// The parts of the graphics on `face` of `graphics` (the front of Revolve; Extrude & Bevel's side;
/// Inflate's front or back) that fall on each of `faces`, a surface's faces in drawing order, for
/// an object with id `id`: for each face, the nodes to draw right after it. Only faces of the
/// surface that show their outside to the viewer carry a part, so a graphic narrows toward the
/// silhouette, is hidden past it and is covered by the nearer faces drawn after it.
/// `shade` gives the paint of a solid color on a face, as the surface under it is shaded; the
/// colors of gradients and patterns are multiplied by the face's light. A graphic whose symbol
/// `doc` does not have, or that is past the limits of its art, draws nothing. `None` past
/// [`MAX_ELEMENTS`] points together before they are cut at the faces, [`MAX_SURFACE_POINTS`]
/// after, [`MAX_SURFACE_CUTS`] points cut, or when the copies of their paints in the parts take
/// `copies`, the bytes of the copies of the object's graphics so far, past Revolve's budget for
/// them: commands refuse such graphics, and a loaded file draws the surface without them.
pub(crate) fn surface_parts<F: SurfaceFace>(
doc: Option<&Document>,
id: NodeId,
@@ -1092,13 +1134,22 @@ pub(super) fn art_bounds(doc: &Document, name: &str) -> Option<Rect> {
/// Where a 3D object's graphics are drawn: the bounds its solids are built with (the graphics'
/// offsets are from their center), the maps of its front and back faces, when it has them, and
/// the visible part of its side unrolled, when it has graphics there.
/// the visible part of its side unrolled, when it has graphics there, and for Inflate the pieces of
/// its puffed faces the viewer sees.
#[derive(Clone, Debug, PartialEq)]
pub struct GraphicFrame {
pub bounds: Rect,
front: Option<FaceMap>,
back: Option<FaceMap>,
side: Option<SideFrame>,
membrane: Option<MembraneFrame>,
}
/// Does triangle `t` hold point `q`, its edges included?
fn in_triangle(t: &[Point; 3], q: Point) -> bool {
let side = |a: Point, b: Point| (b - a).cross(q - a);
let s = [side(t[0], t[1]), side(t[1], t[2]), side(t[2], t[0])];
s.iter().all(|v| *v >= -1e-9) || s.iter().all(|v| *v <= 1e-9)
}
/// The pieces of Extrude & Bevel's side that show their outside to the viewer, as the graphics are
@@ -1137,11 +1188,6 @@ impl SideFrame {
/// triangle of its corners on the same side of its diagonal from corner 0 to corner 2, grown and
/// cut to its outline as [`surface_parts`] cuts the parts. `None` when no piece holds it.
fn map(&self, p: Point, from_page: bool) -> Option<Point> {
let inside = |t: &[Point; 3], q: Point| {
let side = |a: Point, b: Point| (b - a).cross(q - a);
let s = [side(t[0], t[1]), side(t[1], t[2]), side(t[2], t[0])];
s.iter().all(|v| *v >= -1e-9) || s.iter().all(|v| *v <= 1e-9)
};
let mut best: Option<(Point, f64)> = None;
for piece in &self.pieces {
let (from, to) = if from_page { (&piece.page, &piece.uv) } else { (&piece.uv, &piece.page) };
@@ -1150,7 +1196,7 @@ impl SideFrame {
let pick = |of: &[Point]| Some([*of.get(corners[0])?, *of.get(corners[1])?, *of.get(corners[2])?]);
let (Some(a), Some(b)) = (pick(from), pick(to)) else { continue };
let window = if piece.outline.is_some() { grown(a, 3.0) } else { a };
if !inside(&window, p) {
if !in_triangle(&window, p) {
continue;
}
// A four-cornered piece's two triangles meet along its diagonal: each holds its side.
@@ -1176,9 +1222,136 @@ impl SideFrame {
}
}
/// The pieces of Inflate's front and puffed back that show their outside to the viewer, as the
/// graphics are drawn on them ([`surface_parts`]): each piece's face, its corners in the art's plane
/// (offsets from the center of the object's bounds) and on the page, its depth (larger is nearer)
/// and its plane, for its depth at a point of the page. The other facets the viewer sees (the
/// sides, and pieces that show the surface's inside) are kept as `covers`, for where they hide
/// a piece.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct MembraneFrame {
pieces: Vec<MembranePiece>,
covers: Vec<Cover>,
}
/// A facet that can hide a piece of Inflate's front or back: its contours on the page (nonzero
/// winding), its depth, its plane and its place among the solid's facets.
#[derive(Clone, Debug, PartialEq)]
struct Cover {
contours: Vec<Vec<Point>>,
depth: f64,
plane: Option<DepthPlane>,
index: usize,
}
impl Cover {
/// Does the facet hold page point `p`?
fn holds(&self, p: Point) -> bool {
let mut winding = 0i32;
for c in &self.contours {
for (a, b) in c.iter().zip(c.iter().cycle().skip(1)).take(c.len()) {
let side = (*b - *a).cross(p - *a);
if a.y <= p.y && b.y > p.y && side > 0.0 {
winding += 1;
} else if a.y > p.y && b.y <= p.y && side < 0.0 {
winding -= 1;
}
}
}
winding != 0
}
}
#[derive(Clone, Debug, PartialEq)]
struct MembranePiece {
face: PlanarFace,
uv: [Point; 3],
page: [Point; 3],
depth: f64,
plane: Option<DepthPlane>,
/// The piece's place among the solid's facets: of two facets drawn last, the later one is drawn
/// over the other.
index: usize,
}
impl MembranePiece {
/// The piece's depth at page point `p`: its plane's depth there, or its own depth when it has
/// no plane or the plane gives none.
fn depth_at(&self, p: Point) -> f64 {
self.plane.and_then(|plane| plane.depth_at(p)).unwrap_or(self.depth)
}
}
impl MembraneFrame {
/// The pieces of `facets` that carry where they lie in the art's plane and show the outside of
/// Inflate's front or back, and the other facets not turned away from the viewer as covers.
pub(super) fn of<'a>(facets: impl IntoIterator<Item = &'a Facet>) -> Self {
let (mut pieces, mut covers) = (Vec::new(), Vec::new());
for (index, f) in facets.into_iter().enumerate() {
let piece = f.membrane.zip(f.surface.as_ref().filter(|c| c.outward)).and_then(|(face, cell)| {
let uv = <[Point; 3]>::try_from(cell.uv.as_slice()).ok()?;
let page = <[Point; 3]>::try_from(cell.page.as_slice()).ok()?;
Some(MembranePiece { face, uv, page, depth: f.depth, plane: f.plane, index })
});
match piece {
Some(piece) => pieces.push(piece),
None if !f.away => covers.push(Cover { contours: f.contours.clone(), depth: f.depth, plane: f.plane, index }),
None => {}
}
}
Self { pieces, covers }
}
/// Point `p` of `face` in the art's plane mapped onto the page, or with `from_page` a page point
/// mapped into the art's plane, through the piece of that face that holds it and is nearest at
/// that point of the page. `None` when no piece the viewer sees holds it, or when another nearer
/// piece, of either face, or a nearer cover hides that point of the page.
fn map(&self, face: PlanarFace, p: Point, from_page: bool) -> Option<Point> {
let inside = in_triangle;
let mut best: Option<(Point, f64, &MembranePiece)> = None;
for piece in self.pieces.iter().filter(|piece| piece.face == face) {
let (from, to) = if from_page { (&piece.page, &piece.uv) } else { (&piece.uv, &piece.page) };
if !inside(from, p) {
continue;
}
let Some(q) = triangle_map(from, to).map(|m| m * p).filter(|q| q.is_finite()) else { continue };
let depth = piece.depth_at(if from_page { p } else { q });
// A piece drawn last is drawn over every other one, and the later of two drawn last is
// drawn over the other, whatever their planes' depths.
let over = |(_, nearest, other): (Point, f64, &MembranePiece)| match (piece.depth == f64::MAX, other.depth == f64::MAX) {
(true, true) => piece.index > other.index,
(true, false) => true,
(false, true) => false,
(false, false) => depth > nearest,
};
if best.is_none_or(over) {
best = Some((q, depth, piece));
}
}
let (q, depth, shown) = best?;
let at = if from_page { p } else { q };
// A facet drawn last (depth `f64::MAX`) is drawn over every other one, and over another
// drawn last before it. Otherwise, where the front, the back and the sides meet, they give
// the same depth there, and only a facet clearly nearer covers.
let hides = |raw: f64, there: f64, index: usize| match (raw == f64::MAX, shown.depth == f64::MAX) {
(true, true) => index > shown.index,
(true, false) => true,
(false, true) => false,
(false, false) => there > depth + 1e-6 * depth.abs().max(1.0),
};
let covered = self
.pieces
.iter()
.filter(|piece| !std::ptr::eq(*piece, shown))
.any(|piece| inside(&piece.page, at) && hides(piece.depth, piece.depth_at(at), piece.index))
|| self.covers.iter().any(|c| c.holds(at) && hides(c.depth, c.plane.and_then(|plane| plane.depth_at(at)).unwrap_or(c.depth), c.index));
(!covered).then_some(q)
}
}
impl GraphicFrame {
pub(super) fn new(bounds: Rect, front: Option<FaceMap>, back: Option<FaceMap>) -> Self {
Self { bounds, front, back, side: None }
Self { bounds, front, back, side: None, membrane: None }
}
/// The frame with the visible part of the side `side`, for its graphics' handles.
@@ -1186,6 +1359,12 @@ impl GraphicFrame {
Self { side: Some(side), ..self }
}
/// The frame of an Inflate object built about `bounds`, whose graphics are drawn on the pieces
/// of `membrane`.
pub(super) fn inflated(bounds: Rect, membrane: MembraneFrame) -> Self {
Self { bounds, front: None, back: None, side: None, membrane: Some(membrane) }
}
pub fn map(&self, face: PlanarFace) -> Option<&FaceMap> {
match face {
PlanarFace::Front => self.front.as_ref(),
@@ -1208,27 +1387,34 @@ impl GraphicFrame {
/// Where graphic `g`'s center lands on the page, and whether its face is turned toward the
/// viewer. `None` when the object has no such face or the point has no page point. A graphic on
/// the side lands where its center is on the part of the side the viewer sees, and is `None`
/// elsewhere.
/// elsewhere. On Inflate the center lands on the puffed face above it, and is `None` where the
/// viewer does not see that face.
pub fn handle(&self, g: &MappedGraphic) -> Option<(Point, bool)> {
if g.face == PlanarFace::Side {
return Some((self.side.as_ref()?.map(Point::new(g.x, g.y), false)?, true));
}
if let Some(membrane) = &self.membrane {
let uv = if g.face == PlanarFace::Back { Point::new(-g.x, g.y) } else { Point::new(g.x, g.y) };
return Some((membrane.map(g.face, uv, false)?, true));
}
let map = self.map(g.face)?;
Some((map.to_page(self.art_point(g.face, (g.x, g.y)))?, map.visible))
}
/// The offset of a graphic on `face` whose center lands on page point `page`. On the side, only
/// a point on the part of the side the viewer sees has one.
/// a point on the part of the side the viewer sees has one, and on Inflate only a point on the
/// part of the puffed face the viewer sees.
pub fn offset_at(&self, face: PlanarFace, page: Point) -> Option<(f64, f64)> {
let art = match face {
PlanarFace::Side => self.side.as_ref()?.map(page, true)?,
_ => self.map(face)?.to_art(page)?,
};
let c = self.bounds.center();
let (x, y) = match face {
PlanarFace::Front => (art.x - c.x, art.y - c.y),
PlanarFace::Back => (c.x - art.x, art.y - c.y),
PlanarFace::Side => (art.x, art.y),
let (x, y) = if face == PlanarFace::Side {
let art = self.side.as_ref()?.map(page, true)?;
(art.x, art.y)
} else if let Some(membrane) = &self.membrane {
let uv = membrane.map(face, page, true)?;
if face == PlanarFace::Back { (-uv.x, uv.y) } else { (uv.x, uv.y) }
} else {
let art = self.map(face)?.to_art(page)?;
let c = self.bounds.center();
if face == PlanarFace::Back { (c.x - art.x, art.y - c.y) } else { (art.x - c.x, art.y - c.y) }
};
(x.abs() <= MAX_OFFSET && y.abs() <= MAX_OFFSET).then_some((x, y))
}
+52
View File
@@ -587,6 +587,30 @@ fn drawn_face_bounds(f: &Node) -> Rect {
}
}
/// Under a colored light, an Inflate in a solid color with a graphic on its front lies over an
/// underlay of its faces, the faces that carry parts of the graphic included.
#[test]
fn a_colored_inflate_with_a_graphic_lies_over_an_underlay_of_its_faces() {
let mut d = Document::new(1000.0, 1000.0);
let mark = Node::path(
NodeId(0),
vectorcraft_geom::shapes::rectangle(Rect::new(500.0, 500.0, 510.0, 510.0)),
Appearance::basic(Paint::solid(BLUE), Paint::None, 0.0),
);
d.symbols.push(vectorcraft_doc::Symbol { dynamic: false, name: "Mark".into(), art: Arc::new(mark) });
let square = vectorcraft_geom::shapes::rectangle(Rect::new(0.0, 0.0, 100.0, 100.0));
let mut n = Node::path(NodeId(7), square, Appearance::basic(Paint::solid(RED), Paint::None, 0.0));
let p = json!({"rotationX": -20, "rotationY": -30, "rotationZ": 0, "lights": [{"color": "#ff8080"}], "graphics": [{"symbol": "Mark", "scale": 300.0}]});
n.appearance.effects.push(fx(INFLATE, p));
let art = solid_art_in(Some(&d), &n).unwrap();
let order = art.children().unwrap()[0].children().unwrap();
let faces: Vec<Arc<Node>> = order.iter().flat_map(unsealed).collect();
assert!(faces.len() > order.len(), "the faces lie over an underlay");
let carrying = faces.iter().filter(|f| matches!(f.kind, NodeKind::Group { clip: false, .. })).count();
assert!(carrying > 0, "faces carry parts of the graphic");
assert!(order.iter().all(|run| !Arc::ptr_eq(&unsealed(run)[0], run)), "every face is in a sealed run");
}
/// Under a light that is not white, a solid-color fill and a solid-color stroke, plain, dashed or
/// with a width profile, draw their faces in one order, the faces of both solids in the order of
/// their depths where they overlap, in Inflate and in Extrude & Bevel, with and without perspective
@@ -775,6 +799,7 @@ fn a_stroke_face_through_a_fill_wall_is_cut_where_their_depths_meet() {
away: false,
end: None,
surface: None,
membrane: None,
plane: Some(DepthPlane { normal, offset, center: Point::ZERO, eye: None }),
cell: None,
};
@@ -1206,6 +1231,33 @@ fn a_groups_solids_together_past_the_limit_draw_the_source() {
assert_eq!(three_d_wireframe_in(None, &past), Err(vectorcraft_three_d::TOO_COMPLEX_SOLID.to_string()));
}
/// An Inflate group whose second member's fill is past the limits draws its source art, and its
/// frame places no graphic handle on the first member's puff.
#[test]
fn an_inflate_frame_places_no_handle_when_a_fill_is_past_the_limits() {
let mut b = BezPath::new();
b.move_to((0.0, 0.0));
b.line_to((40_000.0, 0.0));
b.line_to((40_000.0, 40_000.0));
b.line_to((0.0, 40_000.0));
b.close_path();
let square = Node::path(NodeId(1), PathData::from_bezpath(&b), Appearance::basic(Paint::solid(RED), Paint::None, 0.0));
let view = json!({"rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0});
let group = |members: Vec<Node>| {
let mut g = Node::group(NodeId(9999), members.into_iter().map(Arc::new).collect());
g.appearance.effects.push(fx(INFLATE, view.clone()));
g
};
let center = MappedGraphic::from_value(&json!({"symbol": "Mark"})).unwrap();
// The square alone builds, and the graphic's handle sits on its puff.
let alone = group(vec![square.clone()]);
assert!(graphic_frame(None, &alone, None).unwrap().handle(&center).is_some());
// 70,000 corners: more points than a fill's solid takes.
let past = group(vec![square, polygon_node(2, 70_000)]);
assert!(solid_art(&past).is_none(), "the source art draws");
assert!(graphic_frame(None, &past, None).unwrap().handle(&center).is_none());
}
/// A fill and strokes whose solids each fit, but not all of them together, draw the source art,
/// and the strokes after the one past the limit are not left out to make room.
#[test]
+207 -1
View File
@@ -505,6 +505,31 @@ fn the_symbol_check_counts_what_the_view_draws() {
assert!(validate_three_d_in(Some(&dense_document(true)), &n, EXTRUDE, &flat).is_ok());
}
#[test]
fn a_wireframe_is_not_refused_for_graphics_it_does_not_draw() {
let check = |d: &Document, id: &str, mut p: Value, wire: bool| {
if wire {
p["render"] = json!({"mode": "wireframe"});
}
validate_three_d_in(Some(d), &object(id, p.clone()), id, &p)
};
// The straight 30,000-sided polygon at 1000% fits the symbol limit, but cut into pieces on
// Inflate's puffed front it is too complex.
let straight = dense_document(false);
let big = json!({"perspectiveAngle": 0.0, "graphics": [{"symbol": "Dense", "scale": 1000.0}]});
assert!(validate_symbols(&straight, &big).is_ok());
let e = check(&straight, INFLATE, big.clone(), false).unwrap_err();
assert!(e.contains("too complex"), "{e}");
// Two copies of the curved one under a perspective are past the symbol limit on Extrude & Bevel.
let curved = dense_document(true);
let two = json!({"perspectiveAngle": 60.0, "graphics": [{"symbol": "Dense"}, {"symbol": "Dense", "face": "back"}]});
let e = check(&curved, EXTRUDE, two.clone(), false).unwrap_err();
assert!(e.contains("too complex"), "{e}");
// A wireframe draws the faces' edges and no graphics, so neither is checked.
assert_eq!(check(&straight, INFLATE, big, true), Ok(()));
assert_eq!(check(&curved, EXTRUDE, two, true), Ok(()));
}
#[test]
fn a_plane_and_a_hollow_solid() {
let d = document();
@@ -548,7 +573,9 @@ fn graphics_are_checked() {
}
assert!(check(ROTATE, json!([{"symbol": "Mark", "face": "back"}])).is_err());
assert!(check(ROTATE, json!([{"symbol": "Mark", "face": "side"}])).is_err());
assert!(check(INFLATE, json!([{"symbol": "Mark"}])).is_err());
// Inflate takes graphics on its front and its puffed back, and none on a side.
assert!(check(INFLATE, json!([{"symbol": "Mark"}, {"symbol": "Mark", "face": "back"}])).is_ok());
assert!(check(INFLATE, json!([{"symbol": "Mark", "face": "side"}])).is_err());
// Revolve takes graphics on its side, named the front; Revolve (Classic) takes none.
assert!(validate_three_d_params(crate::REVOLVE, &json!({"graphics": [{"symbol": "Mark"}]})).is_ok());
assert!(validate_three_d_params(crate::REVOLVE, &json!({"graphics": [{"symbol": "Mark", "face": "back"}]})).is_err());
@@ -579,6 +606,10 @@ fn a_change_to_a_plane_drops_the_back_caps_graphics() {
// Revolve drops the side's graphics too; Extrude & Bevel keeps every face's.
assert_eq!(three_d_params_as(EXTRUDE, &p, crate::REVOLVE)["graphics"], json!([{"symbol": "Mark", "face": "front"}]));
assert_eq!(three_d_params_as(EXTRUDE, &p, EXTRUDE)["graphics"], p["graphics"]);
// Inflate keeps the front's and the back's graphics and drops the side's.
let inflated = three_d_params_as(EXTRUDE, &p, INFLATE);
assert_eq!(inflated["graphics"], json!([{"symbol": "Mark", "face": "front"}, {"symbol": "Mark", "face": "back"}]));
assert!(validate_three_d_params(INFLATE, &inflated).is_ok());
// Back to Extrude & Bevel, the front's graphic stays.
assert_eq!(three_d_params_as(ROTATE, &plane, EXTRUDE)["graphics"], plane["graphics"]);
}
@@ -981,3 +1012,178 @@ fn only_an_opaque_part_on_revolve_takes_a_seam_stroke() {
// A pattern's tile may hold transparent art, which the overlap would show.
assert!(!takes_seam(&piece(Paint::Pattern { pattern: "Dots".into(), xf: Affine::IDENTITY }, 1.0, BlendMode::Normal)));
}
/// The paths in `art` filled in a shade of red: the parts of the "Mark" graphic.
fn red_parts(art: &Node) -> Vec<PathData> {
let mut out = vec![];
art.walk(&mut |n| {
let Some(path) = n.path_data() else { return };
let red = n.appearance.items.iter().any(|i| match i {
AppearanceItem::Fill(f) => f.paint.color().is_some_and(|c| c.to_rgb()[0] > 0.3 && c.to_rgb()[1] < 0.1 && c.to_rgb()[2] < 0.1),
AppearanceItem::Stroke(_) => false,
});
if red {
out.push(path.clone());
}
});
out
}
fn reach(parts: &[PathData]) -> Rect {
parts.iter().filter_map(PathData::bounds).reduce(|a, b| a.union(b)).unwrap()
}
#[test]
fn an_inflate_graphic_lies_on_its_puffed_front_where_the_art_is() {
let d = document();
let n = object(INFLATE, json!({"graphics": [{"symbol": "Mark", "x": 20.0, "y": -10.0, "scale": 200.0}]}));
let art = solid_art_in(Some(&d), &n).unwrap();
// Straight on, the puff rises toward the viewer and the graphic is carried straight out onto it:
// a 20 × 20 square centered 20 right of and 10 above (50, 50).
let parts = red_parts(&art);
assert!(!parts.is_empty());
assert!(close(reach(&parts), Rect::new(60.0, 30.0, 80.0, 50.0)), "{:?}", reach(&parts));
// Turned, the graphic moves and foreshortens with the puff under it.
let n = object(INFLATE, json!({"rotationY": 40.0, "graphics": [{"symbol": "Mark", "scale": 200.0}]}));
let turned = reach(&red_parts(&solid_art_in(Some(&d), &n).unwrap()));
assert!(turned.width() < 20.0 - 0.5 && (turned.height() - 20.0).abs() < 2.0, "{turned:?}");
// Without the document nothing is drawn.
assert!(red_parts(&solid_art_in(None, &n).unwrap()).is_empty());
}
#[test]
fn an_inflate_back_takes_its_graphic_with_both_sides_and_twist_carries_it() {
let d = document();
let back = |extra: Value| {
let mut p = json!({"rotationY": 180.0, "graphics": [{"symbol": "Mark", "face": "back", "x": 20.0, "scale": 200.0}]});
p.as_object_mut().unwrap().extend(extra.as_object().unwrap().clone());
red_parts(&solid_art_in(Some(&d), &object(INFLATE, p)).unwrap())
};
// Without Both sides the back is flat and open, with no puffed face to carry the graphic.
assert!(back(json!({})).is_empty());
// Seen from behind, the back reads left to right: 20 to the right as seen from behind is 20 to
// the left of the art's center, which turned half a turn lies 20 right on the page.
let plain = back(json!({"bothSides": true}));
assert!(!plain.is_empty());
let r = reach(&plain);
assert!((r.center().x - 70.0).abs() < 0.5 && (r.center().y - 50.0).abs() < 0.5 && (r.width() - 20.0).abs() < 0.5, "{r:?}");
// Twist turns the back, and the graphic turns with it.
let twisted = reach(&back(json!({"bothSides": true, "twist": 45.0})));
assert!(twisted.width() > r.width() + 3.0, "{twisted:?} {r:?}");
}
#[test]
fn an_inflate_frame_puts_the_handle_on_the_puff_and_reads_it_back() {
let d = document();
let n = object(INFLATE, json!({"bothSides": true}));
let frame = graphic_frame(Some(&d), &n, None).unwrap();
let g = MappedGraphic::from_value(&json!({"symbol": "Mark", "x": 20.0, "y": -10.0})).unwrap();
let (page, shown) = frame.handle(&g).unwrap();
assert!(shown && (page.x - 70.0).abs() < 1e-6 && (page.y - 40.0).abs() < 1e-6, "{page:?}");
let (x, y) = frame.offset_at(PlanarFace::Front, page).unwrap();
assert!((x - 20.0).abs() < 1e-6 && (y + 10.0).abs() < 1e-6, "{x} {y}");
// From the front the back is out of sight: it has no handle and no offset.
let g = MappedGraphic::from_value(&json!({"symbol": "Mark", "face": "back"})).unwrap();
assert!(frame.handle(&g).is_none());
assert!(frame.offset_at(PlanarFace::Back, Point::new(50.0, 50.0)).is_none());
// Turned half a turn, the back's handle reads back its offset, as seen from behind.
let n = object(INFLATE, json!({"bothSides": true, "rotationY": 180.0}));
let frame = graphic_frame(Some(&d), &n, None).unwrap();
let g = MappedGraphic::from_value(&json!({"symbol": "Mark", "face": "back", "x": 15.0, "y": 5.0})).unwrap();
let (page, _) = frame.handle(&g).unwrap();
let (x, y) = frame.offset_at(PlanarFace::Back, page).unwrap();
assert!((x - 15.0).abs() < 1e-6 && (y - 5.0).abs() < 1e-6, "{x} {y}");
}
/// Where two pieces of an Inflate face overlap on the page, a point maps through the piece nearer
/// at that point, though the other is nearer at its center.
#[test]
fn overlapping_inflate_pieces_map_a_point_through_the_one_nearer_there() {
let page = [Point::new(0.0, 0.0), Point::new(20.0, 0.0), Point::new(10.0, 20.0)];
let piece = |shift: f64, depth: f64, normal: [f64; 3], offset: f64| MembranePiece {
face: PlanarFace::Front,
uv: page.map(|p| p + Vec2::new(shift, 0.0)),
page,
depth,
plane: Some(DepthPlane { normal, offset, center: Point::ORIGIN, eye: None }),
index: 0,
};
// The tilted piece is nearer at its center (depth 10) but at depth 0 where x is 10; the flat
// one lies at depth 5 everywhere.
let tilted = piece(0.0, 10.0, [1.0, 0.0, 1.0], 10.0);
let flat = piece(100.0, 5.0, [0.0, 0.0, 1.0], 5.0);
let frame = GraphicFrame::inflated(Rect::new(0.0, 0.0, 20.0, 20.0), MembraneFrame { pieces: vec![tilted, flat], covers: vec![] });
let (x, y) = frame.offset_at(PlanarFace::Front, Point::new(10.0, 5.0)).unwrap();
assert!((x - 110.0).abs() < 1e-6 && (y - 5.0).abs() < 1e-6, "{x} {y}");
// Near the tilted piece's left corner it is the nearer one.
let (x, _) = frame.offset_at(PlanarFace::Front, Point::new(2.0, 0.5)).unwrap();
assert!((x - 2.0).abs() < 1e-6, "{x}");
// A graphic's center has a handle only where its own piece is the nearer one, and the handle
// maps back to the same offset.
let mark = |x: f64, y: f64| MappedGraphic::from_value(&json!({"symbol": "Mark", "face": "front", "x": x, "y": y})).unwrap();
assert!(frame.handle(&mark(10.0, 5.0)).is_none());
for (x, y) in [(2.0, 0.5), (110.0, 5.0)] {
let (at, _) = frame.handle(&mark(x, y)).unwrap();
let (bx, by) = frame.offset_at(PlanarFace::Front, at).unwrap();
assert!((bx - x).abs() < 1e-6 && (by - y).abs() < 1e-6, "{x} {y}: {bx} {by}");
}
// Of two overlapping pieces drawn last, the later one is drawn over the other, though the
// earlier one's plane is nearer.
let last = |shift: f64, offset: f64, index: usize| MembranePiece { index, ..piece(shift, f64::MAX, [0.0, 0.0, 1.0], offset) };
let pieces = vec![last(0.0, 10.0, 0), last(100.0, 0.0, 1)];
let frame = GraphicFrame::inflated(Rect::new(0.0, 0.0, 20.0, 20.0), MembraneFrame { pieces, covers: vec![] });
let (x, _) = frame.offset_at(PlanarFace::Front, Point::new(10.0, 5.0)).unwrap();
assert!((x - 110.0).abs() < 1e-6, "{x}");
assert!(frame.handle(&mark(10.0, 5.0)).is_none());
assert!(frame.handle(&mark(110.0, 5.0)).is_some());
}
/// A graphic on Inflate's back has no handle where a nearer piece of the front covers its center
/// on the page, and the back has no offset there; where the back is nearer, it has both.
#[test]
fn an_inflate_back_graphic_covered_by_a_nearer_front_piece_has_no_handle() {
let page = [Point::new(0.0, 0.0), Point::new(20.0, 0.0), Point::new(10.0, 20.0)];
let piece = |face: PlanarFace, depth: f64| MembranePiece { face, uv: page, page, depth, plane: None, index: 0 };
let frame = |front: f64, back: f64| {
let pieces = vec![piece(PlanarFace::Front, front), piece(PlanarFace::Back, back)];
GraphicFrame::inflated(Rect::new(0.0, 0.0, 20.0, 20.0), MembraneFrame { pieces, covers: vec![] })
};
let g = MappedGraphic::from_value(&json!({"symbol": "Mark", "face": "back", "x": -10.0, "y": 5.0})).unwrap();
let covered = frame(10.0, 5.0);
assert!(covered.handle(&g).is_none());
assert!(covered.offset_at(PlanarFace::Back, Point::new(10.0, 5.0)).is_none());
assert!(covered.offset_at(PlanarFace::Front, Point::new(10.0, 5.0)).is_some());
let seen = frame(5.0, 10.0);
let (at, _) = seen.handle(&g).unwrap();
assert!((at.x - 10.0).abs() < 1e-6 && (at.y - 5.0).abs() < 1e-6, "{at:?}");
assert!(seen.offset_at(PlanarFace::Back, Point::new(10.0, 5.0)).is_some());
}
/// A nearer side facet that covers a graphic's center on Inflate's front hides its handle; one
/// behind the front, or beside the center, leaves it. A facet drawn last (a back cap) hides it
/// whatever its plane's depth, unless the front piece is drawn last too, after it.
#[test]
fn an_inflate_graphic_covered_by_a_nearer_side_has_no_handle() {
let page = [Point::new(0.0, 0.0), Point::new(20.0, 0.0), Point::new(10.0, 20.0)];
let front = |depth: f64, index: usize| MembranePiece { face: PlanarFace::Front, uv: page, page, depth, plane: None, index };
let side = |x0: f64, depth: f64, index: usize| Cover {
contours: vec![vec![Point::new(x0, 0.0), Point::new(x0 + 4.0, 0.0), Point::new(x0 + 4.0, 20.0), Point::new(x0, 20.0)]],
depth,
// A plane behind the front, as a back cap's is.
plane: Some(DepthPlane { normal: [0.0, 0.0, 1.0], offset: 1.0, center: Point::ORIGIN, eye: None }),
index,
};
let frame = |piece: MembranePiece, cover: Cover| {
GraphicFrame::inflated(Rect::new(0.0, 0.0, 20.0, 20.0), MembraneFrame { pieces: vec![piece], covers: vec![cover] })
};
let g = MappedGraphic::from_value(&json!({"symbol": "Mark", "face": "front", "x": 10.0, "y": 5.0})).unwrap();
let mut nearer = side(8.0, 10.0, 1);
nearer.plane = None;
assert!(frame(front(5.0, 0), nearer.clone()).handle(&g).is_none());
assert!(frame(front(5.0, 0), nearer).offset_at(PlanarFace::Front, Point::new(10.0, 5.0)).is_none());
assert!(frame(front(5.0, 0), side(8.0, 10.0, 1)).handle(&g).is_some());
assert!(frame(front(5.0, 0), side(14.0, 10.0, 1)).handle(&g).is_some());
assert!(frame(front(5.0, 0), side(8.0, f64::MAX, 1)).handle(&g).is_none());
assert!(frame(front(f64::MAX, 0), side(8.0, f64::MAX, 1)).handle(&g).is_none());
assert!(frame(front(f64::MAX, 2), side(8.0, f64::MAX, 1)).handle(&g).is_some());
}
@@ -185,6 +185,7 @@ fn a_piece_cut_from_a_face_draws_its_own_part() {
away: false,
end: None,
surface: Some(vectorcraft_three_d::SurfaceCell { page: square, uv, outward: true }),
membrane: None,
plane: Some(vectorcraft_three_d::DepthPlane { normal, offset, center: Point::ZERO, eye: None }),
cell: None,
}
@@ -207,6 +207,7 @@ fn art_on_a_facet_with_a_curved_edge_is_clipped_to_that_edge() {
end: None,
plane: None,
surface: None,
membrane: None,
cell: None,
};
let cell = MapCell { surface: 0, page: quad.clone(), uv: quad.clone() };
@@ -251,6 +252,7 @@ fn art_on_a_facet_whose_curved_edge_bows_out_covers_the_whole_facet() {
end: None,
plane: None,
surface: None,
membrane: None,
cell: None,
};
let cell = MapCell { surface: 0, page: quad.clone(), uv: quad };
@@ -290,6 +292,7 @@ fn the_bounds_tests_of_contours_away_from_a_cell_count_as_cuts() {
end: None,
plane: None,
surface: None,
membrane: None,
cell: None,
};
let cell = MapCell { surface: 0, page: quad.clone(), uv: quad };
+1 -1
View File
@@ -379,7 +379,7 @@ fn a_stroke_left_out_of_the_art_casts_no_shadow() {
let p = crate::merged_params(id, &json!({"shadow": true}));
let (parts, bounds) = solid_parts(&shapes, union_bounds(&shapes).unwrap());
let mut built: Vec<Option<SolidFaces>> =
built_solids_cast(id, &p, &parts, bounds, MAX_OBJECT_FACES, true, None).map(|r| r.unwrap().and_then(|(_, faces)| faces)).collect();
built_solids_cast(id, &p, &parts, bounds, MAX_OBJECT_FACES, true, false, None).map(|r| r.unwrap().and_then(|(_, faces)| faces)).collect();
let stroke = parts.iter().position(|(item, ..)| matches!(item, AppearanceItem::Stroke(_))).unwrap();
assert!(built.len() == 2 && built.iter().all(Option::is_some), "{id}");
let (both, _, cast) = cast_built(id, &p, &shapes, built.clone()).unwrap().unwrap();
+48
View File
@@ -178,6 +178,7 @@ pub const BUILTIN: &[BuiltinBrushLibrary] = &[
BuiltinBrushLibrary { id: "paint", name: "Paint", make: paint },
BuiltinBrushLibrary { id: "pattern-borders", name: "Pattern Borders", make: pattern_borders },
BuiltinBrushLibrary { id: "decorative", name: "Decorative", make: decorative },
BuiltinBrushLibrary { id: "ornamental", name: "Ornamental", make: ornamental },
BuiltinBrushLibrary { id: "scatter-shapes", name: "Scatter Shapes", make: scatter_shapes },
BuiltinBrushLibrary { id: "stipple", name: "Stipple", make: stipple },
BuiltinBrushLibrary { id: "game-trails", name: "Game Trails", make: game_trails },
@@ -733,6 +734,53 @@ fn decorative() -> BrushLibrary {
)
}
/// Ornamental: one-pass flourishes and arrow accents that stretch with the path rather than
/// repeating a pattern tile. Every shape is original filled vector art.
fn ornamental() -> BrushLibrary {
let scrollwork = group(vec![
black(band(100.0, 1.2, 64, |x| 2.6 * (x / 100.0 * std::f64::consts::TAU).sin())),
ring(Point::new(7.0, 0.0), 4.0, 2.0),
ring(Point::new(93.0, 0.0), 4.0, 2.0),
black(polygon(&[(28.0, 1.0), (34.0, -5.0), (40.0, -3.0), (33.0, 2.0)])),
black(polygon(&[(60.0, 3.0), (66.0, 5.0), (72.0, -1.0), (67.0, -2.0)])),
]);
let arrow = group(vec![
// The shaft runs into the head's notch at x = 85 so the two overlap.
black(shapes::rectangle(Rect::new(4.0, -0.7, 86.0, 0.7))),
black(polygon(&[(80.0, -6.5), (100.0, 0.0), (80.0, 6.5), (85.0, 0.0)])),
ring(Point::new(7.0, 0.0), 4.0, 1.7),
black(polygon(&[(25.0, -0.4), (31.0, -4.4), (37.0, -2.0), (31.0, 0.8)])),
black(polygon(&[(43.0, 0.4), (49.0, 4.4), (55.0, 2.0), (49.0, -0.8)])),
]);
let mut petals = vec![black(band(100.0, 1.0, 48, |x| 1.8 * (x / 100.0 * std::f64::consts::PI).sin()))];
for x in [19.0, 43.0, 67.0, 87.0] {
let y = 1.8 * (x / 100.0 * std::f64::consts::PI).sin();
petals.push(black(shapes::ellipse(Rect::new(x - 4.5, y - 7.5, x + 4.5, y - 0.3))));
petals.push(black(shapes::ellipse(Rect::new(x - 3.5, y + 0.3, x + 3.5, y + 5.5))));
}
let petal_sweep = group(petals);
let twin_curl = group(vec![
black(band(100.0, 0.9, 64, |x| -3.8 + 1.6 * (x / 100.0 * 2.0 * std::f64::consts::TAU).sin())),
black(band(100.0, 0.9, 64, |x| 3.8 - 1.6 * (x / 100.0 * 2.0 * std::f64::consts::TAU).sin())),
ring(Point::new(8.0, -3.8), 3.0, 1.5),
ring(Point::new(92.0, 3.8), 3.0, 1.5),
]);
let ornament = |name: &str, art: Node| Brush {
name: name.into(),
kind: BrushKind::Art(ArtBrush { art, width: 300.0, colorization: Colorization::Tints, ..Default::default() }),
};
built(
"Ornamental",
Document::new(100.0, 100.0),
vec![
ornament("Scrollwork", scrollwork),
ornament("Filigree Arrow", arrow),
ornament("Petal Sweep", petal_sweep),
ornament("Twin Curl", twin_curl),
],
)
}
fn scatter(name: &str, art: Node, s: Scatter) -> Brush {
Brush { name: name.into(), kind: BrushKind::Scatter(Scatter { art, ..s }) }
}
+19 -4
View File
@@ -40,7 +40,7 @@ mod trace;
pub use live_paint::live_paint_gaps;
pub(crate) use live_paint::{LivePaintMove, check_part_name, clear_part_name, isolated_live_paints, merge_drawn_in_isolation};
use live_paint::{lp_expand, lp_fill, lp_gap_options, lp_info, lp_make, lp_merge, lp_release, lp_stroke_edge};
use shape_builder::{sb_merge, sb_regions};
use shape_builder::{sb_copy_region, sb_merge, sb_regions};
pub(crate) use trace::TracePresetChanges;
pub use trace::{
TRACE_PRESET_EXTS, TRACE_PRESET_FORMAT, TRACE_PRESET_MAX_BYTES, TracePreset, TracePresetChange, TraceRun, Traced, image_trace_target,
@@ -72,6 +72,15 @@ pub fn specs() -> Vec<CommandSpec> {
has_selection_or_ids,
sb_regions
),
cmd!(
"shapeBuilder.copyRegion",
"Fill Area",
[],
None,
"{point: [x,y], ids?|id?: [id…] (the objects or layers whose paths bound areas; default: every layer, nothing needs to be selected), gap?: pt (0–72; 0: Gap Detection off; out of range is an error), openFilledAsClosed?: true (as shapeBuilder.merge), fill?, stroke?: \"#rrggbb\" | {color|swatch|gradient|none} (default: the current fill and stroke, with the current stroke weight)} add a new closed path of the area under point that the visible, unlocked paths enclose (the region of shapeBuilder.regions holding it: areas a shape already fills and areas open paths bound count too), directly above the front-most object along the area (its outline touches the area's outline, or it covers the area; when a group, Live Paint group, Shaper group or clipping group holds that path, above the outermost group in its layer, never inside it), and select it; in isolation mode only the paths of the isolated layer or group bound areas (with ids, only the paths of the listed objects that are in it), and the new path goes inside it, directly above the object in it that holds that path; no area is found while the isolated object is not a layer or group (a path or compound path), is a Live Paint group, compound shape, Shaper group, graph, Image Trace result, dimension, flare or Objects on Path group, is a layer or group with a live effect or a clipping mask, or lies inside one of these or inside an envelope; the paths around the area are not changed; a point in no enclosed area is an error and changes nothing (no undo step); when the paths together have more than 65,536 segments, only an area the paths near the point enclose is found → {id, above (the object the new path went above)}",
has_doc,
sb_copy_region
),
cmd!(
"livePaint.make",
"Make",
@@ -285,12 +294,18 @@ fn stroke_only(paint: Paint, width: f64) -> Appearance {
// ---------- Shape Builder ----------
fn fill_param(s: &Session, p: &Value, cmd: &str) -> Result<Option<Paint>> {
match p.get("fill") {
paint_param(s, p, "fill", cmd)
}
/// The paint `p` gives for `key` (`"#rrggbb"` or `{color|swatch|gradient|none}`), as `fill` is read.
fn paint_param(s: &Session, p: &Value, key: &str, cmd: &str) -> Result<Option<Paint>> {
match p.get(key) {
None | Some(Value::Null) => Ok(None),
Some(v @ Value::Object(o)) if o.contains_key("color") || o.contains_key("swatch") || o.contains_key("gradient") || o.contains_key("none") => {
paint_from(s, v)
// A paint key whose value is not a paint, such as `{"swatch": 123}`, gives no paint.
paint_from(s, v)?.map(Some).ok_or_else(|| bad(cmd, format!("bad {key} {v}")))
}
Some(v) => color_value(v).map(|c| Some(Paint::solid(super::paint::new_color(s, p, c)))).ok_or_else(|| bad(cmd, format!("bad fill {v}"))),
Some(v) => color_value(v).map(|c| Some(Paint::solid(super::paint::new_color(s, p, c)))).ok_or_else(|| bad(cmd, format!("bad {key} {v}"))),
}
}
@@ -1,7 +1,7 @@
use super::{
Arc, Beside, BuilderMap, EngineError, FillRule, Node, NodeId, PathData, Point, Rect, Result, Session, Touched, Value, b, bad, check_numbers,
f64_or, fill_param, finite, gap_param, ids_json, json, marquee_param, po, points_param, remnant, replace_leaves, replace_with_pieces, root_ids,
shape_node, switch_or,
f64_or, fill_param, finite, gap_param, ids_json, json, marquee_param, named_ids, number_or, outermost, paint_param, po, point_param,
points_param, remnant, replace_leaves, replace_with_pieces, root_ids, shape_node, switch_or,
};
pub(super) fn sb_merge(s: &mut Session, p: &Value) -> Result<Value> {
@@ -183,6 +183,49 @@ pub(super) fn sb_merge(s: &mut Session, p: &Value) -> Result<Value> {
Ok(out)
}
pub(super) fn sb_copy_region(s: &mut Session, p: &Value) -> Result<Value> {
const C: &str = "shapeBuilder.copyRegion";
let pt = point_param(p, "point").filter(|q| finite(*q)).ok_or_else(|| bad(C, "missing point [x,y]"))?;
let open_filled_as_closed = switch_or(p, "openFilledAsClosed", true, C)?;
let gap = number_or(p, "gap", 0.0, C)?;
if !(0.0..=po::SHAPE_BUILDER_MAX_GAP).contains(&gap) {
return Err(bad(C, format!("gap must be 0 to {} pt, not {gap}", po::SHAPE_BUILDER_MAX_GAP)));
}
let fill = paint_param(s, p, "fill", C)?.unwrap_or_else(|| s.paint.fill.clone());
let stroke = paint_param(s, p, "stroke", C)?.unwrap_or_else(|| s.paint.stroke.clone());
let look = s.new_art_look(fill, stroke, s.paint.stroke_width);
let area = {
let st = s.doc()?;
let d = &st.doc;
let named = match named_ids(p)? {
Some(ids) => {
if let Some(bad_id) = ids.iter().find(|i| d.node(**i).is_none()) {
return Err(EngineError::NoNode(*bad_id));
}
// An object listed with a layer or group that holds it counts once.
Some(outermost(d, ids))
}
None => None,
};
// In isolation mode only the isolated layer or group's paths bound areas, and the new path
// goes inside it.
b::fill_area_roots(d, st.isolation, named.as_deref())
.and_then(|(roots, scope)| b::AreaFinder::new(d, &roots, scope, gap, open_filled_as_closed).find(pt))
};
let Some(area) = area else { return Err(EngineError::Other("Fill Area: no enclosed area under the pointer".into())) };
let id = s.edit("Fill Area", |d, sel| {
let mut n = shape_node(d, area.path.clone(), None);
look.apply(d, &mut n);
let id = n.id;
let mut above = Beside::above(d, &[area.above]);
above.put(d, area.above, vec![n])?;
above.finish(d)?;
sel.set([id]);
Ok(id)
})?;
Ok(json!({ "id": id.0, "above": area.above.0 }))
}
pub(super) fn sb_regions(s: &mut Session, p: &Value) -> Result<Value> {
let open_filled_as_closed = switch_or(p, "openFilledAsClosed", true, "shapeBuilder.regions")?;
check_numbers(p, &["gap"], "shapeBuilder.regions")?;
+10 -2
View File
@@ -1,5 +1,6 @@
//! Window › 3D and Materials › Materials › Graphics: art kept as a document symbol (Add as Single
//! Graphic) and mapped onto 3D objects (Extrude & Bevel's caps, a plane, Revolve's side). The
//! Graphic) and mapped onto 3D objects (Extrude & Bevel's caps, a plane, Revolve's side, Inflate's
//! puffed front and back). The
//! graphics an object shows are the `graphics` parameter of its 3D effect, which `effect.setParams`
//! also edits.
@@ -28,7 +29,7 @@ pub(super) fn specs() -> Vec<CommandSpec> {
"Map Graphic",
[],
None,
"{symbol: name of a document symbol, face?: front|back|side (front; Plane has only a front; the back reads left to right as seen from behind; side is Extrude & Bevel's walls and bevels; on Revolve the front is its swept side, which is the only face), x?: pt, y?: pt (0, 0: the offset of the graphic's center from the center of the object's bounds, in the face's own plane; on a side from the middle of the side unrolled flat: on Extrude & Bevel x along the outline, clockwise from its top, and y from the front toward the back; on Revolve x around the axis and y along the profile), scale?: % (1..10000; default 100, or less so the graphic fits inside the object, on Extrude & Bevel's side inside the side unrolled about x = 0, short of its cut, on Revolve inside the half of the side seen from the front), rotation?: degrees (-360..360, 0; counterclockwise), index?: int (the 3D effect's position; default: each object's first 3D effect, its own before its fills' and strokes'), item?: appearance item index|null (refused without index; as effect.setParams), ids?|id?} add a graphic to the 3D effect of each selected object, drawn on that face turned, foreshortened and shaded with it and clipped to it (on a side wrapped around it, and drawn only where its outside faces the viewer); every object's 3D effect must be Extrude & Bevel (on a solid cap, or on the side, hollow or not), Rotate (the Plane type) or Revolve; one undo step → {ids, graphic}",
"{symbol: name of a document symbol, face?: front|back|side (front; Plane has only a front; the back reads left to right as seen from behind; side is Extrude & Bevel's walls and bevels; on Revolve the front is its swept side, which is the only face; on Inflate the back takes graphics only with Both sides and Cap on), x?: pt, y?: pt (0, 0: the offset of the graphic's center from the center of the object's bounds, in the face's own plane; on Inflate in the art's plane, the graphic carried straight out onto the puffed face; on a side from the middle of the side unrolled flat: on Extrude & Bevel x along the outline, clockwise from its top, and y from the front toward the back; on Revolve x around the axis and y along the profile), scale?: % (1..10000; default 100, or less so the graphic fits inside the object, on Extrude & Bevel's side inside the side unrolled about x = 0, short of its cut, on Revolve inside the half of the side seen from the front), rotation?: degrees (-360..360, 0; counterclockwise), index?: int (the 3D effect's position; default: each object's first 3D effect, its own before its fills' and strokes'), item?: appearance item index|null (refused without index; as effect.setParams), ids?|id?} add a graphic to the 3D effect of each selected object, drawn on that face turned, foreshortened and shaded with it and clipped to it (on a side wrapped around it, and on Inflate following the puff, Twist and Taper carrying the back's, each drawn only where its outside faces the viewer); every object's 3D effect must be Extrude & Bevel (on a solid cap, or on the side, hollow or not), Rotate (the Plane type), Revolve or Inflate; one undo step → {ids, graphic}",
has_doc,
map_graphic
),
@@ -134,6 +135,13 @@ fn map_graphic(s: &mut Session, p: &Value) -> Result<Value> {
if base.face != effects::PlanarFace::Front && extrude.is_some_and(|o| o.depth <= 0.0) {
return Err(bad(C, format!("object {}: with a depth of 0 the object has one face: map its graphics onto the front", id.0)));
}
// Inflate's back takes graphics where it puffs out: with Both sides and Cap on.
if base.face == effects::PlanarFace::Back && effect.id == effects::INFLATE {
let o = effects::inflate_options(&merged);
if !(o.both_sides && o.cap) {
return Err(bad(C, format!("object {}: Inflate's back takes graphics with Both sides and Cap on", id.0)));
}
}
let mut graphic = base.clone();
if p.get("scale").is_none()
&& let Some(art) = effects::graphic_bounds(d, &graphic.symbol)
@@ -95,10 +95,10 @@ fn map_graphic_puts_a_graphic_on_the_side_of_a_revolve() {
#[test]
fn map_graphic_refuses_what_cannot_take_it_and_changes_nothing() {
let (mut s, id) = setup("threeD.inflate");
let (mut s, id) = setup("threeD.classicExtrude");
let history = undo_len(&s);
let e = s.execute("threeD.mapGraphic", &json!({"symbol": "Mark", "ids": [id.0]})).unwrap_err().to_string();
assert!(e.contains("Plane, Extrude and Revolve"), "{e}");
assert!(e.contains("Plane, Extrude, Revolve and Inflate"), "{e}");
let (mut s, id) = setup("threeD.rotate");
for (p, says) in [
(json!({"symbol": "Gone"}), "no symbol named"),
@@ -188,11 +188,36 @@ fn set_params_edits_graphics_and_checks_them() {
let null = json!({"ids": [id.0], "index": 0, "item": null, "params": {"graphics": null}});
assert!(s.execute("effect.setParams", &null).is_err());
assert_eq!(graphics(&s, id), moved);
// Extrude to Plane keeps the graphics; to Inflate drops them.
// Extrude to Plane keeps the graphics, and so does Inflate.
s.execute("effect.setParams", &json!({"ids": [id.0], "index": 0, "item": null, "threeDType": "plane"})).unwrap();
assert_eq!(graphics(&s, id), moved);
s.execute("effect.setParams", &json!({"ids": [id.0], "index": 0, "item": null, "threeDType": "inflate"})).unwrap();
assert_eq!(graphics(&s, id), Value::Null);
assert_eq!(graphics(&s, id), moved);
}
#[test]
fn map_graphic_puts_a_graphic_on_an_inflate_and_its_back_only_with_both_sides() {
let (mut s, id) = setup("threeD.inflate");
let plain = {
let d = &s.doc().unwrap().doc;
vectorcraft_render::effects::solid_art_in(Some(d), d.node(id).unwrap())
};
let history = undo_len(&s);
s.execute("threeD.mapGraphic", &json!({"symbol": "Mark", "ids": [id.0]})).unwrap();
assert_eq!(graphics(&s, id), json!([{"symbol": "Mark", "face": "front", "x": 0.0, "y": 0.0, "scale": 100.0, "rotation": 0.0}]));
assert_eq!(undo_len(&s), history + 1);
let d = &s.doc().unwrap().doc;
assert_ne!(vectorcraft_render::effects::solid_art_in(Some(d), d.node(id).unwrap()), plain, "the graphic is drawn");
// The back is flat until Both sides puffs it.
let history = undo_len(&s);
let e = s.execute("threeD.mapGraphic", &json!({"symbol": "Mark", "face": "back", "ids": [id.0]})).unwrap_err().to_string();
assert!(e.contains("Both sides and Cap"), "{e}");
assert_eq!(undo_len(&s), history);
s.execute("effect.setParams", &json!({"ids": [id.0], "index": 0, "item": null, "params": {"bothSides": true, "cap": false}})).unwrap();
assert!(s.execute("threeD.mapGraphic", &json!({"symbol": "Mark", "face": "back", "ids": [id.0]})).is_err());
s.execute("effect.setParams", &json!({"ids": [id.0], "index": 0, "item": null, "params": {"cap": true}})).unwrap();
s.execute("threeD.mapGraphic", &json!({"symbol": "Mark", "face": "back", "ids": [id.0]})).unwrap();
assert_eq!(graphics(&s, id)[1]["face"], "back");
}
#[test]
@@ -574,6 +574,7 @@ pub(super) const ALLOWED: &[&str] = &[
"shape.spiral",
"shape.star",
"shape.threePointArc",
"shapeBuilder.copyRegion",
"shapeBuilder.merge",
"shapeBuilder.regions",
"shaper.expand",
+1 -1
View File
@@ -612,7 +612,7 @@ impl Line {
continue;
}
if t < 0.0 && !paints_as_one(&self) {
return self;
continue;
}
let mut tracked = self.clone();
tracked.tracking = t;
+25
View File
@@ -1392,6 +1392,31 @@ fn tracking_near_a_whole_number_is_kept_as_measured_when_rounding_moves_glyphs()
assert_same_places(&before, &text_of(&s, r["ids"][0].as_u64().unwrap()));
}
#[test]
fn a_tracking_translucent_glyphs_cannot_take_keeps_the_tracking_that_fits() {
// The first three glyphs are tracked 50 and the last 150 further on. A tracking tighter than
// zero is not tried for glyphs that cannot be one object, and the tracked prefix is kept.
let mut s = session();
let id = s.execute("text.create", &json!({"x": 40, "y": 100, "text": "MMMM", "size": 30})).unwrap()["id"].as_u64().unwrap();
s.execute("text.setRangeStyle", &json!({"id": id, "start": 0, "end": 2, "tracking": 50})).unwrap();
s.execute("text.setRangeStyle", &json!({"id": id, "start": 2, "end": 3, "tracking": 150})).unwrap();
s.execute("select.set", &json!({"ids": [id]})).unwrap();
let g = s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap();
let kids = children_of(&s, g);
s.edit("test", |d, _| {
for k in &kids {
d.node_mut(NodeId(*k)).unwrap().opacity = 0.5;
}
Ok(())
})
.unwrap();
s.execute("select.set", &json!({"ids": [g]})).unwrap();
let r = s.execute("type.retype", &json!({})).unwrap();
let texts: Vec<&str> = r["texts"].as_array().unwrap().iter().map(|t| t.as_str().unwrap()).collect();
assert_eq!(texts.concat(), "MMMM", "{r}");
assert!(texts.iter().any(|t| t.len() > 1), "the tracked glyphs stay one object: {r}");
}
#[test]
fn overlapping_translucent_glyphs_are_not_tracked_into_one_object() {
let mut s = session();
+86
View File
@@ -170,6 +170,7 @@ pub const BUILTIN: &[BuiltinSymbolLibrary] = &[
BuiltinSymbolLibrary { id: "inventory-icons", name: "Inventory Icons", make: inventory_icons },
BuiltinSymbolLibrary { id: "skill-icons", name: "Skill Icons", make: skill_icons },
BuiltinSymbolLibrary { id: "weather-icons", name: "Weather Icons", make: weather_icons },
BuiltinSymbolLibrary { id: "nature-icons", name: "Nature Icons", make: nature_icons },
BuiltinSymbolLibrary { id: "media-controls", name: "Media Controls", make: media_controls },
];
@@ -503,6 +504,91 @@ fn weather_icons() -> SymbolLibrary {
SymbolLibrary { name: "Weather Icons".into(), doc }
}
/// Nature Icons: five original silhouettes for diagrams and reusable artwork.
fn nature_icons() -> SymbolLibrary {
let poly = |coords: &[(f64, f64)]| {
let points: Vec<Point> = coords.iter().map(|&(x, y)| Point::new(x, y)).collect();
SubPath::polyline(&points, true)
};
let leaf = PathData::new(vec![
poly(&[(0.0, -20.0), (12.0, -13.0), (17.0, -2.0), (12.0, 10.0), (0.0, 19.0), (-12.0, 10.0), (-17.0, -2.0), (-12.0, -13.0)]),
poly(&[(-1.0, -13.0), (1.0, -13.0), (1.0, 20.0), (-1.0, 20.0)]),
]);
let mut flower_parts = shapes::ellipse(Rect::new(-6.0, -6.0, 6.0, 6.0)).subpaths;
for i in 0..6 {
let angle = i as f64 * std::f64::consts::PI / 3.0;
let (sin, cos) = angle.sin_cos();
let x = 12.0 * cos;
let y = 12.0 * sin;
flower_parts.extend(shapes::ellipse(Rect::new(x - 5.5, y - 5.5, x + 5.5, y + 5.5)).subpaths);
}
let flower = PathData::new(flower_parts);
let tree = PathData::new(vec![
poly(&[(-3.0, 6.0), (3.0, 6.0), (3.0, 20.0), (-3.0, 20.0)]),
poly(&[
(0.0, -21.0),
(12.0, -8.0),
(8.0, -8.0),
(17.0, 4.0),
(11.0, 4.0),
(18.0, 12.0),
(-18.0, 12.0),
(-11.0, 4.0),
(-17.0, 4.0),
(-8.0, -8.0),
(-12.0, -8.0),
]),
]);
let mountain = PathData::new(vec![
poly(&[(-21.0, 17.0), (-6.0, -17.0), (2.0, 0.0), (8.0, -11.0), (21.0, 17.0)]),
poly(&[(-12.0, -4.0), (-6.0, -17.0), (0.0, -4.0), (-5.0, -7.0), (-8.0, -3.0)]),
]);
let wave = PathData::new(
(0..3)
.map(|row| {
let y = row as f64 * 9.0 - 10.0;
poly(&[
(-20.0, y),
(-14.0, y - 4.0),
(-8.0, y - 4.0),
(-2.0, y),
(4.0, y + 4.0),
(10.0, y + 4.0),
(16.0, y),
(20.0, y),
(20.0, y + 3.0),
(16.0, y + 3.0),
(10.0, y + 7.0),
(4.0, y + 7.0),
(-2.0, y + 3.0),
(-8.0, y - 1.0),
(-14.0, y - 1.0),
(-20.0, y + 3.0),
])
})
.collect(),
);
let icons = [
("Leaf", leaf, "#4f9d59"),
("Flower", flower, "#d977a7"),
("Tree", tree, "#287c53"),
("Mountain", mountain, "#768899"),
("Wave", wave, "#388fb8"),
];
let mut doc = Document::new(100.0, 100.0);
for (name, path, hex) in icons {
let fill = Color::from_hex(hex).unwrap_or(Color::BLACK);
let edge = fill.lerp(&Color::BLACK, 0.35);
let id = doc.alloc_id();
let art = Node::path(id, path, Appearance::basic(Paint::solid(fill), Paint::solid(edge), 1.25));
let Ok((art, size, _)) = normalize(art) else { continue };
doc.symbols.push(Symbol { dynamic: false, name: name.into(), art: Arc::new(art) });
set_natural_size(&mut doc, name, Some(size));
}
doc.title = "Nature Icons".into();
SymbolLibrary { name: "Nature Icons".into(), doc }
}
/// Media Controls: play, pause, stop, skip next, shuffle and repeat for audio/video UI art (original, no 9-slice).
fn media_controls() -> SymbolLibrary {
// 1. Play: Right-pointing equilateral triangle.
+1
View File
@@ -67,6 +67,7 @@ mod expand_symbols;
mod eyedropper;
mod file;
mod fileinfo;
mod fill_area;
mod flatpresets;
mod flatpreview;
mod flatten;
+53
View File
@@ -115,6 +115,7 @@ fn the_builtin_libraries_are_original_brushes_generated_in_code() {
"paint",
"pattern-borders",
"decorative",
"ornamental",
"scatter-shapes",
"stipple",
"game-trails",
@@ -197,6 +198,7 @@ fn every_builtin_library_brush_has_its_kind_and_draws() {
("paint", "art"),
("pattern-borders", "pattern"),
("decorative", "pattern"),
("ornamental", "art"),
("scatter-shapes", "scatter"),
("stipple", "scatter"),
("game-trails", "art"),
@@ -661,6 +663,57 @@ fn decorative_brushes_repeat_distinct_art_and_survive_a_saved_library() {
assert_eq!(vectorcraft_brush::library(&reopened), lib.brushes);
}
#[test]
fn ornamental_brushes_draw_flourishes_and_survive_a_saved_library() {
let mut s = session();
let (_, lib) = cmd::brushlib::library(&s, "Ornamental").unwrap();
let names = ["Scrollwork", "Filigree Arrow", "Petal Sweep", "Twin Curl"];
assert_eq!(lib.brushes.iter().map(|b| b.name.as_str()).collect::<Vec<_>>(), names);
let path = run(&mut s, "shape.line", json!({"x1": 10, "y1": 40, "x2": 190, "y2": 40}))["id"].as_u64().unwrap();
let mut curve = line_to(20.0);
curve.curve_to((60.0, -25.0), (140.0, 25.0), (180.0, 0.0));
for b in &lib.brushes {
let BrushKind::Art(art) = &b.kind else { panic!("{} is not an art brush", b.name) };
assert_eq!(art.colorization, vectorcraft_brush::Colorization::Tints);
assert_eq!(art.width, 300.0);
for line in [line_to(2.0), line_to(180.0), curve.clone()] {
let pieces = vectorcraft_brush::stroke_pieces(&lib.doc, b, &line, &black_stroke());
let points = anchors(&pieces.iter().collect::<Vec<_>>());
assert!(!points.is_empty() && points.iter().all(|p| p.x.is_finite() && p.y.is_finite()), "{}", b.name);
}
let before = undo_len(&s);
let added = run(&mut s, "brush.addFromLibrary", json!({"library": "ornamental", "name": b.name, "apply": true, "ids": [path]}));
assert_eq!(strs(&added["added"]), [b.name.as_str()]);
assert_eq!(added["applied"], json!([path]));
assert_eq!(undo_len(&s), before + 1);
assert_eq!(doc(&s).node(NodeId(path)).unwrap().appearance.stroke().unwrap().brush.as_deref(), Some(b.name.as_str()));
}
let saved = run(&mut s, "brush.saveLibrary", json!({"names": names}));
let bytes = vectorcraft_format::base64_decode(saved["dataBase64"].as_str().unwrap()).unwrap();
let reopened = vectorcraft_format::load(&bytes).unwrap();
assert_eq!(vectorcraft_brush::library(&reopened), lib.brushes);
}
/// Filigree Arrow's shaft runs into its head with no gap, so a straight stroke draws one arrow.
#[test]
fn the_filigree_arrow_shaft_meets_its_head() {
let s = session();
let (_, lib) = cmd::brushlib::library(&s, "Ornamental").unwrap();
let BrushKind::Art(art) = &lib.brush("Filigree Arrow").unwrap().kind else { panic!("Filigree Arrow is not an art brush") };
let mut parts = vec![];
art.art.walk(&mut |c| {
if c.path_data().is_some() {
parts.push(c.contains_fn());
}
});
for y in [-0.6, 0.0, 0.6] {
for i in 0..=930 {
let p = vectorcraft_geom::Point::new(4.05 + 0.1 * f64::from(i), y);
assert!(parts.iter().any(|inside| inside(p)), "gap at {p:?}");
}
}
}
#[test]
fn pressure_sensitive_brushes_widen_with_pen_pressure_and_survive_a_saved_library() {
let mut s = session();
+827
View File
@@ -0,0 +1,827 @@
//! Tests for Fill Area (`shapeBuilder.copyRegion` and the `fillArea` tool).
use serde_json::{Value, json};
use vectorcraft_color::{Color, Paint};
use vectorcraft_doc::Node;
use vectorcraft_geom::{FillRule, PathData, Point};
use vectorcraft_tools::{Cursor, Mods, Overlay, PointerEvent, PointerKind};
use crate::*;
fn session() -> Session {
let mut s = Session::new();
s.execute("file.new", &json!({"width": 800, "height": 600})).unwrap();
s
}
fn id_of(v: &Value) -> NodeId {
NodeId(v["id"].as_u64().unwrap())
}
fn node(s: &Session, id: NodeId) -> Node {
s.doc().unwrap().doc.node(id).cloned().unwrap()
}
fn outline(s: &Session, id: NodeId) -> (PathData, FillRule) {
vectorcraft_tools::builder::node_outline(&node(s, id)).expect("path")
}
fn area(s: &Session, id: NodeId) -> f64 {
let (p, r) = outline(s, id);
vectorcraft_pathops::area(&p, r)
}
fn line(s: &mut Session, a: (f64, f64), b: (f64, f64)) -> NodeId {
id_of(&s.execute("shape.line", &json!({"x1": a.0, "y1": a.1, "x2": b.0, "y2": b.1})).unwrap())
}
fn rect(s: &mut Session, x: f64, y: f64, w: f64, h: f64) -> NodeId {
id_of(&s.execute("shape.rectangle", &json!({"x": x, "y": y, "width": w, "height": h})).unwrap())
}
/// Two diagonals and a crossbar: they enclose a triangle of 900 pt² above the crossbar.
fn triangle(s: &mut Session) -> [NodeId; 3] {
[line(s, (0.0, 0.0), (100.0, 100.0)), line(s, (100.0, 0.0), (0.0, 100.0)), line(s, (-10.0, 80.0), (110.0, 80.0))]
}
/// The ids of the default layer's children, back to front.
fn stack(s: &Session) -> Vec<NodeId> {
let d = &s.doc().unwrap().doc;
d.children(d.default_layer()).map(|c| c.iter().map(|n| n.id).collect()).unwrap_or_default()
}
fn undo_len(s: &Session) -> usize {
s.doc().unwrap().history.undo.len()
}
fn deselect(s: &mut Session) {
s.execute("select.set", &json!({"ids": []})).unwrap();
}
/// Four circles in a 2×2 grid, each touching its neighbors, enclose a diamond nothing fills. With
/// nothing selected, a click in it adds the diamond and leaves the circles as they were.
#[test]
fn fill_area_adds_the_diamond_four_circles_enclose_and_keeps_them() {
let mut s = session();
let mut circles = vec![];
for (x, y) in [(0.0, 0.0), (100.0, 0.0), (0.0, 100.0), (100.0, 100.0)] {
circles.push(id_of(&s.execute("shape.ellipse", &json!({"x": x, "y": y, "width": 100, "height": 100})).unwrap()));
}
deselect(&mut s);
let before: Vec<_> = circles.iter().map(|c| outline(&s, *c)).collect();
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [100, 100]})).unwrap();
let new = id_of(&r);
assert!((area(&s, new) - 2146.0).abs() < 10.0, "{}", area(&s, new));
assert_eq!(stack(&s).len(), 5, "the four circles and the diamond");
let after: Vec<_> = circles.iter().map(|c| outline(&s, *c)).collect();
assert_eq!(after, before, "the circles keep their geometry");
assert_eq!(s.doc().unwrap().selection.objects, vec![new], "the new path is selected");
}
/// The overlap of two filled squares is an area too: the new path covers it, and both squares stay
/// whole (a Shape Builder merge there cuts it out of them).
#[test]
fn fill_area_copies_the_overlap_of_two_filled_squares() {
let mut s = session();
let a = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
let b = rect(&mut s, 50.0, 0.0, 100.0, 100.0);
deselect(&mut s);
let (oa, ob) = (outline(&s, a), outline(&s, b));
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [75, 50]})).unwrap();
let new = id_of(&r);
assert!((area(&s, new) - 5000.0).abs() < 1.0, "{}", area(&s, new));
assert_eq!((outline(&s, a), outline(&s, b)), (oa, ob));
assert_eq!(stack(&s), vec![a, b, new], "above the front-most square");
assert_eq!(r["above"], json!(b.0));
}
/// Three lines bound a triangle; the new path has the current fill and stroke.
#[test]
fn fill_area_fills_the_triangle_three_lines_bound_with_the_current_paint() {
let mut s = session();
let lines = triangle(&mut s);
deselect(&mut s);
s.execute("paint.setFill", &json!({"color": "#336699"})).unwrap();
s.execute("paint.setStroke", &json!({"color": "#993300"})).unwrap();
let (fill, stroke) = (s.paint.fill.clone(), s.paint.stroke.clone());
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).unwrap();
let new = id_of(&r);
assert!((area(&s, new) - 900.0).abs() < 1e-6, "{}", area(&s, new));
let n = node(&s, new);
assert_eq!(n.appearance.fill_paint(), fill);
assert_eq!(n.appearance.stroke_paint(), stroke);
assert_eq!(stack(&s), vec![lines[0], lines[1], lines[2], new]);
// `fill` and `stroke` override the current paint.
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70], "fill": "#00ff00", "stroke": {"none": true}})).unwrap();
let n = node(&s, id_of(&r));
assert_eq!(n.appearance.fill_paint(), Paint::solid(Color::rgb(0.0, 1.0, 0.0)));
assert_eq!(n.appearance.stroke_paint(), Paint::None);
}
/// The new path takes the current stroke weight.
#[test]
fn fill_area_takes_the_current_stroke_weight() {
let mut s = session();
triangle(&mut s);
deselect(&mut s);
s.execute("paint.setStroke", &json!({"color": "#993300"})).unwrap();
s.paint.stroke_width = 4.0;
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).unwrap();
assert_eq!(node(&s, id_of(&r)).appearance.stroke_width(), 4.0);
}
/// `ids` names the objects or layers whose paths bound areas: without the crossbar the triangle is
/// open, and naming the layer takes every path in it.
#[test]
fn fill_area_ids_limit_the_paths_that_bound_areas() {
let mut s = session();
let lines = triangle(&mut s);
deselect(&mut s);
let two = json!({"point": [50, 70], "ids": [lines[0].0, lines[1].0]});
assert!(s.execute("shapeBuilder.copyRegion", &two).is_err());
let all = json!({"point": [50, 70], "ids": [lines[0].0, lines[1].0, lines[2].0]});
let r = s.execute("shapeBuilder.copyRegion", &all).unwrap();
assert!((area(&s, id_of(&r)) - 900.0).abs() < 1e-6);
let layer = s.doc().unwrap().doc.default_layer().unwrap();
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70], "ids": [layer.0]})).unwrap();
assert!((area(&s, id_of(&r)) - 900.0).abs() < 1e-6);
}
/// The new path goes above the group, Live Paint group or clipping group that holds the paths
/// along the area, never inside it, and the group keeps its members.
#[test]
fn fill_area_stacks_above_the_group_that_holds_the_paths() {
let mut s = session();
let lines = triangle(&mut s);
let ids: Vec<u64> = lines.iter().map(|l| l.0).collect();
s.execute("select.set", &json!({"ids": ids})).unwrap();
let g = id_of(&s.execute("object.group", &json!({})).unwrap());
deselect(&mut s);
let members = |s: &Session, g: NodeId| -> Vec<NodeId> { node(s, g).children().unwrap().iter().map(|n| n.id).collect() };
let before = members(&s, g);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).unwrap();
assert_eq!(stack(&s), vec![g, id_of(&r)]);
assert_eq!(r["above"], json!(g.0));
assert_eq!(members(&s, g), before);
let mut s = session();
let a = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
let b = rect(&mut s, 50.0, 0.0, 100.0, 100.0);
let lp = id_of(&s.execute("livePaint.make", &json!({"ids": [a.0, b.0]})).unwrap());
deselect(&mut s);
let before = members(&s, lp);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [75, 50]})).unwrap();
assert!((area(&s, id_of(&r)) - 5000.0).abs() < 1.0, "{}", area(&s, id_of(&r)));
assert_eq!(stack(&s), vec![lp, id_of(&r)]);
assert_eq!(members(&s, lp), before);
let mut s = session();
let lines = triangle(&mut s);
let mask = rect(&mut s, -20.0, -20.0, 140.0, 140.0);
let ids: Vec<u64> = lines.iter().map(|l| l.0).chain([mask.0]).collect();
s.execute("select.set", &json!({"ids": ids})).unwrap();
s.execute("object.clippingMask.make", &json!({})).unwrap();
let clip = s.doc().unwrap().selection.objects[0];
deselect(&mut s);
let before = members(&s, clip);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).unwrap();
assert_eq!(stack(&s), vec![clip, id_of(&r)]);
assert_eq!(members(&s, clip), before);
}
/// In isolation mode only the isolated group's paths bound areas, for the command and the tool: a
/// click in an area that art outside the group encloses adds nothing, and the new path goes inside
/// the group, above the path along the area.
#[test]
fn fill_area_stays_inside_the_isolated_group() {
let mut s = session();
let outside =
[line(&mut s, (200.0, 0.0), (300.0, 100.0)), line(&mut s, (300.0, 0.0), (200.0, 100.0)), line(&mut s, (190.0, 80.0), (310.0, 80.0))];
let lines = triangle(&mut s);
let ids: Vec<u64> = lines.iter().map(|l| l.0).collect();
s.execute("select.set", &json!({"ids": ids})).unwrap();
let g = id_of(&s.execute("object.group", &json!({})).unwrap());
s.execute("object.isolate", &json!({"id": g.0})).unwrap();
deselect(&mut s);
let members = |s: &Session| -> Vec<NodeId> { node(s, g).children().unwrap().iter().map(|n| n.id).collect() };
let (undo, kids) = (undo_len(&s), stack(&s));
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [250, 70]})).is_err(), "art outside the isolated group");
let named: Vec<u64> = outside.iter().map(|l| l.0).collect();
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [250, 70], "ids": named})).is_err(), "named art outside it");
assert_eq!((undo_len(&s), stack(&s), members(&s)), (undo, kids.clone(), lines.to_vec()));
let v = ViewInfo::default();
s.select_tool("fillArea", v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Move, 250.0, 70.0), v).unwrap();
assert!(
!s.overlays(v).iter().any(|o| matches!(o, Overlay::Path { color: [0xff, 0x2a, 0x2a], .. })),
"no area outside the isolated group is outlined"
);
s.pointer(&PointerEvent::new(PointerKind::Down, 250.0, 70.0), v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Up, 250.0, 70.0), v).unwrap();
assert_eq!((undo_len(&s), stack(&s), members(&s)), (undo, kids.clone(), lines.to_vec()));
s.pointer(&PointerEvent::new(PointerKind::Move, 50.0, 70.0), v).unwrap();
let red = s.overlays(v).into_iter().filter(|o| matches!(o, Overlay::Path { color: [0xff, 0x2a, 0x2a], .. })).count();
assert_eq!(red, 1, "the isolated group's area is outlined");
s.pointer(&PointerEvent::new(PointerKind::Down, 50.0, 70.0), v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Up, 50.0, 70.0), v).unwrap();
let new = s.doc().unwrap().selection.objects[0];
assert_eq!(s.doc().unwrap().doc.parent_of(new), Some(g));
assert_eq!(members(&s), [lines.as_slice(), &[new]].concat());
assert_eq!(stack(&s), kids);
assert!((area(&s, new) - 900.0).abs() < 1.0, "{}", area(&s, new));
// An isolated object that no longer exists counts as no isolation, for the tool as for the
// command: the area outside the group fills.
s.doc_mut().unwrap().isolation = Some(NodeId(999_999));
s.pointer(&PointerEvent::new(PointerKind::Move, 250.0, 70.0), v).unwrap();
let red = s.overlays(v).into_iter().filter(|o| matches!(o, Overlay::Path { color: [0xff, 0x2a, 0x2a], .. })).count();
assert_eq!(red, 1, "the area outside the group is outlined");
s.pointer(&PointerEvent::new(PointerKind::Down, 250.0, 70.0), v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Up, 250.0, 70.0), v).unwrap();
let new = s.doc().unwrap().selection.objects[0];
assert_eq!(s.doc().unwrap().doc.parent_of(new), s.doc().unwrap().doc.default_layer());
}
/// While a compound path is isolated, Fill Area finds no area, for the command and the tool, and
/// changes nothing: the compound path cannot hold the new path. The same goes for an isolated
/// Objects on Path group, a group with a Transform effect and a group that is a clipping mask.
#[test]
fn fill_area_finds_nothing_while_a_compound_path_is_isolated() {
let mut s = session();
let outer = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
let inner = rect(&mut s, 25.0, 25.0, 50.0, 50.0);
s.execute("select.set", &json!({"ids": [outer.0, inner.0]})).unwrap();
let c = id_of(&s.execute("object.compoundPath.make", &json!({})).unwrap());
deselect(&mut s);
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [10, 10]})).is_ok(), "the ring fills outside isolation");
s.execute("edit.undo", &json!({})).unwrap();
s.doc_mut().unwrap().isolation = Some(c);
let (undo, kids) = (undo_len(&s), stack(&s));
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [10, 10]})).is_err());
let v = ViewInfo::default();
s.select_tool("fillArea", v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Move, 10.0, 10.0), v).unwrap();
assert!(!s.overlays(v).iter().any(|o| matches!(o, Overlay::Path { color: [0xff, 0x2a, 0x2a], .. })));
s.pointer(&PointerEvent::new(PointerKind::Down, 10.0, 10.0), v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Up, 10.0, 10.0), v).unwrap();
assert_eq!((undo_len(&s), stack(&s)), (undo, kids));
// An Objects on Path group moves its members along the path, so a new path in it would not
// stay where the area is.
let mut s = session();
let a = rect(&mut s, 0.0, 0.0, 40.0, 40.0);
let b = rect(&mut s, 100.0, 0.0, 40.0, 40.0);
let path = line(&mut s, (0.0, 200.0), (300.0, 200.0));
s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap();
let g = id_of(&s.execute("object.objectsOnPath.attach", &json!({"path": path.0})).unwrap());
deselect(&mut s);
let c = s.doc().unwrap().doc.node(a).unwrap().geometric_bounds().unwrap().center();
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [c.x, c.y]})).is_ok(), "the square fills outside isolation");
s.execute("edit.undo", &json!({})).unwrap();
s.doc_mut().unwrap().isolation = Some(g);
let (undo, kids) = (undo_len(&s), stack(&s));
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [c.x, c.y]})).is_err());
assert_eq!((undo_len(&s), stack(&s)), (undo, kids));
// A group with a Transform effect moves what is in it, so a new path in it would not be drawn
// where the area is.
let mut s = session();
let lines = triangle(&mut s);
let ids: Vec<u64> = lines.iter().map(|l| l.0).collect();
s.execute("select.set", &json!({"ids": ids})).unwrap();
let g = id_of(&s.execute("object.group", &json!({})).unwrap());
s.execute("effect.apply", &json!({"effect": "distort.transform", "params": {"moveH": 100}, "ids": [g.0], "item": null})).unwrap();
deselect(&mut s);
s.doc_mut().unwrap().isolation = Some(g);
let (undo, kids) = (undo_len(&s), stack(&s));
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).is_err());
assert_eq!((undo_len(&s), stack(&s), node(&s, g).children().unwrap().len()), (undo, kids, 3));
// A group that is a clipping mask clips and is not painted, so it takes no new path.
let mut s = session();
let back = rect(&mut s, -20.0, -20.0, 140.0, 140.0);
let edge = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
s.execute("select.set", &json!({"ids": [back.0, edge.0]})).unwrap();
let clip = id_of(&s.execute("object.clippingMask.make", &json!({})).unwrap());
s.execute("select.set", &json!({"ids": [edge.0]})).unwrap();
let mask = id_of(&s.execute("object.group", &json!({})).unwrap());
// A filled square drawn in the mask group bounds an area of its own.
s.doc_mut().unwrap().isolation = Some(mask);
let square = rect(&mut s, 10.0, 10.0, 80.0, 80.0);
assert_eq!(s.doc().unwrap().doc.parent_of(square), Some(mask));
deselect(&mut s);
let first = node(&s, clip).children().unwrap()[0].id;
assert_eq!(first, mask, "the group is the clipping mask");
let (undo, kids) = (undo_len(&s), stack(&s));
let members = node(&s, mask).children().unwrap().len();
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).is_err());
assert_eq!((undo_len(&s), stack(&s), node(&s, mask).children().unwrap().len()), (undo, kids, members));
// The clipping group itself, and a group of the art it clips, take no new path either: the
// mask would hide or cut it.
s.doc_mut().unwrap().isolation = None;
s.execute("select.set", &json!({"ids": [back.0]})).unwrap();
let clipped = id_of(&s.execute("object.group", &json!({})).unwrap());
assert_eq!(s.doc().unwrap().doc.parent_of(clipped), Some(clip));
deselect(&mut s);
for iso in [clip, clipped] {
s.doc_mut().unwrap().isolation = Some(iso);
let (undo, kids) = (undo_len(&s), stack(&s));
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [5, 5]})).is_err(), "{iso:?}");
assert_eq!((undo_len(&s), stack(&s)), (undo, kids), "{iso:?}");
}
}
/// The new path goes directly above the front-most object along the area, not above art that
/// lies elsewhere, and paths on other layers bound areas too.
#[test]
fn fill_area_takes_paths_on_every_layer_and_stacks_above_the_area() {
let mut s = session();
let first = s.doc().unwrap().doc.default_layer();
let l1 = line(&mut s, (0.0, 0.0), (100.0, 100.0));
let l2 = line(&mut s, (100.0, 0.0), (0.0, 100.0));
let far = rect(&mut s, 400.0, 400.0, 50.0, 50.0);
let other = id_of(&s.execute("layer.new", &json!({"name": "Other"})).unwrap());
let l3 = line(&mut s, (-10.0, 80.0), (110.0, 80.0));
let top = rect(&mut s, 500.0, 400.0, 50.0, 50.0);
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).unwrap();
let new = id_of(&r);
let d = &s.doc().unwrap().doc;
assert_eq!(d.parent_of(new), Some(other));
let kids: Vec<NodeId> = d.children(Some(other)).unwrap().iter().map(|n| n.id).collect();
assert_eq!(kids, vec![l3, new, top]);
let kids: Vec<NodeId> = d.children(first).unwrap().iter().map(|n| n.id).collect();
assert_eq!(kids, vec![l1, l2, far]);
}
/// An area far larger than the paths near the point: four long lines bound a 400 pt square whose
/// middle no path's bounds hold, and a small triangle inside it is a hole in the area.
#[test]
fn fill_area_finds_an_area_that_reaches_far_from_the_point() {
let mut s = session();
line(&mut s, (-20.0, 0.0), (420.0, 0.0));
line(&mut s, (-20.0, 400.0), (420.0, 400.0));
line(&mut s, (0.0, -20.0), (0.0, 420.0));
line(&mut s, (400.0, -20.0), (400.0, 420.0));
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [200, 200]})).unwrap();
assert!((area(&s, id_of(&r)) - 160_000.0).abs() < 1.0, "{}", area(&s, id_of(&r)));
for (a, b) in [((150.0, 250.0), (250.0, 350.0)), ((250.0, 250.0), (150.0, 350.0)), ((140.0, 330.0), (260.0, 330.0))] {
line(&mut s, a, b);
}
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 50]})).unwrap();
assert!((area(&s, id_of(&r)) - (160_000.0 - 900.0)).abs() < 1.0, "the square less the triangle: {}", area(&s, id_of(&r)));
}
/// Distant art with more segments than one Shape Builder map takes does not stop four lines from
/// bounding the square between them: the search maps the lines near the point first, and a window
/// that reaches the distant art leaves it out.
#[test]
fn fill_area_finds_a_nearby_area_beside_a_huge_distant_path() {
for (at, huge_x) in [(0.0, 20_000.0), (100.0, 1_300.0)] {
let mut s = session();
let (lo, hi) = (at, at + 800.0);
line(&mut s, (lo - 20.0, lo), (hi + 20.0, lo));
line(&mut s, (lo - 20.0, hi), (hi + 20.0, hi));
line(&mut s, (lo, lo - 20.0), (lo, hi + 20.0));
line(&mut s, (hi, lo - 20.0), (hi, hi + 20.0));
let n = vectorcraft_pathops::SHAPE_BUILDER_MAX_SEGMENTS;
let pts: Vec<Point> = (0..=n).map(|k| Point::new(huge_x + 400.0 * k as f64 / n as f64, 500.0 + (k % 2) as f64)).collect();
let look = vectorcraft_doc::Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0);
s.edit("t", |d, _| {
let id = d.alloc_id();
let top = d.children(d.default_layer()).map_or(0, |c| c.len());
d.insert(d.default_layer(), top, Node::path(id, PathData::single(vectorcraft_geom::SubPath::polyline(&pts, false)), look))?;
Ok(id)
})
.unwrap();
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [at + 400.0, at + 400.0]})).unwrap();
assert!((area(&s, id_of(&r)) - 640_000.0).abs() < 1.0, "{huge_x}: {}", area(&s, id_of(&r)));
}
}
/// A path with too many segments near a long, flat area stays out of the map, and the area's far
/// ends still bound it.
#[test]
fn fill_area_finds_a_long_area_beside_a_huge_path() {
let mut s = session();
line(&mut s, (-10.0, -20.0), (810.0, -20.0));
line(&mut s, (-10.0, 20.0), (810.0, 20.0));
line(&mut s, (0.0, -30.0), (0.0, 30.0));
line(&mut s, (800.0, -30.0), (800.0, 30.0));
line(&mut s, (-10.0, 0.0), (810.0, 0.0));
let n = vectorcraft_pathops::SHAPE_BUILDER_MAX_SEGMENTS;
let pts: Vec<Point> = (0..=n).map(|k| Point::new(300.0 + 200.0 * k as f64 / n as f64, 60.0 + (k % 2) as f64 * 0.5)).collect();
let look = vectorcraft_doc::Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0);
s.edit("t", |d, _| {
let id = d.alloc_id();
let top = d.children(d.default_layer()).map_or(0, |c| c.len());
d.insert(d.default_layer(), top, Node::path(id, PathData::single(vectorcraft_geom::SubPath::polyline(&pts, false)), look))?;
Ok(id)
})
.unwrap();
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [400, 0.5]})).unwrap();
assert!((area(&s, id_of(&r)) - 16_000.0).abs() < 1.0, "{}", area(&s, id_of(&r)));
}
/// A path with too many segments that crosses the area cannot be left out, and the paths together
/// are past the segment limit: the square it cuts is not filled across it, whether four lines or one
/// filled rectangle bound the square.
#[test]
fn fill_area_does_not_fill_across_a_huge_path_it_left_out() {
for closed in [false, true] {
let mut s = session();
if closed {
rect(&mut s, 0.0, 0.0, 400.0, 400.0);
} else {
line(&mut s, (-20.0, 0.0), (420.0, 0.0));
line(&mut s, (-20.0, 400.0), (420.0, 400.0));
line(&mut s, (0.0, -20.0), (0.0, 420.0));
line(&mut s, (400.0, -20.0), (400.0, 420.0));
}
let n = vectorcraft_pathops::SHAPE_BUILDER_MAX_SEGMENTS;
let pts: Vec<Point> = (0..=n).map(|k| Point::new(-20.0 + 440.0 * k as f64 / n as f64, 300.0)).collect();
let look = vectorcraft_doc::Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0);
s.edit("t", |d, _| {
let id = d.alloc_id();
let top = d.children(d.default_layer()).map_or(0, |c| c.len());
d.insert(d.default_layer(), top, Node::path(id, PathData::single(vectorcraft_geom::SubPath::polyline(&pts, false)), look))?;
Ok(id)
})
.unwrap();
deselect(&mut s);
let (undo, kids) = (undo_len(&s), stack(&s));
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [200, 100]})).is_err(), "closed: {closed}");
assert_eq!((undo_len(&s), stack(&s)), (undo, kids));
}
}
/// A path with too many segments whose box holds the square, but no segment of it comes near: its
/// subpaths lie far apart on either side of the square, or one curve arcs around the square and its
/// box holds the square. It is left out and the square is filled.
#[test]
fn fill_area_fills_an_area_that_a_left_out_paths_box_holds_but_its_segments_miss() {
// A cubic from (-1000, 1500) up over the square to (1400, 1500); at its top it is at y -750.
let mut arc = vectorcraft_geom::SubPath::polyline(&[Point::new(-1000.0, 1500.0), Point::new(1400.0, 1500.0)], false);
arc.anchors[0].h_out = Point::new(-1000.0, -1500.0);
arc.anchors[1].h_in = Point::new(1400.0, -1500.0);
let far = vectorcraft_geom::SubPath::polyline(&[Point::new(2000.0, 1500.0), Point::new(2100.0, 1500.0)], false);
for second in [far, arc] {
let mut s = session();
line(&mut s, (-20.0, 0.0), (420.0, 0.0));
line(&mut s, (-20.0, 400.0), (420.0, 400.0));
line(&mut s, (0.0, -20.0), (0.0, 420.0));
line(&mut s, (400.0, -20.0), (400.0, 420.0));
let n = vectorcraft_pathops::SHAPE_BUILDER_MAX_SEGMENTS;
let pts: Vec<Point> = (0..=n).map(|k| Point::new(-2000.0 + 400.0 * k as f64 / n as f64, -1000.0 + (k % 2) as f64)).collect();
let path = PathData::new(vec![vectorcraft_geom::SubPath::polyline(&pts, false), second.clone()]);
let look = vectorcraft_doc::Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0);
s.edit("t", |d, _| {
let id = d.alloc_id();
let top = d.children(d.default_layer()).map_or(0, |c| c.len());
d.insert(d.default_layer(), top, Node::path(id, path, look))?;
Ok(id)
})
.unwrap();
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [200, 200]})).unwrap();
assert!((area(&s, id_of(&r)) - 160_000.0).abs() < 1.0, "{second:?}: {}", area(&s, id_of(&r)));
}
}
/// Puts `path` with `look` in front on the current layer.
fn insert_path(s: &mut Session, path: PathData, look: vectorcraft_doc::Appearance) -> NodeId {
s.edit("t", |d, _| {
let id = d.alloc_id();
let top = d.children(d.default_layer()).map_or(0, |c| c.len());
d.insert(d.default_layer(), top, Node::path(id, path, look))?;
Ok(id)
})
.unwrap()
}
/// A path with too many segments in the empty corner of a filled L, well clear of both arms, is
/// left out and does not stop the L from being filled, though the L's box holds it.
#[test]
fn fill_area_fills_an_l_whose_empty_corner_holds_a_left_out_path() {
let mut s = session();
let l = [(0.0, 0.0), (400.0, 0.0), (400.0, 100.0), (100.0, 100.0), (100.0, 400.0), (0.0, 400.0)].map(|(x, y)| Point::new(x, y));
let solid = vectorcraft_doc::Appearance::basic(Paint::solid(Color::BLACK), Paint::None, 0.0);
insert_path(&mut s, PathData::single(vectorcraft_geom::SubPath::polyline(&l, true)), solid);
let n = vectorcraft_pathops::SHAPE_BUILDER_MAX_SEGMENTS;
let pts: Vec<Point> = (0..=n).map(|k| Point::new(250.0 + 100.0 * k as f64 / n as f64, 250.0 + (k % 2) as f64)).collect();
let look = vectorcraft_doc::Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0);
insert_path(&mut s, PathData::single(vectorcraft_geom::SubPath::polyline(&pts, false)), look);
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 50]})).unwrap();
assert!((area(&s, id_of(&r)) - 70_000.0).abs() < 1.0, "{}", area(&s, id_of(&r)));
}
/// A filled contour with too many segments on a higher layer surrounds a small square, its outline
/// far from it: it is left out of the map, and the new path still goes above it, since it covers
/// the area.
#[test]
fn fill_area_stacks_above_a_left_out_path_that_covers_the_area() {
let mut s = session();
let layer = s.doc().unwrap().doc.default_layer();
rect(&mut s, 0.0, 0.0, 100.0, 100.0);
let over = id_of(&s.execute("layer.new", &json!({"name": "Over"})).unwrap());
let n = vectorcraft_pathops::SHAPE_BUILDER_MAX_SEGMENTS + 1;
let pts: Vec<Point> = (0..n)
.map(|k| {
let a = k as f64 * std::f64::consts::TAU / n as f64;
Point::new(50.0 + 3000.0 * a.cos(), 50.0 + 3000.0 * a.sin())
})
.collect();
let solid = vectorcraft_doc::Appearance::basic(Paint::solid(Color::BLACK), Paint::None, 0.0);
let contour = insert_path(&mut s, PathData::single(vectorcraft_geom::SubPath::polyline(&pts, true)), solid);
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 50]})).unwrap();
assert!((area(&s, id_of(&r)) - 10_000.0).abs() < 1.0, "{}", area(&s, id_of(&r)));
assert_eq!(r["above"], json!(contour.0));
let d = &s.doc().unwrap().doc;
assert_eq!(d.parent_of(id_of(&r)), Some(over));
assert_ne!(d.parent_of(id_of(&r)), layer);
}
/// With Gap Detection off, a long line on a higher layer 0.75 pt from a square's edge neither
/// touches nor covers the square, so the new path stays above the square.
#[test]
fn fill_area_does_not_stack_above_a_line_that_does_not_touch_the_area() {
let mut s = session();
let layer = s.doc().unwrap().doc.default_layer();
let square = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
id_of(&s.execute("layer.new", &json!({"name": "Other"})).unwrap());
line(&mut s, (-5000.0, -0.75), (5000.0, -0.75));
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 50]})).unwrap();
assert_eq!(r["above"], json!(square.0));
assert_eq!(s.doc().unwrap().doc.parent_of(id_of(&r)), layer);
}
/// With Gap Detection on, a square on a higher layer within the gap of the area's corners does not
/// bound the area, so the new path stays above the square that does.
#[test]
fn fill_area_gap_does_not_stack_above_a_nearby_path() {
let mut s = session();
let first = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
let layer = s.doc().unwrap().doc.default_layer();
let other = id_of(&s.execute("layer.new", &json!({"name": "Other"})).unwrap());
rect(&mut s, 102.0, 0.0, 100.0, 100.0);
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 50], "gap": 3})).unwrap();
let d = &s.doc().unwrap().doc;
assert_eq!(d.parent_of(id_of(&r)), layer);
assert_ne!(d.parent_of(id_of(&r)), Some(other));
assert_eq!(r["above"], json!(first.0));
}
/// An object listed in `ids` with the layer that holds it counts once, so the new path still goes
/// above the front-most of two overlapping squares.
#[test]
fn fill_area_ids_count_an_object_and_its_layer_once() {
let mut s = session();
let back = rect(&mut s, 0.0, 0.0, 100.0, 100.0);
let front = rect(&mut s, 50.0, 0.0, 100.0, 100.0);
deselect(&mut s);
let layer = s.doc().unwrap().doc.default_layer().unwrap();
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [75, 50], "ids": [layer.0, back.0]})).unwrap();
assert_eq!(stack(&s), vec![back, front, id_of(&r)]);
}
/// A flat window that reaches a path with too many segments leaves that path out and grows to the
/// paths it had not picked: a crossbar that no path near the point leads to still splits the area.
#[test]
fn fill_area_keeps_paths_a_capped_window_had_not_picked() {
let mut s = session();
// Four lines bound a box; a line through the point and a crossbar higher up cut it.
line(&mut s, (50.0, -60.0), (50.0, 410.0));
line(&mut s, (350.0, -60.0), (350.0, 410.0));
line(&mut s, (40.0, -50.0), (360.0, -50.0));
line(&mut s, (40.0, 400.0), (360.0, 400.0));
line(&mut s, (0.0, 100.0), (400.0, 100.0));
line(&mut s, (40.0, 30.0), (360.0, 30.0));
let n = vectorcraft_pathops::SHAPE_BUILDER_MAX_SEGMENTS;
let pts: Vec<Point> = (0..=n).map(|k| Point::new(380.0 + 20.0 * k as f64 / n as f64, 100.0 + (k % 2) as f64 * 0.5)).collect();
let look = vectorcraft_doc::Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 1.0);
s.edit("t", |d, _| {
let id = d.alloc_id();
let top = d.children(d.default_layer()).map_or(0, |c| c.len());
d.insert(d.default_layer(), top, Node::path(id, PathData::single(vectorcraft_geom::SubPath::polyline(&pts, false)), look))?;
Ok(id)
})
.unwrap();
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [200, 99.5]})).unwrap();
assert!((area(&s, id_of(&r)) - 21_000.0).abs() < 1.0, "between the crossbar and the line: {}", area(&s, id_of(&r)));
}
/// Two diagonals and a crossbar about 3 pt short of each: the area closes only with a gap of 3 pt
/// or more, and a gap out of 0 to 72 pt is an error.
#[test]
fn fill_area_gap_closes_small_gaps() {
let mut s = session();
line(&mut s, (0.0, 0.0), (100.0, 100.0));
line(&mut s, (100.0, 0.0), (0.0, 100.0));
line(&mut s, (24.0, 80.0), (76.0, 80.0));
deselect(&mut s);
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).is_err());
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70], "gap": 2})).is_err());
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70], "gap": 3})).unwrap();
let a = area(&s, id_of(&r));
assert!(a > 850.0 && a < 900.0, "the triangle and its two bridges: {a}");
for gap in [json!(-1), json!(73), json!("3")] {
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70], "gap": gap})).is_err(), "{gap}");
}
}
/// Locked and hidden paths do not bound an area: the triangle fills while its crossbar is unlocked
/// and visible, and not once the crossbar is locked or hidden.
#[test]
fn fill_area_skips_locked_and_hidden_paths() {
for how in ["object.lock", "object.hide"] {
let mut s = session();
let lines = triangle(&mut s);
deselect(&mut s);
let r = s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).unwrap();
assert!((area(&s, id_of(&r)) - 900.0).abs() < 1e-6, "{how}");
s.execute("edit.undo", &json!({})).unwrap();
s.execute(how, &json!({"ids": [lines[2].0]})).unwrap();
deselect(&mut s);
let (undo, kids) = (undo_len(&s), stack(&s));
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).is_err(), "{how}");
assert_eq!((undo_len(&s), stack(&s)), (undo, kids), "{how}");
}
}
/// A point in no enclosed area changes nothing and records no undo step; bad params are errors. A
/// point inside the triangle fills it.
#[test]
fn fill_area_outside_every_area_changes_nothing() {
let mut s = session();
triangle(&mut s);
deselect(&mut s);
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70]})).is_ok());
s.execute("edit.undo", &json!({})).unwrap();
let (undo, kids) = (undo_len(&s), stack(&s));
for p in [json!({"point": [500, 500]}), json!({"point": [50, 90]}), json!({"point": [-500, -500]})] {
assert!(s.execute("shapeBuilder.copyRegion", &p).is_err(), "{p}");
}
for p in [json!({}), json!({"point": [50]}), json!({"point": [50, 70], "fill": "nope"}), json!({"point": [50, 70], "stroke": 3})] {
assert!(s.execute("shapeBuilder.copyRegion", &p).is_err(), "{p}");
}
for paint in [json!({"swatch": 123}), json!({"color": 5}), json!({"color": "nope"})] {
for key in ["fill", "stroke"] {
let p = json!({"point": [50, 70], key: paint});
assert!(s.execute("shapeBuilder.copyRegion", &p).is_err(), "{p}");
}
}
assert!(s.execute("shapeBuilder.copyRegion", &json!({"point": [50, 70], "ids": [999_999]})).is_err());
assert_eq!((undo_len(&s), stack(&s)), (undo, kids));
}
/// The tool outlines the area under the pointer, shows the bucket over it, and a click adds the
/// path; a click outside every area records nothing. It uses the Shape Builder's Gap Detection.
#[test]
fn fill_area_tool_drives_the_command() {
let mut s = session();
line(&mut s, (0.0, 0.0), (100.0, 100.0));
line(&mut s, (100.0, 0.0), (0.0, 100.0));
line(&mut s, (24.0, 80.0), (76.0, 80.0));
deselect(&mut s);
let v = ViewInfo::default();
s.select_tool("fillArea", v).unwrap();
assert_eq!(s.tool_id(), "fillArea");
s.pointer(&PointerEvent::new(PointerKind::Move, 50.0, 70.0), v).unwrap();
assert!(s.overlays(v).is_empty(), "the gap leaves the triangle open");
assert_eq!(s.cursor(Point::new(50.0, 70.0), Mods::default(), v), Cursor::LivePaintBucket);
let (undo, kids) = (undo_len(&s), stack(&s));
s.pointer(&PointerEvent::new(PointerKind::Down, 50.0, 70.0), v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Up, 50.0, 70.0), v).unwrap();
assert_eq!((undo_len(&s), stack(&s)), (undo, kids), "nothing to fill");
// The Shape Builder's options reach the active Fill Area tool.
s.set_tool_option_cmd(&json!({"tool": "shapeBuilder", "values": {"gapDetection": true, "gapLength": 3}})).unwrap();
assert_eq!(s.tool_options_of("fillArea")["gapLength"], json!(3.0));
s.pointer(&PointerEvent::new(PointerKind::Move, 50.0, 70.0), v).unwrap();
let red: Vec<_> = s.overlays(v).into_iter().filter(|o| matches!(o, Overlay::Path { color: [0xff, 0x2a, 0x2a], .. })).collect();
assert_eq!(red.len(), 1, "the area is outlined in red");
assert_eq!(s.cursor(Point::new(50.0, 70.0), Mods::default(), v), Cursor::LivePaintBucketFace);
s.pointer(&PointerEvent::new(PointerKind::Down, 50.0, 70.0), v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Up, 50.0, 70.0), v).unwrap();
assert_eq!(s.journal.last().unwrap().0, "shapeBuilder.copyRegion");
assert_eq!(stack(&s).len(), 4);
assert_eq!(undo_len(&s), undo + 1);
assert_eq!(s.tool_id(), "fillArea");
assert!(s.set_tool_option_cmd(&json!({"tool": "fillArea", "values": {"highlightColor": "#ff0000"}})).is_err());
assert!(s.set_tool_option_cmd(&json!({"tool": "fillArea", "values": {"gapLength": "wide"}})).is_err());
// Setting them on Fill Area sets them for the Shape Builder too.
s.set_tool_option_cmd(&json!({"tool": "fillArea", "values": {"gapLength": 5, "openFilledAsClosed": false}})).unwrap();
let opts = s.tool_options_of("shapeBuilder");
assert_eq!((opts["gapLength"].clone(), opts["openFilledAsClosed"].clone()), (json!(5.0), json!(false)));
}
/// The hover search for a document of more than 128 segments runs on another thread: nothing is
/// outlined until the tool is polled, and a click finds the area at once.
#[test]
fn fill_area_tool_hovers_a_large_document_on_another_thread() {
let mut s = session();
s.execute("shape.polygon", &json!({"cx": 300, "cy": 300, "radius": 100, "sides": 200})).unwrap();
deselect(&mut s);
let v = ViewInfo::default();
s.select_tool("fillArea", v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Move, 300.0, 300.0), v).unwrap();
assert!(s.tool_waiting());
assert!(s.overlays(v).is_empty());
// The pointer moves on inside the area before the search is done: its result still serves.
s.pointer(&PointerEvent::new(PointerKind::Move, 305.0, 300.0), v).unwrap();
s.tool_poll(v, false).unwrap();
s.tool_poll(v, true).unwrap();
assert!(!s.tool_waiting());
assert_eq!(s.overlays(v).len(), 1, "the polygon is outlined");
// Leaving the area takes the outline away at once, while the next search runs.
s.pointer(&PointerEvent::new(PointerKind::Move, 500.0, 500.0), v).unwrap();
assert!(s.overlays(v).is_empty());
s.tool_poll(v, true).unwrap();
assert!(s.overlays(v).is_empty());
s.pointer(&PointerEvent::new(PointerKind::Move, 300.0, 300.0), v).unwrap();
s.tool_poll(v, true).unwrap();
assert_eq!(s.overlays(v).len(), 1);
// A click while a search runs waits for it: the pointer leaves the area, which starts a
// search, and the press inside the area comes before any poll.
s.pointer(&PointerEvent::new(PointerKind::Move, 500.0, 500.0), v).unwrap();
assert!(s.tool_waiting());
let undo = undo_len(&s);
s.pointer(&PointerEvent::new(PointerKind::Down, 310.0, 300.0), v).unwrap();
assert!(!s.tool_waiting(), "the press waited for the search");
s.pointer(&PointerEvent::new(PointerKind::Up, 310.0, 300.0), v).unwrap();
assert_eq!(undo_len(&s), undo + 1);
}
/// A press that is dropped before the release (a long or canceled touch) takes the new path back
/// and records no undo step.
#[test]
fn fill_area_tool_dropped_press_adds_nothing() {
let mut s = session();
triangle(&mut s);
deselect(&mut s);
let v = ViewInfo::default();
s.select_tool("fillArea", v).unwrap();
let (undo, kids) = (undo_len(&s), stack(&s));
s.pointer(&PointerEvent::new(PointerKind::Down, 50.0, 70.0), v).unwrap();
assert_eq!(stack(&s).len(), kids.len() + 1, "the path shows during the press");
s.drop_tool_press(v).unwrap();
s.pointer(&PointerEvent::new(PointerKind::Up, 50.0, 70.0), v).unwrap();
assert_eq!((undo_len(&s), stack(&s)), (undo, kids));
}
/// The outline under a still pointer goes when the document changes, and the canvas hovers the
/// tool again then.
#[test]
fn fill_area_tool_drops_a_hover_the_document_no_longer_has() {
let mut s = session();
rect(&mut s, 0.0, 0.0, 100.0, 100.0);
let v = ViewInfo::default();
s.select_tool("fillArea", v).unwrap();
assert!(s.tool_wants_rehover());
s.pointer(&PointerEvent::new(PointerKind::Move, 50.0, 50.0), v).unwrap();
assert_eq!(s.overlays(v).len(), 1);
s.execute("edit.clear", &json!({})).unwrap();
assert!(s.overlays(v).is_empty());
assert_eq!(s.cursor(Point::new(50.0, 50.0), Mods::default(), v), Cursor::LivePaintBucket);
}
/// Moving the pointer from an area with a hole into the area that fills the hole outlines the
/// inner area instead.
#[test]
fn fill_area_tool_hover_moves_from_an_area_into_its_hole() {
let mut s = session();
line(&mut s, (-20.0, 0.0), (420.0, 0.0));
line(&mut s, (-20.0, 400.0), (420.0, 400.0));
line(&mut s, (0.0, -20.0), (0.0, 420.0));
line(&mut s, (400.0, -20.0), (400.0, 420.0));
for (a, b) in [((150.0, 250.0), (250.0, 350.0)), ((250.0, 250.0), (150.0, 350.0)), ((140.0, 330.0), (260.0, 330.0))] {
line(&mut s, a, b);
}
deselect(&mut s);
let v = ViewInfo::default();
s.select_tool("fillArea", v).unwrap();
let outlined = |s: &mut Session| -> Vec<f64> {
s.overlays(v)
.into_iter()
.filter_map(|o| match o {
Overlay::Path { path, .. } => Some(kurbo::Shape::bounding_box(&path).width()),
_ => None,
})
.collect()
};
s.pointer(&PointerEvent::new(PointerKind::Move, 50.0, 50.0), v).unwrap();
let w = outlined(&mut s);
assert!(w.len() == 1 && (w[0] - 400.0).abs() < 1e-6, "the square: {w:?}");
s.pointer(&PointerEvent::new(PointerKind::Move, 200.0, 320.0), v).unwrap();
let w = outlined(&mut s);
assert!(w.len() == 1 && (w[0] - 60.0).abs() < 1e-6, "the triangle in its hole: {w:?}");
}
+34 -1
View File
@@ -84,7 +84,7 @@ fn the_builtin_library_is_original_art_generated_in_code() {
let mut s = Session::new();
let list = run(&mut s, "symbol.libraries", json!({}));
let libs = list["libraries"].as_array().unwrap();
assert_eq!(libs.len(), 7, "{libs:?}");
assert_eq!(libs.len(), 8, "{libs:?}");
assert_eq!((libs[0]["id"].as_str(), libs[0]["category"].as_str()), (Some("basic-shapes"), Some("builtIn")));
assert_eq!(
(libs[1]["id"].as_str(), libs[1]["name"].as_str(), libs[1]["category"].as_str()),
@@ -108,6 +108,10 @@ fn the_builtin_library_is_original_art_generated_in_code() {
);
assert_eq!(
(libs[6]["id"].as_str(), libs[6]["name"].as_str(), libs[6]["category"].as_str()),
(Some("nature-icons"), Some("Nature Icons"), Some("builtIn"))
);
assert_eq!(
(libs[7]["id"].as_str(), libs[7]["name"].as_str(), libs[7]["category"].as_str()),
(Some("media-controls"), Some("Media Controls"), Some("builtIn"))
);
let lib = run(&mut s, "symbol.library", json!({"library": "basic shapes"}));
@@ -249,6 +253,35 @@ fn weather_icons_library_lists_and_places() {
}
}
#[test]
fn nature_icons_library_places_and_survives_save() {
let mut s = session();
let listed = run(&mut s, "symbol.libraries", json!({}));
let entry = listed["libraries"].as_array().unwrap().iter().find(|l| l["id"] == "nature-icons").unwrap();
assert_eq!((entry["name"].as_str(), entry["count"].as_u64()), (Some("Nature Icons"), Some(5)));
let library = run(&mut s, "symbol.library", json!({"library": "nature-icons"}));
let names: Vec<&str> = library["symbols"].as_array().unwrap().iter().map(|x| x["name"].as_str().unwrap()).collect();
assert_eq!(names, ["Leaf", "Flower", "Tree", "Mountain", "Wave"]);
for (i, name) in names.iter().enumerate() {
let symbol = &library["symbols"][i];
let size = symbol["size"].as_array().unwrap();
assert!(size.iter().all(|n| n.as_f64().is_some_and(|n| n.is_finite() && n > 0.0)), "{name}");
let added = run(
&mut s,
"symbol.addFromLibrary",
json!({"library": "nature-icons", "name": name, "place": true, "x": 100.0 + 80.0 * i as f64, "y": 100.0}),
);
assert_eq!(added["added"], json!([name]));
let id = NodeId(added["placed"].as_u64().unwrap());
assert!(matches!(doc(&s).node(id).map(|n| &n.kind), Some(NodeKind::SymbolInstance { symbol, .. }) if symbol == *name));
assert_eq!(doc(&s).symbol_nine_slice(name), None);
}
let saved = run(&mut s, "symbol.saveLibrary", json!({"names": ["Leaf", "Flower", "Tree", "Mountain", "Wave"]}));
let bytes = vectorcraft_format::base64_decode(saved["dataBase64"].as_str().unwrap()).unwrap();
let reopened = vectorcraft_format::load(&bytes).unwrap();
assert_eq!(reopened.symbols.iter().map(|s| s.name.as_str()).collect::<Vec<_>>(), names);
}
#[test]
fn media_controls_library_lists_and_places() {
let mut s = session();
+8 -20
View File
@@ -3,8 +3,6 @@
//! Format Specification, version 7.0, §5.3, §5.4 and §6), and the colors they write in place of
//! the paint they can't hold.
use std::fmt::Write;
use vectorcraft_color::{Color, Gradient};
use vectorcraft_doc::{LAYER_COLORS, LayerColor, LineCap, LineJoin, StrokeLayer};
use vectorcraft_geom::{Affine, Anchor, AnchorKind, PathData, Point, Shape, SubPath};
@@ -184,25 +182,15 @@ pub(crate) fn window_samples(samples: &[u8], w: u32, channels: usize, [x0, y0, x
/// The stroke's width, cap, join, miter limit and dashes: `w J j M d`.
pub(crate) fn line_style(s: &mut String, st: &StrokeLayer) {
let cap = match st.cap {
LineCap::Butt => 0,
LineCap::Round => 1,
LineCap::Square => 2,
LineCap::Butt => ps::LineCap::Butt,
LineCap::Round => ps::LineCap::Round,
LineCap::Square => ps::LineCap::Square,
};
let join = match st.join {
LineJoin::Miter => 0,
LineJoin::Round => 1,
LineJoin::Bevel => 2,
LineJoin::Miter => ps::LineJoin::Miter,
LineJoin::Round => ps::LineJoin::Round,
LineJoin::Bevel => ps::LineJoin::Bevel,
};
ps::push_num(s, st.width);
let _ = write!(s, " w {cap} J {join} j ");
ps::push_num(s, if st.miter_limit.is_finite() { st.miter_limit.max(1.0) } else { 10.0 });
s.push_str(" M [");
let dash = st.dash.as_ref().filter(|d| d.is_dashed());
if let Some(d) = dash {
ps::push_nums(s, &d.pattern);
s.pop();
}
s.push_str("] ");
ps::push_num(s, dash.map_or(0.0, |d| d.offset));
s.push_str(" d\n");
let dash = st.dash.as_ref().filter(|d| d.is_dashed()).map(|d| (d.pattern.as_slice(), d.offset));
ps::push_line_style(s, st.width, cap, join, st.miter_limit, dash);
}
+60 -298
View File
@@ -1,253 +1,17 @@
//! The scanner: PostScript source into objects (numbers, names, strings, procedures), with the
//! position the program's own data (`currentfile`) is read from.
//!
//! Backed by `craft_ps::read::lex`.
use std::rc::Rc;
use craft_ps::read::lex::{LexError, Number, Token};
use super::obj::{Obj, PsError, Res};
use crate::ps;
/// Deepest procedure nesting the scanner reads.
const MAX_NESTING: usize = 256;
pub(crate) use craft_ps::read::lex::{IMMEDIATE, hex_decode};
pub(crate) struct Lexer<'a> {
src: &'a [u8],
pos: usize,
/// The whitespace character that ended the last token is still unread (data the program
/// reads from itself starts after it).
fresh: bool,
/// The last object read has immediately evaluated names (`//name`) in it, read as executable
/// names starting with [`IMMEDIATE`] for the interpreter to replace by their values.
pub immediate: bool,
}
/// How an immediately evaluated name (`//name`) is read, until the interpreter replaces it.
pub(crate) const IMMEDIATE: &str = "//";
fn is_space(b: u8) -> bool {
matches!(b, b' ' | b'\t' | b'\r' | b'\n' | b'\x0c' | b'\0')
}
fn is_delim(b: u8) -> bool {
matches!(b, b'(' | b')' | b'<' | b'>' | b'[' | b']' | b'{' | b'}' | b'/' | b'%')
}
fn syntax<T>(what: &str) -> Res<T> {
Err(PsError::Ps("syntaxerror", what.to_string()))
}
impl<'a> Lexer<'a> {
pub fn new(src: &'a [u8]) -> Self {
Self { src, pos: 0, fresh: false, immediate: false }
}
/// What is left to read.
pub fn rest(&self) -> &'a [u8] {
self.src.get(self.pos..).unwrap_or_default()
}
/// What is left to read as data: after the whitespace that ended the last token (a CR LF
/// pair counts as one).
pub fn data(&mut self) -> &'a [u8] {
if std::mem::take(&mut self.fresh) {
match self.peek() {
Some(b'\r') => {
self.pos += 1;
if self.peek() == Some(b'\n') {
self.pos += 1;
}
}
Some(b) if is_space(b) => self.pos += 1,
_ => {}
}
}
self.rest()
}
/// Skip `n` bytes (the data a filter or `readstring` took).
pub fn advance(&mut self, n: usize) {
self.fresh = false;
self.pos = self.pos.saturating_add(n).min(self.src.len());
}
fn peek(&self) -> Option<u8> {
self.src.get(self.pos).copied()
}
fn skip_space(&mut self) {
while let Some(b) = self.peek() {
if is_space(b) {
self.pos += 1;
} else if b == b'%' {
while let Some(c) = self.peek() {
if c == b'\n' || c == b'\r' {
break;
}
self.pos += 1;
}
} else {
break;
}
}
}
/// The next object at the top level (`None` at the end of the file).
pub fn next(&mut self) -> Res<Option<Obj>> {
self.immediate = false;
let t = self.token(0);
self.fresh = true;
t
}
fn token(&mut self, depth: usize) -> Res<Option<Obj>> {
self.skip_space();
let Some(b) = self.peek() else { return Ok(None) };
self.pos += 1;
Ok(Some(match b {
b'(' => Obj::string(self.string()?),
b'<' => match self.peek() {
Some(b'<') => {
self.pos += 1;
Obj::Exec(Rc::from("<<"))
}
Some(b'~') => {
self.pos += 1;
Obj::string(self.ascii85()?)
}
_ => Obj::string(self.hex()?),
},
b'>' => {
if self.peek() != Some(b'>') {
return syntax(">");
}
self.pos += 1;
Obj::Exec(Rc::from(">>"))
}
b'[' => Obj::Exec(Rc::from("[")),
b']' => Obj::Exec(Rc::from("]")),
b'{' => {
if depth >= MAX_NESTING {
return Err(PsError::Limit("procedures nested too deeply"));
}
let mut items = vec![];
loop {
self.skip_space();
match self.peek() {
None => return syntax("{"),
Some(b'}') => {
self.pos += 1;
break;
}
_ => match self.token(depth + 1)? {
Some(o) => items.push(o),
None => return syntax("{"),
},
}
}
Obj::proc(items)
}
b'}' | b')' => return syntax(&char::from(b).to_string()),
b'/' => {
// `//name` stands for the name's value when it is read.
let immediate = self.peek() == Some(b'/');
if immediate {
self.pos += 1;
self.immediate = true;
}
let name = self.word();
if immediate { Obj::Exec(Rc::from(format!("{IMMEDIATE}{name}").as_str())) } else { Obj::Name(Rc::from(name.as_str())) }
}
_ => {
self.pos -= 1;
let w = self.word();
number(&w).unwrap_or_else(|| Obj::Exec(Rc::from(w.as_str())))
}
}))
}
/// A regular token's characters.
fn word(&mut self) -> String {
let start = self.pos;
while let Some(b) = self.peek() {
if is_space(b) || is_delim(b) {
break;
}
self.pos += 1;
}
String::from_utf8_lossy(self.src.get(start..self.pos).unwrap_or_default()).into_owned()
}
/// A literal string after its `(`.
fn string(&mut self) -> Res<Vec<u8>> {
let mut out = vec![];
let mut depth = 0usize;
loop {
let Some(b) = self.peek() else { return syntax("(") };
self.pos += 1;
match b {
b'(' => {
depth += 1;
out.push(b);
}
b')' if depth == 0 => return Ok(out),
b')' => {
depth -= 1;
out.push(b);
}
b'\\' => {
let Some(e) = self.peek() else { return syntax("(") };
self.pos += 1;
match e {
b'n' => out.push(b'\n'),
b'r' => out.push(b'\r'),
b't' => out.push(b'\t'),
b'b' => out.push(8),
b'f' => out.push(12),
b'\r' => {
if self.peek() == Some(b'\n') {
self.pos += 1;
}
}
b'\n' => {}
b'0'..=b'7' => {
let mut v = u32::from(e - b'0');
for _ in 0..2 {
match self.peek() {
Some(d @ b'0'..=b'7') => {
v = v * 8 + u32::from(d - b'0');
self.pos += 1;
}
_ => break,
}
}
out.push((v & 0xff) as u8);
}
other => out.push(other),
}
}
_ => out.push(b),
}
}
}
/// A hexadecimal string after its `<`.
fn hex(&mut self) -> Res<Vec<u8>> {
let end = self.rest().iter().position(|b| *b == b'>').ok_or(PsError::Ps("syntaxerror", "<".into()))?;
let body = self.rest().get(..end).unwrap_or_default();
let out = hex_decode(body).ok_or(PsError::Ps("syntaxerror", "<".into()))?;
self.advance(end + 1);
Ok(out)
}
/// An ASCII85 string after its `<~`.
fn ascii85(&mut self) -> Res<Vec<u8>> {
let end = find(self.rest(), b"~>").ok_or(PsError::Ps("syntaxerror", "<~".into()))?;
let text = String::from_utf8_lossy(self.rest().get(..end + 2).unwrap_or_default()).into_owned();
self.advance(end + 2);
ps::ascii85_decode(&text).ok_or(PsError::Ps("syntaxerror", "<~".into()))
}
}
/// Where `needle` first starts in `hay`.
/// Where `needle` first starts in `hay` (uses `memmem` so large inputs stay linear-time).
pub(crate) fn find(hay: &[u8], needle: &[u8]) -> Option<usize> {
if needle.is_empty() {
return Some(0);
@@ -255,39 +19,66 @@ pub(crate) fn find(hay: &[u8], needle: &[u8]) -> Option<usize> {
memchr::memmem::find(hay, needle)
}
/// Hexadecimal digits (whitespace ignored, an odd last digit padded with 0); `None` on others.
pub(crate) fn hex_decode(body: &[u8]) -> Option<Vec<u8>> {
// Callers pass an already-delimited body. Do not let the filter decoder's EOD
// handling silently accept a stray terminator or discard bytes after it.
if body.contains(&b'>') {
return None;
pub(crate) struct Lexer<'a> {
inner: craft_ps::read::lex::Lexer<'a>,
/// The last object read has immediately evaluated names (`//name`) in it, read as executable
/// names starting with [`IMMEDIATE`] for the interpreter to replace by their values.
pub immediate: bool,
}
impl<'a> Lexer<'a> {
pub fn new(src: &'a [u8]) -> Self {
Self { inner: craft_ps::read::lex::Lexer::new(src), immediate: false }
}
/// What is left to read.
pub fn rest(&self) -> &'a [u8] {
self.inner.rest()
}
/// What is left to read as data: after the whitespace that ended the last token (a CR LF
/// pair counts as one).
pub fn data(&mut self) -> &'a [u8] {
self.inner.data()
}
/// Skip `n` bytes (the data a filter or `readstring` took).
pub fn advance(&mut self, n: usize) {
self.inner.advance(n);
}
/// The next object at the top level (`None` at the end of the file).
pub fn next(&mut self) -> Res<Option<Obj>> {
let res = self.inner.next().map(|opt| opt.map(into_obj)).map_err(into_err);
self.immediate = self.inner.immediate;
res
}
}
fn into_err(err: LexError) -> PsError {
match err {
LexError::Syntax(what) => PsError::Ps("syntaxerror", what),
LexError::Limit(msg) => PsError::Limit(msg),
}
}
fn into_obj(tok: Token) -> Obj {
match tok {
Token::Int(i) => Obj::Int(i),
Token::Real(r) => Obj::Real(r),
Token::Name(n) => Obj::Name(Rc::from(n.as_str())),
Token::Exec(n) => Obj::Exec(Rc::from(n.as_str())),
Token::Str(s) => Obj::string(s),
Token::Proc(items) => Obj::proc(items.into_iter().map(into_obj).collect()),
}
craft_stream_codecs::asciihex::decode(body, body.len().div_ceil(2)).ok()
}
/// A number token (`12`, `-3.5`, `.5`, `1e-3`, `16#ff`), or `None`.
pub(crate) fn number(w: &str) -> Option<Obj> {
let first = w.bytes().next()?;
if !(first.is_ascii_digit() || matches!(first, b'+' | b'-' | b'.')) {
return None;
match craft_ps::read::lex::number(w)? {
Number::Int(i) => Some(Obj::Int(i)),
Number::Real(r) => Some(Obj::Real(r)),
}
if let Ok(i) = w.parse::<i64>() {
return Some(Obj::Int(i));
}
if let Some((base, digits)) = w.split_once('#') {
let base: u32 = base.parse().ok().filter(|b| (2..=36).contains(b))?;
// `from_str_radix` accepts a leading sign; a PostScript radix number has digits only.
if digits.starts_with(['+', '-']) {
return None;
}
return i64::from_str_radix(digits, base).ok().map(Obj::Int);
}
// Rust reads `inf` and `nan`; PostScript doesn't.
if w.bytes().any(|b| b.is_ascii_alphabetic() && !matches!(b, b'e' | b'E')) {
return None;
}
let v: f64 = w.parse().ok()?;
v.is_finite().then_some(Obj::Real(v))
}
#[cfg(test)]
@@ -300,33 +91,4 @@ mod tests {
assert!(number("16#-ff").is_none());
assert!(matches!(number("16#ff"), Some(Obj::Int(255))));
}
#[test]
fn shared_hex_decode_keeps_body_boundaries_and_odd_nibbles() {
assert_eq!(hex_decode(b" 4\t1\n4\r2\x0c4\0"), Some(vec![0x41, 0x42, 0x40]));
assert_eq!(hex_decode(b""), Some(vec![]));
for invalid in [b"41>42".as_slice(), b">", b"4g", b"4\x0b1", b"\xff"] {
assert_eq!(hex_decode(invalid), None);
}
// Every byte pairs with each possible nibble, including all whitespace
// and invalid-byte combinations; this is the former body-only contract.
for first in 0..=255u8 {
for second in 0..=255u8 {
let input = [first, second];
let mut digits = Vec::new();
let mut valid = true;
for b in input {
if is_space(b) {
continue;
}
match char::from(b).to_digit(16) {
Some(d) => digits.push(d as u8),
None => valid = false,
}
}
let expected =
if !valid { None } else { Some(digits.chunks(2).map(|pair| (pair[0] << 4) | pair.get(1).copied().unwrap_or(0)).collect()) };
assert_eq!(hex_decode(&input), expected, "{input:?}");
}
}
}
}
+31 -36
View File
@@ -5,9 +5,6 @@
use vectorcraft_doc::{Document, ImageBlob, ImageObject, Node, NodeKind};
use vectorcraft_geom::{Affine, Rect};
/// Largest EPSI bitmap side read (pixels).
const MAX_EPSI: usize = 8192;
/// A preview's document and how the user is told about it.
pub(super) struct Preview {
pub document: Document,
@@ -89,41 +86,39 @@ fn metafile_doc(wmf: &[u8], frame: Rect) -> Option<Document> {
/// The EPSI preview in `ps`'s comments (`%%BeginPreview: width height depth lines`, hex rows,
/// 0 white and the largest value black).
/// The shared decoder intentionally tolerates blank preview lines and CR-only line endings;
/// unlike the former local parser, neither changes the decoded samples.
fn epsi(ps: &[u8]) -> Option<image::RgbaImage> {
let text = String::from_utf8_lossy(ps);
let mut lines = text.lines();
let head = lines.find_map(|l| l.strip_prefix("%%BeginPreview:"))?;
let n: Vec<usize> = head.split_whitespace().map_while(|w| w.parse().ok()).collect();
let [w, h, depth, ..] = n[..] else { return None };
if !(1..=MAX_EPSI).contains(&w) || !(1..=MAX_EPSI).contains(&h) || ![1, 2, 4, 8].contains(&depth) {
return None;
let bitmap = craft_eps::epsi(ps)?;
let rgba = bitmap.gray.into_iter().flat_map(|g| [g, g, g, 255]).collect();
image::RgbaImage::from_raw(bitmap.width, bitmap.height, rgba)
}
#[cfg(test)]
mod tests {
use super::epsi;
#[test]
fn shared_epsi_depths_keep_row_padding_and_opaque_grayscale() {
for (depth, row, gray) in [(1, "40", [255, 0, 255]), (2, "18", [255, 170, 85]), (4, "05a0", [255, 170, 85]), (8, "0055aa", [255, 170, 85])] {
let source = format!("%%BeginPreview: 3 2 {depth} 2\n% {row}\n% {row}\n%%EndPreview\n");
let image = epsi(source.as_bytes()).expect("ordinary EPSI preview");
assert_eq!(image.dimensions(), (3, 2));
let expected: Vec<u8> = gray.into_iter().cycle().take(6).flat_map(|g| [g, g, g, 255]).collect();
assert_eq!(image.as_raw(), &expected, "depth {depth}");
}
}
let row = (w * depth).div_ceil(8);
let mut hex = Vec::with_capacity((row * h * 2).min(ps.len()));
for l in lines {
if l.starts_with("%%EndPreview") || hex.len() >= row * h * 2 {
break;
#[test]
fn shared_epsi_intentionally_accepts_blank_and_cr_only_lines() {
let ordinary = "%%BeginPreview: 3 2 2 2\n% 18\n% e4\n%%EndPreview\n";
let expected = epsi(ordinary.as_bytes()).expect("ordinary preview");
for source in [ordinary.replace('\n', "\r"), ordinary.replace("% e4", "\n% e4")] {
let image = epsi(source.as_bytes()).expect("documented shared decoder tolerance");
assert_eq!(image, expected);
}
hex.extend(l.strip_prefix('%')?.bytes().filter(u8::is_ascii_hexdigit));
}
hex.truncate(row * h * 2);
// A trailing half byte would decode padded with zero: the preview is cut short, so none.
if hex.len() % 2 != 0 {
return None;
}
let bytes = super::lex::hex_decode(&hex)?;
// A preview with its samples missing is none, not a blank image of the size it claims.
if bytes.len() < row * h {
return None;
}
let max = (1u32 << depth) - 1;
let mut img = image::RgbaImage::new(w as u32, h as u32);
for (x, y, px) in img.enumerate_pixels_mut() {
let bit = y as usize * row * 8 + x as usize * depth;
let byte = u32::from(bytes.get(bit / 8).copied().unwrap_or(0));
let v = (byte >> (8 - depth - bit % 8)) & max;
let grey = (255 - v * 255 / max) as u8;
*px = image::Rgba([grey, grey, grey, 255]);
let gray = [255, 170, 85, 0, 85, 170];
let rgba: Vec<u8> = gray.into_iter().flat_map(|g| [g, g, g, 255]).collect();
assert_eq!(expected.as_raw(), &rgba);
}
Some(img)
}
+30 -1
View File
@@ -3,7 +3,10 @@
use vectorcraft_geom::{BezPath, FillRule};
pub(crate) use craft_ps::write::{bytes, deflate, inflate, matrix, num, push_num, push_num_places, push_nums, string, written};
pub(crate) use craft_ps::write::{
LineCap, LineJoin, ShadingKind, bytes, deflate, inflate, matrix, num, push_image_array_ref, push_inline_image, push_line_style, push_num,
push_num_places, push_nums, push_reusable_image_ref, push_reusable_image_resource, push_shading, string, written,
};
/// The procedures the page uses, in `VCdict`.
pub(crate) const PROLOG: &str = "/VCdict 64 dict def
@@ -121,4 +124,30 @@ mod tests {
assert_eq!(places(2.5, 7), "2.5");
assert_eq!(places(f64::NAN, 7), "0");
}
#[test]
fn shared_scene_syntax_preserves_vc_names_and_shading() {
let mut line = String::new();
super::push_line_style(&mut line, 3.0, super::LineCap::Square, super::LineJoin::Round, 4.0, Some((&[5.0, 1.5], 0.5)));
assert_eq!(line, "3 w 2 J 1 j 4 M [5 1.5] 0.5 d\n");
let mut shading = String::new();
super::push_shading(
&mut shading,
super::ShadingKind::Axial,
"/DeviceCMYK",
&[0.0, 0.0, 100.0, 0.0],
4,
&[(0.0, vec![0.0, 1.0, 1.0, 0.0]), (1.0, vec![1.0, 0.0, 1.0, 0.0])],
);
assert!(shading.contains("/ShadingType 2 /ColorSpace /DeviceCMYK"));
assert!(shading.ends_with(">> shfill\n"));
let mut inline = String::new();
super::push_inline_image(&mut inline, "VCsrc", "", "<< /ImageType 1", "/FlateDecode", "image", "~>\n");
assert_eq!(
inline,
"{ /VCsrc currentfile /ASCII85Decode filter def\n<< /ImageType 1\n/DataSource VCsrc /FlateDecode filter >> image\nVCsrc flushfile } exec\n~>\n"
);
}
}
+12 -63
View File
@@ -50,8 +50,6 @@ const SPREAD_CAPPED: &str =
"gradients that repeat or reflect are written with at most 256 runs of their stops (at most 16384 stops); they pad past those";
/// Wedges a conic gradient is written as: one a degree.
const CONIC_WEDGE_COUNT: usize = 360;
/// Decimals of a smooth shading's stitching function bounds (stop offsets, 0 to 1).
const BOUNDS_PLACES: u32 = 7;
/// The most colorants a DeviceN color space may have (PostScript's limit).
const MAX_DEVICE_N: usize = 32;
const MISSING_PATTERN: &str = "missing patterns are written as mid-grey";
@@ -63,8 +61,6 @@ const MAX_BODY: usize = 256 << 20;
/// Most compressed bytes in one string of an image's samples at Level 2 (under PostScript's
/// 65,535-byte string limit).
const IMAGE_CHUNK: usize = 48 << 10;
/// The start of the procedure that reads an image's data from the lines after it.
const INLINE_SOURCE: &str = "{ /VCsrc currentfile /ASCII85Decode filter def\n";
/// An image as written: what sets up its color, its image dictionary and its compressed samples.
/// Placed once, it is written where it is drawn, its data following the operators that read it.
@@ -108,33 +104,20 @@ impl ImageCode {
/// The operators and data that draw the image where it is placed.
fn push_inline(&self, s: &mut String) {
s.push_str(&self.prelude);
s.push_str(INLINE_SOURCE);
s.push_str(&self.dict);
s.push_str(&self.inline_read());
s.push_str(&self.ascii);
}
/// The end of the procedure [`ImageCode::push_inline`] writes. The procedure is read whole
/// before it runs: the image data follows it, and flushing the ASCII85 filter afterwards reads
/// past its end marker.
fn inline_read(&self) -> String {
format!("\n/DataSource VCsrc {} filter >> {}\nVCsrc flushfile }} exec\n", self.filter, self.op)
ps::push_inline_image(s, "VCsrc", &self.prelude, &self.dict, self.filter, self.op, &self.ascii);
}
/// The operators that draw the image `VCim<i>` holds, for an image placed more than once.
fn reference(&self, i: usize, level: Level) -> String {
let mut s = String::new();
let name = format!("VCim{i}");
match level {
// The stream is read again from its start.
Level::Three => {
format!("{}VCim{i} resetfile\n{}\n/DataSource VCim{i} {} filter >> {}\n", self.prelude, self.dict, self.filter, self.op)
}
Level::Three => ps::push_reusable_image_ref(&mut s, &name, &self.prelude, &self.dict, self.filter, self.op),
// A procedure gives the strings in turn, then an empty string: the end of the data.
Level::Two => format!(
"{}/VCi 0 def\n{}\n/DataSource {{VCi VCim{i} length lt {{VCim{i} VCi get /VCi VCi 1 add def}} {{()}} ifelse}} {} filter >> {}\n",
self.prelude, self.dict, self.filter, self.op
),
Level::Two => ps::push_image_array_ref(&mut s, "VCi", &name, &self.prelude, &self.dict, self.filter, self.op),
}
s
}
/// The setup's definition of `VCim<i>`: the image's compressed samples, once.
@@ -145,11 +128,7 @@ impl ImageCode {
// The stream reads all of its data when it is made, so the data follows the
// procedure that makes it.
let intent = if self.op == "imagemask" { 1 } else { 0 };
let _ = writeln!(
s,
"{{ /VCsrc currentfile /ASCII85Decode filter def\n/VCim{i} VCsrc << /Intent {intent} /AsyncRead false /CloseSource false >> /ReusableStreamDecode filter def\nVCsrc flushfile }} exec"
);
s.push_str(&self.ascii);
ps::push_reusable_image_resource(&mut s, "VCsrc", &format!("VCim{i}"), intent, &self.ascii);
}
Level::Two => {
let _ = writeln!(s, "/VCim{i} [");
@@ -1489,44 +1468,12 @@ impl<'a> Scene<'a> {
/// A Level 3 smooth shading of `kind` (2 axial, 3 radial) at `coords`, extended both ways.
fn shading(&mut self, kind: u8, space: &GradientSpace, coords: &[f64], stops: &[(f64, Vec<f32>)]) {
let n = space.n();
let comps = |c: &[f32]| -> String {
let mut s = String::from("[");
push_nums(&mut s, &c.iter().take(n).map(|v| f64::from(*v)).collect::<Vec<_>>());
s.pop();
s.push(']');
s
};
let segments: Vec<_> = stops.windows(2).filter(|w| w[1].0 > w[0].0).collect();
let interp = |w: &&[(f64, Vec<f32>)]| format!("<< /FunctionType 2 /Domain [0 1] /C0 {} /C1 {} /N 1 >>", comps(&w[0].1), comps(&w[1].1));
let function = match segments.as_slice() {
[one] => interp(one),
many => {
let mut f = String::from("<< /FunctionType 3 /Domain [0 1] /Functions [\n");
for w in many {
f.push_str(&interp(w));
f.push('\n');
}
f.push_str("] /Bounds [");
// Seven decimals: a gradient's stops repeated hundreds or thousands of times
// (`Gradient::padded_over`) keep their places in each run.
for w in many.iter().skip(1) {
ps::push_num_places(&mut f, w[0].0, BOUNDS_PLACES);
f.push(' ');
}
f.push_str("] /Encode [");
f.push_str(&"0 1 ".repeat(many.len()));
f.push_str("] >>");
f
}
};
let kind = if kind == 3 { ps::ShadingKind::Radial } else { ps::ShadingKind::Axial };
let name = match space {
GradientSpace::Process(s) => s.name(),
GradientSpace::Inks(name, _) => name,
};
let _ = write!(self.body, "<< /ShadingType {kind} /ColorSpace {name} /Coords [");
push_nums(&mut self.body, coords);
let _ = writeln!(self.body, "] /Extend [true true]\n/Function {function} >> shfill");
ps::push_shading(&mut self.body, kind, name, coords, space.n(), stops);
}
/// The bands of each stretch between stops: how many, for colours `a` to `b` over `length`
@@ -2090,7 +2037,9 @@ impl<'a> Scene<'a> {
/// `data`, not yet placed.
fn image_code(prelude: String, dict: String, filter: &'static str, op: &'static str, data: Vec<u8>) -> ImageCode {
let mut code = ImageCode { prelude, dict, filter, op, ascii: ps::ascii85(&data), data, uses: 0, inline_len: 0, ref_len: 0 };
code.inline_len = code.prelude.len() + INLINE_SOURCE.len() + code.dict.len() + code.inline_read().len() + code.ascii.len();
let mut inline = String::new();
ps::push_inline_image(&mut inline, "VCsrc", &code.prelude, &code.dict, code.filter, code.op, "");
code.inline_len = inline.len() + code.ascii.len();
code
}
+1 -1
View File
@@ -1175,7 +1175,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
"tool.options",
"Tool Options…",
"",
"{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's To Line truncated
"{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's To Line truncated
),
(
"ui.colorGuideOptions",
+3
View File
@@ -56,6 +56,9 @@ serde_json = { workspace = true }
krilla = { workspace = true, features = ["simple-text"] }
# How many times the symbol list is read to find symbols by name.
vectorcraft-doc = { workspace = true, features = ["symbol-read-count"] }
# The counters vectorcraft-engine's tests turn on, also when this crate is tested without
# vectorcraft-engine (`cargo xtask ci shard`).
vectorcraft-pdf = { path = ".", features = ["read-count"] }
# An independent raster oracle for gradient placement in PDF forms. These are test-only macOS
# bindings; the exporter stays portable Rust and does not depend on an OS PDF renderer.
+39 -6
View File
@@ -262,6 +262,12 @@ fn spend(work: &mut usize, steps: usize) -> Result<(), String> {
/// The triangles covering one face: `contours` (outlines one way round, holes the other) on the
/// plane across `normal` (its Newell normal).
pub(crate) fn triangulate(contours: &[Vec<V3>], normal: V3, work: &mut usize) -> Result<Vec<[V3; 3]>, String> {
triangulate_keeping(contours, normal, work, false)
}
/// [`triangulate`], keeping the corners that lie straight between their neighbors as triangle
/// corners when `keep_straight` is set.
fn triangulate_keeping(contours: &[Vec<V3>], normal: V3, work: &mut usize, keep_straight: bool) -> Result<Vec<[V3; 3]>, String> {
// Cut the face on the coordinate plane it is least slanted to, turned so outlines run
// counterclockwise.
let (ax, ay, az) = (normal.0.abs(), normal.1.abs(), normal.2.abs());
@@ -332,11 +338,30 @@ pub(crate) fn triangulate(contours: &[Vec<V3>], normal: V3, work: &mut usize) ->
let (hole, rest) = holes[k..].split_first().ok_or_else(too_complex)?;
ring = bridge(ring, hole, rest, work)?;
}
clip(&ring, &mut out, work)?;
clip(&ring, &mut out, work, keep_straight)?;
}
Ok(out)
}
/// The triangles covering `rings`, a flat face in the art's plane (outlines with a positive signed
/// area, holes negative), cut as a mesh's faces are: each hole bridged to the outline around it,
/// then ear clipped. Every corner of the rings that lies straight between its neighbors (a corner
/// a neighboring cell shares) stays a triangle corner. Each triangle runs the way its outline does,
/// and a triangle with no area that way round is left out. The steps add to `work`, and the cut
/// stops as soon as `work` passes `budget`. `None` when a hole crosses an outline or another hole,
/// or when `work` passes `budget`.
pub(crate) fn flat_triangles(rings: &[Vec<Point>], work: &mut usize, budget: usize) -> Option<Vec<[Point; 3]>> {
let contours: Vec<Vec<V3>> = rings.iter().map(|r| r.iter().map(|q| V3(q.x, q.y, 0.0)).collect()).collect();
// Counted up from MAX_WORK less the budget, the cut's own checks stop it at the budget.
let start = MAX_WORK - budget.min(MAX_WORK);
let mut spent = start.saturating_add(*work);
let triangles = triangulate_keeping(&contours, V3(0.0, 0.0, 1.0), &mut spent, true);
*work = spent.saturating_sub(start);
let triangles = triangles.ok()?;
let triangles = triangles.into_iter().map(|t| t.map(|v| Point::new(v.0, v.1)));
Some(triangles.filter(|[a, b, c]| (*b - *a).cross(*c - *a) > 0.0).collect())
}
/// Do segments `a`–`b` and `c`–`d` cross (touching at a shared end does not count)?
fn crosses(a: (f64, f64), b: (f64, f64), c: (f64, f64), d: (f64, f64)) -> bool {
let same = |p: (f64, f64), q: (f64, f64)| (p.0 - q.0).hypot(p.1 - q.1) < 1e-9;
@@ -401,9 +426,10 @@ fn bridge(ring: Vec<Corner>, hole: &[Corner], others: &[Vec<Corner>], work: &mut
}
/// Cut `ring` (counterclockwise, possibly joined to its holes by bridges) into triangles by ear
/// clipping. A corner in line with its neighbors goes without a triangle. If no ear is left (a
/// ring that crosses itself), the rest is cut as a fan.
fn clip(ring: &[Corner], out: &mut Vec<[V3; 3]>, work: &mut usize) -> Result<(), String> {
/// clipping. A corner in line with its neighbors goes without a triangle, unless `keep_straight`
/// is set and it lies straight between them: it then stays a corner of the triangles beside it. If
/// no ear is left (a ring that crosses itself), the rest is cut as a fan.
fn clip(ring: &[Corner], out: &mut Vec<[V3; 3]>, work: &mut usize, keep_straight: bool) -> Result<(), String> {
let n = ring.len();
if n < 3 {
return Ok(());
@@ -419,8 +445,10 @@ fn clip(ring: &[Corner], out: &mut Vec<[V3; 3]>, work: &mut usize) -> Result<(),
let turn = cross(pa, pb, pc);
let scale = (pb.x - pa.x).hypot(pb.y - pa.y) * (pc.x - pb.x).hypot(pc.y - pb.y);
let mut ear = false;
let drop = turn.abs() <= 1e-12 * scale.max(1e-300);
if !drop && turn > 0.0 {
let flat = turn.abs() <= 1e-12 * scale.max(1e-300);
let straight = keep_straight && flat && (pb.x - pa.x) * (pc.x - pb.x) + (pb.y - pa.y) * (pc.y - pb.y) > 0.0;
let drop = flat && !straight;
if !flat && turn > 0.0 {
spend(work, left)?;
ear = true;
let mut k = next[c];
@@ -430,6 +458,11 @@ fn clip(ring: &[Corner], out: &mut Vec<[V3; 3]>, work: &mut usize) -> Result<(),
ear = false;
break;
}
// A kept corner on the ear's new edge would be left off every triangle.
if keep_straight && touches((p.x, p.y), (pc.x, pc.y), (pa.x, pa.y)) {
ear = false;
break;
}
k = next[k];
}
}
+62
View File
@@ -173,6 +173,68 @@ fn a_bridge_through_another_corner_touches_it() {
assert!(!super::touches((5.0, 1.0), (0.0, 0.0), (10.0, 0.0)));
}
#[test]
fn flat_triangles_keep_corners_that_lie_along_an_edge() {
// A square with a hole, its edges carrying corners midway, as a cell shares with its finer
// neighbors: every corner is a corner of some triangle, and the triangles cover the face.
let p = |x: f64, y: f64| Point::new(x, y);
let outline = vec![p(5.0, 0.0), p(10.0, 0.0), p(10.0, 5.0), p(10.0, 10.0), p(5.0, 10.0), p(0.0, 10.0), p(0.0, 5.0), p(0.0, 0.0)];
let hole = vec![p(1.0, 4.0), p(1.0, 6.0), p(2.0, 6.0), p(2.0, 4.0)];
let mut work = 0;
let triangles = flat_triangles(&[outline.clone(), hole], &mut work, usize::MAX).unwrap();
let area = |t: &[Point; 3]| ((t[1].x - t[0].x) * (t[2].y - t[0].y) - (t[1].y - t[0].y) * (t[2].x - t[0].x)) / 2.0;
assert!(triangles.iter().all(|t| area(t) > 0.0));
assert!((triangles.iter().map(area).sum::<f64>() - 98.0).abs() < 1e-9);
for q in &outline {
assert!(triangles.iter().any(|t| t.contains(q)), "{q:?} is no triangle's corner");
}
assert!(work > 0);
}
#[test]
fn flat_triangles_keep_corners_on_the_edge_an_ear_would_cut() {
// The first ear's new edge runs along the bottom, through its two middle corners.
let p = |x: f64, y: f64| Point::new(x, y);
let outline = vec![p(0.0, 3.0), p(0.0, 0.0), p(1.0, 0.0), p(2.0, 0.0), p(3.0, 0.0)];
let mut work = 0;
let triangles = flat_triangles(std::slice::from_ref(&outline), &mut work, usize::MAX).unwrap();
let area = |t: &[Point; 3]| ((t[1].x - t[0].x) * (t[2].y - t[0].y) - (t[1].y - t[0].y) * (t[2].x - t[0].x)) / 2.0;
assert!((triangles.iter().map(area).sum::<f64>() - 4.5).abs() < 1e-9);
for q in &outline {
assert!(triangles.iter().any(|t| t.contains(q)), "{q:?} is no triangle's corner");
}
}
#[test]
fn flat_triangles_pass_over_an_ear_whose_new_edge_runs_through_a_dent() {
// The first ear's new edge, from (0, 4) to (4, 0), runs through the dent's corner at (2, 2).
let p = |x: f64, y: f64| Point::new(x, y);
let outline = vec![p(0.0, 0.0), p(4.0, 0.0), p(4.0, 4.0), p(2.0, 2.0), p(0.0, 4.0)];
let mut work = 0;
let triangles = flat_triangles(std::slice::from_ref(&outline), &mut work, usize::MAX).unwrap();
let area = |t: &[Point; 3]| ((t[1].x - t[0].x) * (t[2].y - t[0].y) - (t[1].y - t[0].y) * (t[2].x - t[0].x)) / 2.0;
assert!((triangles.iter().map(area).sum::<f64>() - 12.0).abs() < 1e-9);
for t in &triangles {
for (a, b) in [(t[0], t[1]), (t[1], t[2]), (t[2], t[0])] {
for q in &outline {
assert!(!super::touches((q.x, q.y), (a.x, a.y), (b.x, b.y)), "{q:?} lies inside the edge {a:?} to {b:?}");
}
}
}
}
#[test]
fn flat_triangles_stop_at_their_budget() {
let p = |x: f64, y: f64| Point::new(x, y);
let outline = vec![p(0.0, 0.0), p(10.0, 0.0), p(10.0, 10.0), p(0.0, 10.0)];
let hole = vec![p(1.0, 4.0), p(1.0, 6.0), p(2.0, 6.0), p(2.0, 4.0)];
let mut all = 0;
assert!(flat_triangles(&[outline.clone(), hole.clone()], &mut all, usize::MAX).is_some());
let mut work = 0;
assert!(flat_triangles(&[outline, hole], &mut work, all - 1).is_none());
assert!(work >= all, "{work} of {all}");
}
#[test]
fn a_beveled_extrusion_stays_closed() {
let mut b = BezPath::new();
+16 -4
View File
@@ -30,10 +30,10 @@ use build::{Camera, cuts, edge_distance, newell, section};
pub(crate) use build::{Face3, Keep, extrude_faces, plane_faces};
pub use build::{extrude, extrude_side_size, extrude_surfaces, plane};
pub use face_map::{FaceMap, MeshFace, extrude_face_map, extrude_mesh_face, plane_face_map, plane_mesh_face};
#[cfg(test)]
use inflate::GRID_WORK;
pub(crate) use inflate::inflate_faces;
#[cfg(test)]
use inflate::{FLAT_BUDGET, FLAT_WORK, GRID_WORK, MAX_FLAT_CORNERS, MAX_FLAT_WORK};
#[cfg(test)]
pub(crate) use inflate::{INFLATED, PUFFED, SOLVE_FIRST};
pub use inflate::{inflate, inflate_each, inflate_together};
#[cfg(test)]
@@ -354,11 +354,15 @@ pub struct Inflate {
pub taper: f64,
/// A closed back (a solid) or none, so the inflated front is a shell open behind.
pub cap: bool,
/// Graphics are mapped onto the front or the puffed back: the pieces of those faces are drawn
/// as triangles, each carrying where its corners lie in the art's plane ([`Facet::surface`]).
/// Off by default, which leaves the facets without one.
pub map_surface: bool,
}
impl Default for Inflate {
fn default() -> Self {
Self { depth: 0.0, volume: 50.0, both_sides: false, twist: 0.0, taper: 1.0, cap: true }
Self { depth: 0.0, volume: 50.0, both_sides: false, twist: 0.0, taper: 1.0, cap: true, map_surface: false }
}
}
@@ -414,8 +418,15 @@ pub struct Facet {
pub end: Option<PlanarFace>,
/// For a piece of Extrude & Bevel's side built for graphics ([`Extrude::map_surface`]): where
/// its corners lie on the side unrolled flat, for a graphic mapped onto it. x runs along the
/// outline and y from the front toward the back ([`crate::SurfaceCell`]).
/// outline and y from the front toward the back ([`crate::SurfaceCell`]). For a piece of
/// Inflate's front or puffed back built for graphics ([`Inflate::map_surface`]): where its
/// corners lie in the art's plane, as offsets from the center of the bounds the solid was built
/// with. The back's corners are where they were in the art before the twist and taper turned
/// and scaled it.
pub surface: Option<crate::SurfaceCell>,
/// The face of Inflate's solid that a facet with a [`Facet::surface`] is a piece of: its front
/// or its puffed back. `None` for every other facet, Extrude & Bevel's side included.
pub membrane: Option<PlanarFace>,
/// The face's plane in view space and the projection it was drawn with, for its depth at a
/// point of the drawing ([`Facet::depth_at`]). `None` for a face whose corners lie more than
/// 0.001 pt off one plane (a piece of a twisted wall) or reach the eye.
@@ -514,6 +525,7 @@ impl Facet {
away: false,
// Revolve's graphics are drawn from its faces, before they become facets.
surface: None,
membrane: None,
plane: face.plane,
#[cfg(test)]
view: vec![],
+1
View File
@@ -232,6 +232,7 @@ impl<'a> Builder<'a> {
away: behind,
end: None,
surface: None,
membrane: None,
plane,
cell: None,
#[cfg(test)]
+98 -13
View File
@@ -1,7 +1,7 @@
use super::build::{Builder, Built, Camera, Keep, Order, Turn, check_bounds, cuts, fit, newell, outward};
use super::membrane::{Edges, MAX_MATERIAL_SEGMENTS, Membrane, cell_triangles, clip, crossings, filled, material};
use super::rings::{MAX_SOLID_POINTS, TOO_COMPLEX_SURFACE, curve_pieces, signed_area, solid_rings};
use super::{Facet, FillRule, Inflate, MAX_FACES, MAX_SOLID_FACES, PathData, Point, Rect, V3, Vec2, View};
use super::{Facet, FillRule, Inflate, MAX_FACES, MAX_SOLID_FACES, PathData, PlanarFace, Point, Rect, V3, Vec2, View};
/// The slices the sides are cut into: more to follow a twist or taper.
fn slices(o: &Inflate) -> usize {
@@ -196,6 +196,44 @@ thread_local! {
pub(crate) static INFLATED: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
/// The grid work of the last solid this thread inflated in full, for the tests.
pub(super) static GRID_WORK: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
/// The work of cutting cells with holes for graphics in the last solid this thread inflated
/// in full, for the tests.
pub(super) static FLAT_WORK: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
/// The work the next solids of this thread may take cutting cells with holes for graphics,
/// for the tests.
pub(super) static FLAT_BUDGET: std::cell::Cell<usize> = const { std::cell::Cell::new(MAX_FLAT_WORK) };
}
/// Most work one inflated surface may take cutting the cells graphics are mapped onto that
/// [`cell_triangles`] can't take (a hole inside the cell, or a ring of more corners), all its
/// cells together ([`crate::mesh::flat_triangles`]).
pub(super) const MAX_FLAT_WORK: usize = 1 << 26;
/// Most corners the pieces of one such cell may have.
pub(super) const MAX_FLAT_CORNERS: usize = 4096;
/// The work cutting cells with holes for graphics may take.
fn flat_budget() -> usize {
#[cfg(test)]
return FLAT_BUDGET.with(std::cell::Cell::get);
#[cfg(not(test))]
MAX_FLAT_WORK
}
/// Marks the facet the builder `b` added after it held `before` facets, if it added one, as a piece
/// of `face` (Inflate's front or puffed back) whose corners lie at the art points `points`, as
/// offsets from `center` ([`Facet::surface`]). `outward` is the triangle's normal pointing out of
/// the solid: the piece shows the outside of the surface when it was neither turned around to show
/// its inside (on a shell open behind) nor kept turned away.
fn mark_surface(b: &mut Builder<'_>, before: usize, points: [Point; 3], center: Point, outward: V3, face: PlanarFace) {
if b.facets.len() <= before {
return;
}
let Some(f) = b.facets.last_mut() else { return };
let Some(page) = f.contours.first().filter(|c| c.len() == 3).cloned() else { return };
let shows = !f.away && f.normal[0] * outward.0 + f.normal[1] * outward.1 + f.normal[2] * outward.2 > 0.0;
f.surface = Some(crate::SurfaceCell { page, uv: points.iter().map(|q| Point::new(q.x - center.x, q.y - center.y)).collect(), outward: shows });
f.membrane = Some(face);
}
/// The facets of one inflated shape, for a camera that allows for a puff `reach` high (or the
@@ -241,6 +279,8 @@ fn inflated(p: Puff, bounds: Rect, o: Inflate, view: View, reach: f64, keep: Kee
};
let smooth = view.shade && view.has_colored_lights();
let camera = Camera::new(view, bounds, o.depth + 2.0 * height.max(reach));
// A graphic's offsets are from the center of the bounds the solid is built with.
let center = bounds.center();
// Without its back cap the object is a shell open behind, its inside showing.
let mut b = Builder::new(&camera, o.cap, false, keep);
let half = o.depth / 2.0;
@@ -260,6 +300,8 @@ fn inflated(p: Puff, bounds: Rect, o: Inflate, view: View, reach: f64, keep: Kee
// builds the topology of every outline ring near its cell, so a self-crossing outline cost its
// crossings again in every cell it spans. Past it, cells take their clipped pieces.
let material_left = std::cell::Cell::new(MAX_MATERIAL_SEGMENTS);
// The work of cutting cells with holes for graphics, all the cells together ([`MAX_FLAT_WORK`]).
let mut flat_work = 0usize;
// Every ring's bounds, and the crossings of the last few rows the cells' centres lie on (a
// row of cells has at most seven, at its three levels).
let ring_bounds: Vec<Option<Rect>> =
@@ -410,22 +452,63 @@ fn inflated(p: Puff, bounds: Rect, o: Inflate, view: View, reach: f64, keep: Kee
out
})
.collect();
if height > 0.0
&& smooth
&& let Some(triangles) = cell_triangles(&pieces)
{
// Smooth shading draws the pieces as triangles, and so do graphics mapped onto
// the front or back: each triangle then carries where its corners lie in the
// art's plane.
let smoothed = height > 0.0 && smooth;
let triangles = match (smoothed || o.map_surface).then(|| cell_triangles(&pieces)) {
// A cell graphics are mapped onto that the quick cut can't take (a hole
// inside it, or a ring of more corners) is cut with its holes, against one
// budget for the whole surface. Drawn whole instead, its piece would show
// no graphics.
Some(None) if o.map_surface => {
if pieces.iter().map(Vec::len).fold(0usize, usize::saturating_add) > MAX_FLAT_CORNERS {
return Err(TOO_COMPLEX_SURFACE.into());
}
let budget = flat_budget();
let holed = crate::mesh::flat_triangles(&pieces, &mut flat_work, budget);
if flat_work > budget {
return Err(TOO_COMPLEX_SURFACE.into());
}
Some(holed.ok_or_else(|| TOO_COMPLEX_SURFACE.to_string())?)
}
quick => quick.flatten(),
};
if let Some(triangles) = triangles {
let order = if flat { Order::Last } else { Order::Depth };
for points in triangles {
let front = points.map(|q| camera.place(q, half + lift(q)));
b.smooth_triangle(front, points.map(|q| camera.rotate(normal(q))), false)?;
let before = b.facets.len();
let outward = newell(&[front.to_vec()]);
if smoothed {
b.smooth_triangle(front, points.map(|q| camera.rotate(normal(q))), false)?;
} else {
b.face(vec![front.to_vec()], outward, order)?;
}
if o.map_surface {
mark_surface(&mut b, before, points, center, outward, PlanarFace::Front);
}
if o.both_sides && o.cap {
let back = points.map(|q| camera.place(back_turn.apply(q), -half - lift(q) * back_turn.scale));
let normals = points.map(|q| {
let n = normal(q);
// A uniform taper scales all three coordinates equally;
// twist turns the back normal about the shape's z-axis.
camera.rotate(V3(back_turn.cos * n.0 - back_turn.sin * n.1, back_turn.sin * n.0 + back_turn.cos * n.1, -n.2))
});
b.smooth_triangle(back, normals, true)?;
let before = b.facets.len();
let n = newell(&[back.to_vec()]);
// The back winds the same way round as the front, so its outward
// normal is reversed.
let outward = V3(-n.0, -n.1, -n.2);
if smoothed {
let normals = points.map(|q| {
let n = normal(q);
// A uniform taper scales all three coordinates equally;
// twist turns the back normal about the shape's z-axis.
camera.rotate(V3(back_turn.cos * n.0 - back_turn.sin * n.1, back_turn.sin * n.0 + back_turn.cos * n.1, -n.2))
});
b.smooth_triangle(back, normals, true)?;
} else {
b.face(vec![back.to_vec()], outward, order)?;
}
if o.map_surface {
mark_surface(&mut b, before, points, center, outward, PlanarFace::Back);
}
}
}
continue;
@@ -507,6 +590,8 @@ fn inflated(p: Puff, bounds: Rect, o: Inflate, view: View, reach: f64, keep: Kee
}
#[cfg(test)]
GRID_WORK.with(|w| w.set(edges.work()));
#[cfg(test)]
FLAT_WORK.with(|w| w.set(flat_work));
if edges.spent() {
return Err(TOO_COMPLEX_SURFACE.into());
}
+117 -1
View File
@@ -457,6 +457,122 @@ fn inflate_leaves_holes_open() {
assert!(close(area(&f), 100.0 * 100.0 - 40.0 * 40.0, 1e-3), "{}", area(&f));
}
#[test]
fn inflate_marks_where_each_piece_lies_in_the_art_for_graphics() {
let (p, r) = shape(&square(0.0, 0.0, 100.0));
let on = |o: Inflate, view: View| inflate(&p, FillRule::EvenOdd, r, Inflate { map_surface: true, ..o }, view).unwrap();
// Without the request no piece carries a surface point.
assert!(inflate(&p, FillRule::EvenOdd, r, Inflate::default(), front()).unwrap().iter().all(|f| f.surface.is_none() && f.membrane.is_none()));
// Straight on, every piece is a front triangle whose corners lie where the art does, as
// offsets from the center of the bounds, and together they cover the shape.
let f = on(Inflate::default(), front());
let marked: Vec<&Facet> = f.iter().filter(|f| f.surface.is_some()).collect();
assert!(marked.len() > 20, "{}", marked.len());
assert!(close(marked.iter().map(|f| signed_area(&f.contours[0]).abs()).sum::<f64>(), 100.0 * 100.0, 1e-3));
for f in &marked {
let s = f.surface.as_ref().unwrap();
assert_eq!(f.membrane, Some(PlanarFace::Front));
assert!(s.outward);
for (page, uv) in s.page.iter().zip(&s.uv) {
assert!(close(page.x, uv.x + 50.0, 1e-6) && close(page.y, uv.y + 50.0, 1e-6), "{page:?} {uv:?}");
}
}
// Both sides puffs a back: seen from behind its pieces show their outside, and under Twist
// they keep the untwisted art points while the pieces turn on the page.
let behind = View { rotation_y: 180.0, ..front() };
let back = |o: Inflate| {
on(o, behind)
.into_iter()
.filter(|f| f.membrane == Some(PlanarFace::Back) && f.surface.as_ref().is_some_and(|s| s.outward))
.collect::<Vec<_>>()
};
let plain = back(Inflate { both_sides: true, ..Inflate::default() });
assert!(!plain.is_empty());
let twisted = back(Inflate { both_sides: true, twist: 30.0, ..Inflate::default() });
assert!(!twisted.is_empty());
let uv_extent =
|f: &[Facet]| f.iter().flat_map(|f| f.surface.as_ref().unwrap().uv.clone()).fold(Rect::new(0.0, 0.0, 0.0, 0.0), |r, q| r.union_pt(q));
assert!(close(uv_extent(&twisted).width(), 100.0, 1e-6) && close(uv_extent(&twisted).height(), 100.0, 1e-6));
assert!(extent(&twisted).width() > extent(&plain).width() + 10.0, "{:?} {:?}", extent(&twisted), extent(&plain));
// Without Both sides there is no back to mark.
assert!(on(Inflate::default(), behind).iter().all(|f| f.membrane != Some(PlanarFace::Back)));
}
/// A square 0.3 pt across with its corner at the lattice point `(qx, qy)` of the grid of a
/// 100 pt shape, offset 0.1 pt: it lies inside one quarter cell of that grid.
fn speck(qx: f64, qy: f64) -> BezPath {
let unit = 100.0 / 48.0 / 4.0;
square(qx * unit + 0.1, qy * unit + 0.1, 0.3)
}
/// The area of the pieces marked for graphics on `face`.
fn mapped_area(f: &[Facet], face: PlanarFace) -> f64 {
f.iter().filter(|f| f.membrane == Some(face)).map(|f| signed_area(&f.contours[0]).abs()).sum()
}
/// A hole inside one cell of the surface's grid leaves that cell's piece with a hole in it:
/// graphics still map onto the rest of the cell, front and back, and the hole stays open.
#[test]
fn inflate_maps_graphics_around_a_hole_inside_one_cell() {
let mut b = square(0.0, 0.0, 100.0);
b.extend(speck(96.0, 96.0));
let (p, r) = shape(&b);
let o = Inflate { map_surface: true, both_sides: true, ..Inflate::default() };
let f = inflate(&p, FillRule::EvenOdd, r, o, front()).unwrap();
let mapped = mapped_area(&f, PlanarFace::Front);
assert!(close(mapped, 100.0 * 100.0 - 0.3 * 0.3, 1e-3), "{mapped}");
let f = inflate(&p, FillRule::EvenOdd, r, o, View { rotation_y: 180.0, ..front() }).unwrap();
let mapped = mapped_area(&f, PlanarFace::Back);
assert!(close(mapped, 100.0 * 100.0 - 0.3 * 0.3, 1e-3), "{mapped}");
}
/// The cells graphics are mapped onto that need their holes cut out share one budget for the
/// whole surface: past it the surface is refused, however little each cell takes.
#[test]
fn inflate_cuts_holed_cells_for_graphics_within_one_budget() {
let mut b = square(0.0, 0.0, 100.0);
for i in 0..8 {
for j in 0..8 {
b.extend(speck(20.0 + 20.0 * i as f64, 20.0 + 20.0 * j as f64));
}
}
let (p, r) = shape(&b);
let o = Inflate { map_surface: true, ..Inflate::default() };
let f = inflate(&p, FillRule::EvenOdd, r, o, front()).unwrap();
assert!(close(mapped_area(&f, PlanarFace::Front), 100.0 * 100.0 - 64.0 * 0.3 * 0.3, 1e-3));
let all = FLAT_WORK.with(std::cell::Cell::get);
assert!(all > 0);
// Half the work all 64 cells took is far more than any one of them takes.
FLAT_BUDGET.with(|w| w.set(all / 2));
let half = inflate(&p, FillRule::EvenOdd, r, o, front());
FLAT_BUDGET.with(|w| w.set(MAX_FLAT_WORK));
assert_eq!(half.err().as_deref(), Some(TOO_COMPLEX_SOLID));
// The art draws without graphics as before.
assert!(inflate(&p, FillRule::EvenOdd, r, Inflate::default(), front()).is_ok());
}
/// A cell graphics are mapped onto whose pieces have more corners than one cut may take refuses
/// the surface rather than drawing that cell without its graphics.
#[test]
fn inflate_refuses_graphics_on_a_cell_with_too_many_corners() {
let mut b = square(0.0, 0.0, 100.0);
let unit = 100.0 / 48.0 / 4.0;
let c = Point::new(96.5 * unit, 96.5 * unit);
let n = MAX_FLAT_CORNERS + 10;
let mut ring = BezPath::new();
for k in 0..n {
let a = -std::f64::consts::TAU * k as f64 / n as f64;
let q = (c.x + 0.2 * a.cos(), c.y + 0.2 * a.sin());
if k == 0 { ring.move_to(q) } else { ring.line_to(q) }
}
ring.close_path();
b.extend(ring);
let (p, r) = shape(&b);
let mapped = inflate(&p, FillRule::EvenOdd, r, Inflate { map_surface: true, ..Inflate::default() }, front());
assert_eq!(mapped.err().as_deref(), Some(TOO_COMPLEX_SOLID));
assert!(inflate(&p, FillRule::EvenOdd, r, Inflate::default(), front()).is_ok());
}
#[test]
fn malformed_and_degenerate_input_is_bounded() {
let (p, b) = shape(&square(0.0, 0.0, 100.0));
@@ -483,7 +599,7 @@ fn malformed_and_degenerate_input_is_bounded() {
&p,
FillRule::EvenOdd,
b,
Inflate { depth: -5.0, volume: f64::NAN, both_sides: true, twist: f64::INFINITY, taper: f64::NAN, cap: true },
Inflate { depth: -5.0, volume: f64::NAN, both_sides: true, twist: f64::INFINITY, taper: f64::NAN, cap: true, map_surface: false },
front()
)
.is_ok()
+15 -7
View File
@@ -1,7 +1,7 @@
//! Shape Builder (Shift+M), Live Paint Bucket (K) and Live Paint Selection (Shift+L).
//! Shape Builder (Shift+M), Live Paint Bucket (K), Fill Area and Live Paint Selection (Shift+L).
//!
//! The tools only emit commands (`shapeBuilder.merge`, `livePaint.fill`, `livePaint.strokeEdge`,
//! `select.*`); the planar arrangement comes from `vectorcraft_pathops::shape_builder` (Shape
//! The tools only emit commands (`shapeBuilder.merge`, `shapeBuilder.copyRegion`, `livePaint.fill`,
//! `livePaint.strokeEdge`, `select.*`); the planar arrangement comes from `vectorcraft_pathops::shape_builder` (Shape
//! Builder) and `vectorcraft_pathops::live_paint` (Live Paint).
//!
//! **Live Paint groups** are ordinary groups (no special node kind): the group's name starts with
@@ -28,11 +28,13 @@ use crate::{Action, Cursor, Mods, Overlay, PointerEvent, PointerKind, Tool, Tool
pub use po::SHAPE_BUILDER_MAX_GAP;
mod cache;
mod fill_area;
mod live_paint;
mod lookup;
mod map;
use cache::{BACKGROUND_SEGMENTS, CacheKey, RegionCache};
pub use fill_area::{AreaFinder, EnclosedArea, FillAreaTool, every_layer, fill_area_roots};
#[cfg(test)]
use live_paint::LpHover;
pub use live_paint::{
@@ -868,11 +870,16 @@ impl Tool for ShapeBuilderTool {
/// is not true or false, a `pickColorFrom` other than `artwork` or `swatches`, a `selection` other
/// than `freeform` or `straightLine`, a `highlightColor` that is not an RGB color without an alpha
/// part and a `gapLength` that is not a finite number are errors. A finite gap length out of 0 to
/// [`SHAPE_BUILDER_MAX_GAP`] is not an error: the tool clamps it. The Live Paint tools are checked
/// by [`check_live_paint_options`]; Ok for every other tool. Saved settings go to the tools'
/// `set_option` instead, which skips a value it cannot read.
/// [`SHAPE_BUILDER_MAX_GAP`] is not an error: the tool clamps it. `fillArea` takes only
/// `gapDetection`, `gapLength` and `openFilledAsClosed`, checked the same way. The Live Paint tools
/// are checked by [`check_live_paint_options`]; Ok for every other tool. Saved settings go to the
/// tools' `set_option` instead, which skips a value it cannot read.
pub fn check_builder_options(tool: &str, values: &serde_json::Map<String, Value>) -> Result<(), String> {
if tool != "shapeBuilder" {
if tool == "fillArea" {
if let Some(key) = values.keys().find(|k| !matches!(k.as_str(), "gapDetection" | "gapLength" | "openFilledAsClosed")) {
return Err(format!("unknown Fill Area option `{key}`"));
}
} else if tool != "shapeBuilder" {
return check_live_paint_options(tool, values);
}
let one_of = |key: &str, v: &Value, names: &[&str]| {
@@ -902,6 +909,7 @@ pub fn create(id: &str) -> Option<Box<dyn Tool>> {
"shapeBuilder" => Box::new(ShapeBuilderTool::default()),
"livePaintBucket" => Box::new(LivePaintBucketTool::default()),
"livePaintSelection" => Box::new(LivePaintSelectionTool::default()),
"fillArea" => Box::new(FillAreaTool::new()),
_ => return None,
})
}
+701
View File
@@ -0,0 +1,701 @@
//! The Fill Area tool: a click inside an area that visible, unlocked paths enclose adds a new
//! closed path of that area with the current fill and stroke (`shapeBuilder.copyRegion`). The
//! paths around the area stay as they are, and nothing needs to be selected.
use vectorcraft_geom::path::segment_bounds;
use vectorcraft_geom::{ParamCurve, PathSeg};
use super::lookup::path_contains;
use super::*;
/// The area [`AreaFinder::find`] finds under a point.
#[derive(Clone, Debug, PartialEq)]
pub struct EnclosedArea {
/// The area's outline, as a Shape Builder merge of that one region makes it.
pub path: PathData,
/// The object directly in a layer that holds the front-most path along the area (its outline
/// touches the area's outline, or it covers the area), or in isolation mode the object directly
/// in the isolated object: the new path goes directly above it, so it never goes inside a group,
/// a Live Paint group, a Shaper group or a clipping group other than the isolated one.
pub above: NodeId,
}
/// How many times [`AreaFinder::find`] widens the part of the document it maps before it maps
/// every path.
const WINDOW_ROUNDS: usize = 24;
/// The side (pt) of the first window [`AreaFinder::find`] maps around a point that no path's bounds
/// hold.
const FIRST_WINDOW: f64 = 32.0;
/// How many times [`AreaFinder::find`] makes the window four times larger when the paths in it hold
/// no area under the point, before it maps every path: a 32 pt window reaches 8,192 pt.
const NEAR_ROUNDS: usize = 4;
/// Finds the area under a point among the paths of some objects, mapping only the paths near the
/// point first: an area that lies inside a window is bounded by the paths whose bounds reach the
/// window, so the paths outside it cannot change it. When the maps of [`NEAR_ROUNDS`] larger windows
/// have no area under the point, or the area does not fit after [`WINDOW_ROUNDS`] widenings, the
/// finder maps every path. When a window's paths have more segments than one Shape Builder map
/// takes, the paths with the most segments are left out until the rest fit, and an area is taken
/// only when no path left out crosses it or comes within the gap of it; a path left out that
/// covers it still counts for where the new path goes. When every path together has more segments than that,
/// an area no window finds is not found. The map of every path, once a search has needed it, is
/// kept for the next search.
pub struct AreaFinder {
/// The inputs back → front, as [`shape_builder_shapes`] gives them, with their bounds and the
/// object directly in a layer that holds each one ([`outermost`]).
inputs: Vec<(po::Shape, Rect, NodeId)>,
/// The bounds of every input.
total: Option<Rect>,
gap: f64,
/// The segments of all the inputs.
segments: usize,
/// Whether all the inputs fit the segment limit of one Shape Builder map. Past it a map keeps
/// only the filled areas and loses the lines between them, so no map of every input is made.
fits: bool,
/// The map of every input, with the index of each of its shapes in `inputs`.
full: Option<(BuilderMap, Vec<usize>)>,
}
/// Does `r` hold `p`, edges included?
fn holds(r: &Rect, p: Point) -> bool {
p.x >= r.x0 && p.x <= r.x1 && p.y >= r.y0 && p.y <= r.y1
}
/// Do `a` and `b` overlap or touch?
fn meet(a: &Rect, b: &Rect) -> bool {
a.x0 <= b.x1 && b.x0 <= a.x1 && a.y0 <= b.y1 && b.y0 <= a.y1
}
/// The area a path left out of a window's map may cut: its outline, the same as a closed path
/// (`bez`), and the box (`zone`) its outline reaches with the gap.
struct Reach<'a> {
face: &'a PathData,
bez: &'a vectorcraft_geom::kurbo::BezPath,
zone: Rect,
/// How close (pt) to the outline a path may come and still change the area: the gap and 1 pt.
reach: f64,
}
/// Does a segment of `path` (closing segments included) lie inside the area or come within its
/// reach of the area's outline? A path in the box of the area may still lie wholly outside the
/// area, in the empty corner of an L or around it, and such a path does not change it. `budget`
/// counts the work (pieces checked times the outline's segments); when it runs out, the path
/// counts as cutting the area.
fn cuts(path: &PathData, area: &Reach, budget: &mut usize) -> bool {
let bez = path.to_bezpath();
let cost = area.face.subpaths.iter().map(|sp| sp.segment_count()).sum::<usize>().max(1);
vectorcraft_geom::kurbo::segments(bez.elements().iter().copied()).any(|seg| segment_cuts(seg, area, cost, budget, 0))
}
/// How many times [`segment_cuts`] halves a segment: a piece of 1/2^24 of a segment near the area
/// counts as cutting it.
const REACH_SPLITS: u32 = 24;
/// The side (pt) below which a piece of a segment that may come within reach of the area counts as
/// cutting it.
const REACH_TOLERANCE: f64 = 0.01;
/// How much work [`cuts`] does for one area before it takes a path as cutting it: pieces checked
/// times the segments of the area's outline.
const CUT_BUDGET: usize = 1 << 24;
/// Does `seg` lie inside the area or come within its reach of the area's outline? A piece whose
/// box misses the area's zone does not; a piece whose middle is inside the area or within reach of
/// its outline does; a piece farther from the outline than its box is wide does not, since every
/// point of it is then out of reach and on the same side. The rest is halved.
fn segment_cuts(seg: PathSeg, area: &Reach, cost: usize, budget: &mut usize, depth: u32) -> bool {
let b = segment_bounds(seg);
if !meet(&b, &area.zone) {
return false;
}
let Some(left) = budget.checked_sub(cost) else { return true };
*budget = left;
let mid = seg.eval(0.5);
if area.bez.winding(mid) != 0 {
return true;
}
let Some((.., d)) = area.face.nearest(mid) else { return true };
if d <= area.reach {
return true;
}
let wide = b.width().hypot(b.height());
if d - area.reach > wide {
return false;
}
if depth >= REACH_SPLITS || wide < REACH_TOLERANCE {
return true;
}
segment_cuts(seg.subsegment(0.0..0.5), area, cost, budget, depth + 1) || segment_cuts(seg.subsegment(0.5..1.0), area, cost, budget, depth + 1)
}
/// How far (pt) an anchor of an area's outline may lie from a path's outline, with Gap Detection
/// off, and still count as on it: the least snap distance [`outline_snap`] gives, five times the
/// 0.01 pt precision the Shape Builder's map works to.
const CONTACT: f64 = 0.05;
/// Does the filled area of the closed subpaths of `s` hold `p`?
fn covers(s: &po::Shape, p: Point) -> bool {
let closed = PathData::new(s.path.subpaths.iter().filter(|sp| sp.closed).cloned().collect());
path_contains(&closed, s.rule, p)
}
/// Does `outer` hold all of `inner`?
fn within(inner: &Rect, outer: &Rect) -> bool {
inner.x0 >= outer.x0 && inner.x1 <= outer.x1 && inner.y0 >= outer.y0 && inner.y1 <= outer.y1
}
/// The object directly in `scope` (the isolated object in isolation mode), or else directly in a
/// layer (or sublayer), that holds `id`: `id` itself when `scope` or a layer holds it, or when `id`
/// is `scope`.
fn outermost(doc: &Document, id: NodeId, scope: Option<NodeId>) -> NodeId {
let Some(line) = doc.ancestry(id) else { return id };
let k = match scope {
Some(s) => line.iter().rposition(|a| *a == s),
None => line.iter().rposition(|a| doc.node(*a).is_some_and(|n| n.is_layer())),
};
k.and_then(|k| line.get(k + 1)).copied().unwrap_or(id)
}
/// Does `n` make, move or combine the art in it itself, so that a new path in it would not stay as
/// Fill Area adds it: a Live Paint group, a compound shape, a Shaper group, a graph, an Image Trace
/// result, a dimension, a flare or an Objects on Path group.
fn managed(n: &Node) -> bool {
let e = n.extras();
super::lookup::is_live_paint(n)
|| n.is_compound_shape()
|| e.shaper.is_some()
|| e.graph.is_some()
|| e.trace.is_some()
|| e.dimension.is_some()
|| e.flare.is_some()
|| e.objects_on_path.is_some()
}
/// The roots the Fill Area tool and `shapeBuilder.copyRegion` find areas among, with the isolated
/// object the new path goes into ([`AreaFinder::new`]'s `scope`), for `isolation` (the document's
/// isolated object) and `named` (the objects or layers named; None: every layer). In isolation mode
/// only the isolated layer or group's paths count: of `named`, the ones inside it, with the
/// isolated object in place of one that holds it. An isolated object that no longer exists counts
/// as no isolation. None while an object that is not a layer or a group is isolated (a compound
/// path or a single path), a layer or group with a live effect, a group that is [`managed`], a
/// clipping group or clipped layer, or one inside such an object or inside another object that is
/// not a layer or a group (an envelope): no area is found then.
pub fn fill_area_roots(doc: &Document, isolation: Option<NodeId>, named: Option<&[NodeId]>) -> Option<(Vec<NodeId>, Option<NodeId>)> {
let Some(iso) = isolation.filter(|i| doc.node(*i).is_some()) else {
return Some((named.map_or_else(|| every_layer(doc), <[NodeId]>::to_vec), None));
};
let line = doc.ancestry(iso)?;
// Every object from the layer down to the isolated one is a layer or a plain group: an
// envelope, a blend or another object that draws its contents its own way does not hold
// the new path as drawn.
// A layer or group with a live effect (a Transform effect moves what is in it) draws the new
// path elsewhere than the area.
let plain =
|a: &Node| (a.is_layer() || (matches!(a.kind, NodeKind::Group { .. }) && !managed(a))) && !a.appearance.effects.iter().any(|e| e.visible);
if !line.iter().all(|a| doc.node(*a).is_some_and(plain)) {
return None;
}
// A clipping group or clipped layer's mask clips and is not painted, and its mask hides or cuts
// a new path among the art it clips.
if line.iter().any(|a| doc.node(*a).is_some_and(Node::clips)) {
return None;
}
let Some(named) = named else { return Some((vec![iso], Some(iso))) };
let mut out = vec![];
for r in named {
if line.contains(r) {
out.push(iso);
} else if doc.ancestry(*r).is_some_and(|a| a.contains(&iso)) {
out.push(*r);
}
}
Some((out, Some(iso)))
}
impl AreaFinder {
/// The finder over the paths of `roots` (layers or objects) that the Shape Builder takes:
/// visible, unlocked paths, compound paths and Live Paint faces and edges that draw, not on a
/// locked artboard. Gaps up to `gap` close, and with `open_filled_as_closed` a filled open path
/// bounds an area as if an invisible edge closed it. With `scope` (the isolated object in
/// isolation mode), an area's new path goes directly above the object in `scope` that holds the
/// front-most path along it, so it stays inside the isolated object.
pub fn new(doc: &Document, roots: &[NodeId], scope: Option<NodeId>, gap: f64, open_filled_as_closed: bool) -> Self {
let roots = sorted_roots(doc, roots);
let (shapes, leaves) = shape_builder_shapes(doc, &roots, open_filled_as_closed);
let editable = doc.editable();
let inputs: Vec<(po::Shape, Rect, NodeId)> = shapes
.into_iter()
.zip(leaves)
.filter(|(_, l)| editable(l.id))
.filter_map(|(s, l)| {
let b = s.path.bounds()?;
Some((s, b, outermost(doc, l.id, scope)))
})
.collect();
let total = inputs.iter().map(|(_, b, _)| *b).reduce(|a, b| a.union(b));
let gap = if gap.is_finite() { gap.clamp(0.0, SHAPE_BUILDER_MAX_GAP) } else { 0.0 };
let segments: usize = inputs.iter().flat_map(|(s, ..)| &s.path.subpaths).map(|sp| sp.segment_count()).sum();
Self { inputs, total, gap, segments, fits: segments <= po::SHAPE_BUILDER_MAX_SEGMENTS, full: None }
}
/// The area under `p`: the smallest region of the map of the paths that holds `p`. None when
/// `p` is in no enclosed area.
pub fn find(&mut self, p: Point) -> Option<EnclosedArea> {
if let Some((map, picked)) = &self.full {
return self.area_in(map, picked, &[], p);
}
let total = self.total?;
// A gap bridge reaches at most `gap` past a path, so a window takes in every path within
// that of it.
let reach = self.gap + 1.0;
if !holds(&total.inflate(reach, reach), p) {
return None;
}
let mut window = self
.inputs
.iter()
.filter(|(_, b, _)| holds(&b.inflate(reach, reach), p))
.map(|(_, b, _)| *b)
.reduce(|a, b| a.union(b))
.unwrap_or_else(|| Rect::from_center_size(p, (FIRST_WINDOW, FIRST_WINDOW)));
let mut near = 0;
let mut every_path = false;
// The paths left out of the windows' maps to keep them within the segment limit, by index.
let mut left_out = vec![false; self.inputs.len()];
let mut any_left_out = false;
for round in 0..=WINDOW_ROUNDS {
let last = every_path || round == WINDOW_ROUNDS;
if last && !self.fits {
return None;
}
let zone = window.inflate(reach, reach);
let mut picked: Vec<usize> = (0..self.inputs.len())
.filter(|&i| last || (!left_out.get(i).is_some_and(|o| *o) && self.inputs.get(i).is_some_and(|(_, b, _)| meet(b, &zone))))
.collect();
// Past the segment limit a map keeps only the filled areas, so the paths with the most
// segments stay out of the window's map.
if !last {
for i in self.over_limit(&picked) {
if let Some(o) = left_out.get_mut(i) {
*o = true;
any_left_out = true;
}
}
picked.retain(|&i| !left_out.get(i).is_some_and(|o| *o));
}
let every = picked.len() == self.inputs.len();
let shapes: Vec<po::Shape> = picked.iter().filter_map(|&i| self.inputs.get(i).map(|(s, ..)| s.clone())).collect();
let map = BuilderMap::of_shapes(shapes, false, self.gap);
let face = map.region_at(p).and_then(|k| map.regions.get(k));
let bounds = face.map(|(.., rb)| *rb);
if every {
let area = self.area_in(&map, &picked, &[], p);
self.full = Some((map, picked));
return area;
}
let before = window;
match bounds {
// A path left out that crosses the area or comes within its reach could cut it, and
// only the map of every path holds both.
Some(rb) if within(&rb, &window) => {
let reached = rb.inflate(reach, reach);
let mut budget = CUT_BUDGET;
let cut = any_left_out
&& face.is_none_or(|(region, bez, _)| {
let area = Reach { face: &region.path, bez, zone: reached, reach };
self.inputs.iter().zip(&left_out).any(|((s, b, _), out)| *out && meet(b, &reached) && cuts(&s.path, &area, &mut budget))
});
if !cut {
return self.area_in(&map, &picked, &left_out, p);
}
every_path = true;
}
Some(rb) => window = window.union(rb),
// No area of the paths near the point holds it: an area that does is bounded by
// paths farther away. The window grows four times over a few rounds, and then the
// next round maps every path.
None if near < NEAR_ROUNDS => {
near += 1;
let (w, h) = (window.width().max(FIRST_WINDOW) * 4.0, window.height().max(FIRST_WINDOW) * 4.0);
window = window.union(Rect::from_center_size(window.center(), (w, h)));
}
None => window = total,
}
// A window that did not grow would give the same map again.
if window == before {
every_path = true;
}
}
None
}
/// The inputs among `picked` to leave out of a map so that the rest fit the segment limit of
/// one Shape Builder map: the ones with the most segments first. Empty when all of `picked` fit.
fn over_limit(&self, picked: &[usize]) -> Vec<usize> {
let segments = |i: usize| self.inputs.get(i).map_or(0, |(s, ..)| s.path.subpaths.iter().map(|sp| sp.segment_count()).sum::<usize>());
let mut sum: usize = picked.iter().map(|&i| segments(i)).sum();
let mut by_size: Vec<(usize, usize)> = picked.iter().map(|&i| (segments(i), i)).collect();
by_size.sort_by_key(|(n, _)| std::cmp::Reverse(*n));
let mut out = vec![];
for (n, i) in by_size {
if sum <= po::SHAPE_BUILDER_MAX_SEGMENTS {
break;
}
sum -= n;
out.push(i);
}
out
}
/// The area under `p` in `map`, made of the inputs `picked` (in its order). `left_out` marks
/// the inputs left out of the map, by index, none of which comes near the area: the front-most
/// of them that covers the area decides where the new path goes when it is in front of the
/// shape the map gives.
fn area_in(&self, map: &BuilderMap, picked: &[usize], left_out: &[bool], p: Point) -> Option<EnclosedArea> {
let (region, ..) = map.region_at(p).and_then(|k| map.regions.get(k))?;
let path = po::FaceMerger::with_gap(&map.shapes, self.gap).merge(&[region]);
if path.is_empty() {
return None;
}
let anchors: Vec<Point> = region.path.subpaths.iter().flat_map(|sp| sp.anchors.iter().map(|a| a.p)).collect();
// The front-most shape that covers the area or that an anchor of its outline lies on. A
// shape within the gap of an anchor counts only when no shape is along the area itself,
// so a path near the area that bounds none of it does not decide where the new path goes.
// Without a gap, an anchor is on a shape's outline within [`CONTACT`].
let along = |gap: f64| {
map.shapes.iter().enumerate().rev().find(|(i, s)| {
let tol = if gap > 0.0 { outline_snap(&s.path) + gap } else { CONTACT };
region.sources.contains(i)
|| s.path.bounds().is_some_and(|b| {
let b = b.inflate(tol, tol);
anchors.iter().any(|q| holds(&b, *q) && s.path.nearest(*q).is_some_and(|(.., d)| d <= tol))
})
})
};
let k = along(0.0).or_else(|| along(self.gap)).map_or(map.shapes.len().checked_sub(1)?, |(i, _)| i);
let mapped = *picked.get(k)?;
// A path left out comes near no part of the area, so it covers all of it or none of it.
let covering =
left_out.iter().enumerate().rev().find(|(i, out)| **out && *i > mapped && self.inputs.get(*i).is_some_and(|(s, ..)| covers(s, p)));
let front = covering.map_or(mapped, |(i, _)| i);
let above = self.inputs.get(front).map(|(.., id)| *id)?;
Some(EnclosedArea { path, above })
}
}
/// The paths the Fill Area tool finds areas among: every layer's.
pub fn every_layer(doc: &Document) -> Vec<NodeId> {
doc.layers.iter().map(|l| l.id).collect()
}
/// Fill Area (in the Live Paint Bucket's group): a click inside an area that visible, unlocked
/// paths on any layer enclose adds a new closed path of that area with the current fill and stroke
/// (`shapeBuilder.copyRegion`), directly above the front-most object along it. The paths stay as
/// they are and nothing needs to be selected. The area under the pointer is outlined while it
/// hovers. Gap Detection and Consider Open Filled Paths as Closed are the Shape Builder's options.
#[derive(Default)]
pub struct FillAreaTool {
gap_detection: bool,
gap_length: f64,
/// Consider Open Filled Paths as Closed turned off: a filled open path cuts areas as a line
/// does.
open_filled_cuts: bool,
/// The finder for the document as it is, with the key it was made for. Away while a search
/// runs on another thread.
finder: Option<(FinderKey, AreaFinder)>,
/// The area under the pointer, with the key of the finder that found it.
hover: Option<(FinderKey, EnclosedArea)>,
/// Where the pointer last moved over the canvas.
at: Option<Point>,
/// A hover search running on another thread.
job: Option<HoverJob>,
/// The key whose search on another thread failed: hovering does not search it again.
failed: Option<FinderKey>,
/// A press added the path as a preview, which the release keeps.
pressing: bool,
}
/// The document revision, the gap, the open-filled rule and the isolated object an [`AreaFinder`]
/// was made with.
type FinderKey = ((u64, u64), f64, bool, Option<NodeId>);
/// A search for the area under `p` on another thread, which hands back the finder it took.
struct HoverJob {
key: FinderKey,
p: Point,
done: std::sync::mpsc::Receiver<(AreaFinder, Option<EnclosedArea>)>,
}
#[cfg(not(target_arch = "wasm32"))]
thread_local! {
/// The hover searches this thread has started on other threads ([`hover_searches_started`]).
static HOVER_SEARCHES: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
}
/// How many hover searches this thread has started on other threads, for tests that count them.
#[cfg(all(test, not(target_arch = "wasm32")))]
pub(super) fn hover_searches_started() -> usize {
HOVER_SEARCHES.with(std::cell::Cell::get)
}
/// Runs `finder.find(p)` on another thread; gives the finder back when no thread starts.
#[cfg(not(target_arch = "wasm32"))]
fn spawn_find(finder: AreaFinder, p: Point) -> Result<std::sync::mpsc::Receiver<(AreaFinder, Option<EnclosedArea>)>, Box<AreaFinder>> {
HOVER_SEARCHES.with(|n| n.set(n.get() + 1));
let (tx, done) = std::sync::mpsc::channel();
let (back_tx, back) = std::sync::mpsc::channel();
let spawned = std::thread::Builder::new().name("vectorcraft-fill-area".into()).spawn(move || {
// The finder comes in through a channel, so a thread that does not start leaves it here.
if let Ok(mut f) = back.recv() {
let area = AreaFinder::find(&mut f, p);
// The tool may have dropped the receiver meanwhile (another tool, a new revision).
let _ = tx.send((f, area));
}
});
match spawned {
Ok(_) => match back_tx.send(finder) {
Ok(()) => Ok(done),
Err(e) => Err(Box::new(e.0)),
},
Err(_) => Err(Box::new(finder)),
}
}
/// The web build has no threads.
#[cfg(target_arch = "wasm32")]
fn spawn_find(finder: AreaFinder, _p: Point) -> Result<std::sync::mpsc::Receiver<(AreaFinder, Option<EnclosedArea>)>, Box<AreaFinder>> {
Err(Box::new(finder))
}
impl FillAreaTool {
/// A tool with the Shape Builder's default options.
pub fn new() -> Self {
Self { gap_length: GAP_LENGTHS[0], ..Self::default() }
}
fn gap(&self) -> f64 {
if self.gap_detection { self.gap_length } else { 0.0 }
}
fn open_filled_as_closed(&self) -> bool {
!self.open_filled_cuts
}
fn finder_key(&self, cx: &ToolContext) -> FinderKey {
(cx.revision, self.gap(), self.open_filled_as_closed(), cx.isolation)
}
/// The finder for the document as `cx` has it, made again when the key changed. In isolation
/// mode it takes only the isolated object's paths, as the command does.
fn take_finder(&mut self, cx: &ToolContext) -> AreaFinder {
let key = self.finder_key(cx);
match self.finder.take() {
Some((k, f)) if k == key => f,
_ => {
// An isolated object Fill Area does not work in gives a finder of no paths.
let (roots, scope) = fill_area_roots(cx.doc, key.3, None).unwrap_or_default();
AreaFinder::new(cx.doc, &roots, scope, key.1, key.2)
}
}
}
/// The hover area when it is current and holds `p`.
fn hover_holding(&self, cx: &ToolContext, p: Point) -> Option<&EnclosedArea> {
self.hover.as_ref().filter(|(k, a)| *k == self.finder_key(cx) && path_contains(&a.path, FillRule::NonZero, p)).map(|(_, a)| a)
}
/// The area under `p`, found here and now (a click). A search running on another thread is
/// waited for first, so its finder is not made again; no search starts for where the pointer
/// moved meanwhile.
fn area_at(&mut self, cx: &ToolContext, p: Point) -> Option<EnclosedArea> {
if let Some(a) = self.hover_holding(cx, p) {
return Some(a.clone());
}
self.settle(cx, true, false);
let key = self.finder_key(cx);
let mut finder = self.take_finder(cx);
let area = finder.find(p);
self.finder = Some((key, finder));
area
}
/// Looks for the area under `p` for the hover. A search of more than [`BACKGROUND_SEGMENTS`]
/// segments runs on another thread, and [`Tool::poll`] takes its result; while one runs, a new
/// position waits for it.
fn hover_at(&mut self, cx: &ToolContext, p: Point) {
self.at = Some(p);
if self.hover_holding(cx, p).is_some() {
return;
}
// The outline of an area the pointer left goes at once, while the next search runs.
self.hover = None;
if self.job.is_some() {
return;
}
let key = self.finder_key(cx);
if self.failed == Some(key) {
self.hover = None;
return;
}
let mut finder = self.take_finder(cx);
if finder.segments > BACKGROUND_SEGMENTS {
match spawn_find(finder, p) {
Ok(done) => {
self.job = Some(HoverJob { key, p, done });
return;
}
Err(f) => finder = *f,
}
}
self.hover = finder.find(p).map(|a| (key, a));
self.finder = Some((key, finder));
}
/// Takes the result of the hover search on another thread when it is done (`wait`: waits for
/// it), and with `follow` starts the search for where the pointer moved meanwhile.
fn settle(&mut self, cx: &ToolContext, wait: bool, follow: bool) {
let Some(job) = self.job.take() else { return };
let got = if wait {
job.done.recv().ok()
} else {
match job.done.try_recv() {
Ok(v) => Some(v),
Err(std::sync::mpsc::TryRecvError::Empty) => {
self.job = Some(job);
return;
}
Err(std::sync::mpsc::TryRecvError::Disconnected) => None,
}
};
let Some((finder, area)) = got else {
// The search failed (a bug in the planar map): hovering does not search it again, and
// a click searches here, which reports the failure.
self.failed = Some(job.key);
self.hover = None;
return;
};
let current = job.key == self.finder_key(cx);
if current {
self.finder = Some((job.key, finder));
}
// The area found serves wherever the pointer moved meanwhile, as long as it holds it.
let at = self.at;
self.hover = area.filter(|a| current && at.is_some_and(|p| path_contains(&a.path, FillRule::NonZero, p))).map(|a| (job.key, a));
if follow
&& let Some(p) = at
&& self.hover.is_none()
&& (p != job.p || !current)
{
self.hover_at(cx, p);
}
}
}
impl Tool for FillAreaTool {
fn id(&self) -> &'static str {
"fillArea"
}
fn pointer(&mut self, cx: &ToolContext, ev: &PointerEvent) -> Vec<Action> {
match ev.kind {
PointerKind::Move => {
self.hover_at(cx, ev.pos);
vec![]
}
PointerKind::Down => {
// A click in no enclosed area does nothing.
let found = self.area_at(cx, ev.pos).is_some();
self.hover = None;
if !found {
return vec![];
}
let mut params = json!({ "point": [ev.pos.x, ev.pos.y], "gap": self.gap() });
if !self.open_filled_as_closed() {
params["openFilledAsClosed"] = json!(false);
}
// The path shows at once and is kept on the release; a press that is dropped (a
// long or canceled touch, a second finger) or Escape before the release takes it
// back.
self.pressing = true;
vec![Action::Begin("Fill Area".into()), Action::Preview("shapeBuilder.copyRegion".into(), params)]
}
PointerKind::Up if std::mem::take(&mut self.pressing) => vec![Action::Commit],
_ => vec![],
}
}
fn key(&mut self, _cx: &ToolContext, key: ToolKey, _mods: Mods) -> Vec<Action> {
if key == ToolKey::Escape && std::mem::take(&mut self.pressing) { vec![Action::Cancel] } else { vec![] }
}
fn busy(&self) -> bool {
self.pressing
}
fn overlays(&self, cx: &ToolContext) -> Vec<Overlay> {
self.hover
.iter()
.filter(|(k, _)| *k == self.finder_key(cx))
.map(|(_, a)| Overlay::Path { path: a.path.to_bezpath(), color: HIGHLIGHT_RED, width: 3.0, dashed: false })
.collect()
}
fn cursor(&self, cx: &ToolContext, p: Point, _m: Mods) -> Cursor {
if self.hover_holding(cx, p).is_some() { Cursor::LivePaintBucketFace } else { Cursor::LivePaintBucket }
}
fn hover_ended(&mut self, _cx: &ToolContext) {
self.hover = None;
self.at = None;
}
/// The area under a still pointer changes with the document and the view.
fn wants_rehover(&self) -> bool {
true
}
fn waiting(&self) -> bool {
self.job.is_some()
}
fn poll(&mut self, cx: &ToolContext, wait: bool) -> Vec<Action> {
self.settle(cx, wait, true);
while wait && self.job.is_some() {
self.settle(cx, true, true);
}
vec![]
}
/// The Shape Builder's Gap Detection, Gap Length and Consider Open Filled Paths as Closed,
/// which the tool shares.
fn options(&self) -> Value {
json!({
"gapDetection": self.gap_detection,
"gapLength": self.gap_length,
"openFilledAsClosed": self.open_filled_as_closed(),
})
}
fn set_option(&mut self, key: &str, v: &Value) {
match key {
"gapDetection" => self.gap_detection = v.as_bool().unwrap_or(self.gap_detection),
"gapLength" => {
if let Some(n) = v.as_f64().filter(|n| n.is_finite()) {
self.gap_length = n.clamp(0.0, SHAPE_BUILDER_MAX_GAP);
}
}
"openFilledAsClosed" => {
if let Some(b) = v.as_bool() {
self.open_filled_cuts = !b;
}
}
_ => {}
}
self.hover = None;
}
fn check_option(&self, key: &str, v: &Value) -> Result<(), String> {
check_builder_options(self.id(), &serde_json::Map::from_iter([(key.to_string(), v.clone())]))
}
}
+29
View File
@@ -3767,6 +3767,35 @@ fn live_paint_selection_options_set_the_highlight() {
assert_eq!(t.options()["width"], json!(LP_SELECT_WIDTH_RANGE.0));
}
/// A press while a Fill Area hover search runs on another thread waits for that search only: no
/// search starts for where the pointer moved meanwhile, and the press finds its own area.
#[cfg(not(target_arch = "wasm32"))]
#[test]
fn fill_area_press_does_not_search_a_hover_position_it_passed() {
let mut d = Document::new(800.0, 600.0);
let l = d.layers[0].id;
let pts: Vec<Point> = (0..200)
.map(|k| {
let a = k as f64 * std::f64::consts::TAU / 200.0;
Point::new(300.0 + 100.0 * a.cos(), 300.0 + 100.0 * a.sin())
})
.collect();
let poly = d.alloc_id();
d.insert(Some(l), 0, Node::path(poly, PathData::single(SubPath::polyline(&pts, true)), Appearance::default_art())).unwrap();
let s = Selection::default();
let p = paint();
let cx = ToolContext { revision: (1, 1), ..cx(&d, &s, &p) };
let mut t = FillAreaTool::new();
let started = super::fill_area::hover_searches_started();
t.pointer(&cx, &ev(PointerKind::Move, 500.0, 500.0));
assert!(t.waiting());
t.pointer(&cx, &ev(PointerKind::Move, 510.0, 500.0));
let acts = t.pointer(&cx, &ev(PointerKind::Down, 300.0, 300.0));
assert!(matches!(acts.as_slice(), [Action::Begin(_), Action::Preview(id, _)] if id == "shapeBuilder.copyRegion"), "{acts:?}");
assert!(!t.waiting());
assert_eq!(super::fill_area::hover_searches_started() - started, 1, "only the search that was running");
}
#[test]
fn create_builds_the_three_tools() {
for id in ["shapeBuilder", "livePaintBucket", "livePaintSelection"] {
+1
View File
@@ -103,6 +103,7 @@ pub const TOOL_GROUPS: &[&[ToolInfo]] = &[
&[
t("shapeBuilder", "Shape Builder Tool", Some("Shift+M"), "tool-shape-builder"),
t("livePaintBucket", "Live Paint Bucket", Some("K"), "tool-bucket"),
t("fillArea", "Fill Area Tool", None, "tool-fill-area"),
t("livePaintSelection", "Live Paint Selection Tool", Some("Shift+L"), "tool-live-select"),
],
&[
+2
View File
@@ -524,6 +524,7 @@ id = "LivePaintBucket"
group = "Colour and gradient"
shown_when = [
"The Live Paint Bucket where a click paints nothing: away from Live Paint groups and the selected paths' regions, or over a part the Paint Fills and Paint Strokes options (and Shift) leave unpainted.",
"The Fill Area tool outside every area that visible, unlocked paths enclose, where a click adds nothing.",
"With Use Precise Cursors on, the crosshair shows instead.",
]
hotspot = "The drop the paint pours onto."
@@ -534,6 +535,7 @@ id = "LivePaintBucketFace"
group = "Colour and gradient"
shown_when = [
"The Live Paint Bucket over a face of a Live Paint group, or a region of the selected paths, that a click fills.",
"The Fill Area tool over an enclosed area, where a click adds a path of that area.",
"With Use Precise Cursors on, the crosshair shows instead.",
]
hotspot = "The drop the paint pours onto."
+2
View File
@@ -98,6 +98,8 @@ const ROWS: &[Row] = &[
"highlightColor",
],
),
// Fill Area uses the Shape Builder's Gap Detection and open-filled-path options.
(&["fillArea"], Some("shapeBuilder"), &["openFilledAsClosed", "gapDetection", "gapLength"]),
// Objects on Path Tool Options: the Pivot and Rotate of the objects attached next.
(&["objectsOnPath"], None, &["pivot", "rotate"]),
(&["artboard"], None, &["moveArt", "scaleArt"]),
@@ -159,6 +159,22 @@ mod tests {
assert_eq!(opts["openFilledAsClosed"], true);
}
/// Double-clicking the Fill Area tool opens the Shape Builder Tool Options, whose Gap
/// Detection the active Fill Area tool takes on OK.
#[test]
fn the_fill_area_tool_opens_the_shape_builder_options() {
let mut a = app();
a.select_tool("fillArea");
let r = a.run("tool.options", json!({"tool": "fillArea"})).unwrap();
assert_eq!(r["dialog"], json!(KIND));
let d = a.ui.dialog.as_mut().unwrap();
d.fields.insert("gapDetection".into(), json!(true));
d.fields.insert("gapLength".into(), json!(6));
super::super::confirm(&mut a).unwrap();
let opts = a.session.tool_options_of("fillArea");
assert_eq!((opts["gapDetection"].clone(), opts["gapLength"].clone()), (json!(true), json!(6.0)));
}
#[test]
fn double_clicking_the_tool_opens_its_options_and_ok_keeps_them() {
let mut app = app();
@@ -1,13 +1,14 @@
//! The 3D and Materials panel's Materials tab: the document's Graphics (its symbols) as thumbnails,
//! Add as Single Graphic, and the graphics mapped onto the selected 3D object (its planar faces,
//! Extrude & Bevel's side, or Revolve's side) with their face, position, size and turn. Picking a thumbnail maps that graphic
//! Extrude & Bevel's side, Revolve's side, or Inflate's puffed faces) with their face, position, size and turn. Picking a
//! thumbnail maps that graphic
//! onto the selected objects (`threeD.mapGraphic`); art dropped on the thumbnails becomes a graphic
//! (`threeD.addGraphic`). Editing a mapped graphic changes the effect's `graphics` parameter, which
//! the panel sends as it sends every other setting.
use egui::{Sense, Stroke, StrokeKind, vec2};
use serde_json::{Value, json};
use vectorcraft_effects::{GRAPHICS, MappedGraphic, PlanarFace, REVOLVE, ROTATE};
use vectorcraft_effects::{GRAPHICS, INFLATE, MappedGraphic, PlanarFace, REVOLVE, ROTATE};
use super::revolve::{heading, label, number};
use crate::VectorcraftApp;
@@ -105,7 +106,7 @@ pub(crate) fn controls(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog)
}
ui.add_space(10.0);
if !takes {
dim_label(ui, tl!("Graphics map onto the Plane, Extrude and Revolve object types."));
dim_label(ui, tl!("Graphics map onto the Plane, Extrude, Revolve and Inflate object types."));
return;
}
let raw = d.fields.get(GRAPHICS).cloned().unwrap_or(Value::Null);
@@ -131,15 +132,18 @@ pub(crate) fn controls(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog)
let Some(g) = list.get(index).cloned() else { return };
let mut edited = g.clone();
// A plane has one face, and Revolve's graphics go on its side. Extrude & Bevel's graphics go on
// its front or back cap, or on its side (its walls and bevels).
// its front or back cap, or on its side (its walls and bevels). Inflate's go on its puffed front
// or back.
if effect != ROTATE && effect != REVOLVE {
let faces: &[PlanarFace] = if effect == INFLATE { &[PlanarFace::Front, PlanarFace::Back] } else { &PlanarFace::ALL };
ui.horizontal(|ui| {
ui.spacing_mut().item_spacing.x = 6.0;
label(ui, tl!("Face"));
let labels = PlanarFace::ALL.map(face_label);
let at = PlanarFace::ALL.iter().position(|f| *f == g.face).unwrap_or(0);
if let Some(k) = widgets::dropdown(ui, "three-d-graphic-face", labels[at], &labels, 120.0)
&& let Some(face) = PlanarFace::ALL.get(k)
let labels: Vec<&str> = faces.iter().map(|f| face_label(*f)).collect();
let at = faces.iter().position(|f| *f == g.face).unwrap_or(0);
let current = labels.get(at).copied().unwrap_or_default();
if let Some(k) = widgets::dropdown(ui, "three-d-graphic-face", current, &labels, 120.0)
&& let Some(face) = faces.get(k)
{
edited.face = *face;
}
+12
View File
@@ -2075,6 +2075,8 @@ font-technology Variable Променливи
List Workspaces Извеждане на работни пространства
Live Paint Динамично оцветяване
Live Paint Bucket Кофа за динамично оцветяване
Fill Area Запълване на област
Fill Area Tool Инструмент „Запълване на област“
Live Paint Bucket (Stroke) Кофа за динамично оцветяване (Щрих)
Live Paint Info Информация за динамично оцветяване
Live Paint Selection Tool Инструмент за селекция на динамично оцветяване
@@ -4785,6 +4787,7 @@ axis Both И двете
@msg Saved {path} Записано: {path}
@msg Select text or click into text with the Type tool to insert glyphs Изберете текст или щракнете в текста с инструмента „Текст“, за да вмъкнете глифи
@msg Shape Builder: no region under the pointer Инструмент за създаване на форми: няма област под показалеца
@msg Fill Area: no enclosed area under the pointer Запълване на област: няма затворена област под показалеца
@msg Shape Builder: select paths or compound paths Инструмент за създаване на форми: изберете пътища или съставни пътища
@msg Show All Hidden Attributes: nothing is hidden Показване на всички скрити атрибути: нищо не е скрито
@msg Split Into Grid: select paths large enough for the grid Разделяне на мрежа: изберете пътища, достатъчно големи за мрежата
@@ -7930,6 +7933,15 @@ breakText Glyphs Глифи
@msg A joint does not close by {gap} pt. Една връзка не се затваря с {gap} pt.
@msg Two panels pass through each other. Два панела минават един през друг.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer трябва да е "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine"
Nature Icons Природни икони
Flower Цвете
Tree Дърво
Mountain Планина
Ornamental Орнаментални
Scrollwork Завитък
Filigree Arrow Филигранна стрела
Petal Sweep Венчелистен замах
Twin Curl Двоен завитък
Vector Packs Векторни пакети
Compass Rose Роза на компаса
Botanical Sprig Ботаническо клонче
Can't render this file because it is too large.
+12
View File
@@ -3701,6 +3701,8 @@ theme Appearance Izgled
Symbolism Tool Alat simbolizam
Image Trace Presets Predlošci praćenja slike
Live Paint Bucket Kanta za živo bojenje
Fill Area Popuni područje
Fill Area Tool Alat za popunjavanje područja
Live Paint Bucket (Stroke) Kanta za živo bojenje (potez)
Live Paint Info Informacije o živom bojenju
Shape Builder Graditelj oblika
@@ -5190,6 +5192,7 @@ imageTrace Outline Obris
@msg Saved {path} Sačuvano: {path}
@msg Select text or click into text with the Type tool to insert glyphs Odaberite tekst ili kliknite u tekst alatom za tekst da umetnete glifove
@msg Shape Builder: no region under the pointer Graditelj oblika: nema regije ispod pokazivača
@msg Fill Area: no enclosed area under the pointer Popuni područje: nema zatvorenog područja ispod pokazivača
@msg Shape Builder: select paths or compound paths Graditelj oblika: odaberite putanje ili složene putanje
@msg Show All Hidden Attributes: nothing is hidden Prikaži sve skrivene atribute: ništa nije skriveno
@msg Split Into Grid: select paths large enough for the grid Podijeli u mrežu: odaberite putanje dovoljno velike za mrežu
@@ -7985,6 +7988,15 @@ shape Open Otvoren
@msg A joint does not close by {gap} pt. Spoj se ne zatvara za {gap} pt.
@msg Two panels pass through each other. Dva panela prolaze jedan kroz drugi.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer mora biti "singleLine", "everyLine", "standardSingleLine" ili "standardEveryLine"
Nature Icons Ikone prirode
Flower Cvijet
Tree Drvo
Mountain Planina
Ornamental Ornamentalno
Scrollwork Ukrasni zavoj
Filigree Arrow Filigranska strelica
Petal Sweep Potez latica
Twin Curl Dvostruki zavoj
Vector Packs Vektorski paketi
Compass Rose Ruža kompasa
Botanical Sprig Botanička grančica
Can't render this file because it contains an unexpected character in line 2 and column 73.
+15 -1
View File
@@ -2689,6 +2689,8 @@ digits Malayalam Malaiàlam
Live curve fitting Ajustament de corbes en directe
Live Paint Pintura interactiva
Live Paint Bucket Galleda de pintura interactiva
Fill Area Emplena l'àrea
Fill Area Tool Eina Emplena l'àrea
Live Paint Bucket (Stroke) Galleda de pintura interactiva (traç)
Live Paint Info Informació de pintura interactiva
Live Paint Selection Tool Eina de selecció de pintura interactiva
@@ -7228,6 +7230,7 @@ liquify-list-end {0}, {1} {0} i {1}
@msg shadings of more than 4096 patches or triangles were left out els ombrejats de més de 4096 pedaços o triangles s’han omès
@msg shadings whose functions are of an unknown type are filled with their middle colour els ombrejats les funcions dels quals són d’un tipus desconegut s’omplen amb el seu color central
@msg Shape Builder: no region under the pointer Constructor de formes: no hi ha cap regió sota el punter
@msg Fill Area: no enclosed area under the pointer Emplena l'àrea: no hi ha cap àrea tancada sota el punter
@msg Shape Builder: select all paths you want to merge Constructor de formes: selecciona tots els traçats que vulguis combinar
@msg Shape Builder: select paths or compound paths Constructor de formes: selecciona traçats o traçats compostos
@msg shortcut for `{k}` must be a string la drecera de `{k}` ha de ser una cadena
@@ -7317,8 +7320,10 @@ liquify-list-end {0}, {1} {0} i {1}
@msg `{GRAPHICS}` face must be front, back or side face de `{GRAPHICS}` ha de ser front, back o side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} de `{GRAPHICS}` ha de ser un nombre de {lo} a {hi}
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` ha de ser una matriu
@msg Graphics map onto the Plane, Extrude and Revolve object types Els gràfics s’apliquen als tipus d’objecte Pla, Extrusió i Revolució
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Els gràfics s’apliquen als tipus d’objecte Pla, Extrusió, Revolució i Infla
@msg Revolve maps graphics onto its side: map them onto the front Revoluciona aplica els gràfics al seu lateral: aplica’ls a la cara davantera
@msg Inflate maps graphics onto its front and back, not onto a side Infla aplica els gràfics a la cara davantera i a la posterior, no a un lateral
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on l’objecte {_1}: la cara posterior d’Infla només admet gràfics amb Tots dos costats i Tapa activats
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Els gràfics són massa complexos per a aquesta superfície: simplifica la il·lustració dels símbols o redueix Segments
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` admet com a màxim {MAX_GRAPHICS} gràfics
@msg A plane has one face: map its graphics onto the front Un pla té una sola cara: aplica’n els gràfics a la cara davantera
@@ -8973,6 +8978,15 @@ breakText Glyphs Glifs
@msg A joint does not close by {gap} pt. Una unió no es tanca per {gap} pt.
@msg Two panels pass through each other. Dos panells es travessen l’un a l’altre.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer ha de ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine"
Nature Icons Icones de natura
Flower Flor
Tree Arbre
Mountain Muntanya
Ornamental Ornamental
Scrollwork Voluta
Filigree Arrow Fletxa de filigrana
Petal Sweep Traç de pètals
Twin Curl Voluta doble
Vector Packs Paquets vectorials
Compass Rose Rosa dels vents
Botanical Sprig Branqueta botànica
Can't render this file because it is too large.
+15 -1
View File
@@ -3802,6 +3802,8 @@ theme Appearance Motiv
Symbolism Tool Nástroj symbolů
Image Trace Presets Přednastavení vektorizace obrazu
Live Paint Bucket Kbelík živé malby
Fill Area Vyplnit oblast
Fill Area Tool Nástroj Vyplnit oblast
Live Paint Bucket (Stroke) Kbelík živé malby (tah)
Live Paint Info Informace o živé malbě
Shape Builder Tvorba tvarů
@@ -5481,6 +5483,7 @@ liquify-list-end {0}, {1} {0} a {1}
@msg Saved {path} Uloženo: {path}
@msg Select text or click into text with the Type tool to insert glyphs Glyfy vložíte, když vyberete text nebo do něj kliknete nástrojem Text
@msg Shape Builder: no region under the pointer Tvorba tvarů: pod ukazatelem není žádná oblast
@msg Fill Area: no enclosed area under the pointer Vyplnit oblast: pod ukazatelem není žádná uzavřená oblast
@msg Shape Builder: select all paths you want to merge Tvorba tvarů: vyberte všechny cesty, které chcete sloučit
@msg Shape Builder: select paths or compound paths Tvorba tvarů: vyberte cesty nebo složené cesty
@msg Show All Hidden Attributes: nothing is hidden Zobrazit všechny skryté atributy: nic není skryto
@@ -6907,8 +6910,10 @@ mark-style Japanese Japonské
@msg `{GRAPHICS}` face must be front, back or side face v `{GRAPHICS}` musí být front, back nebo side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} v `{GRAPHICS}` musí být číslo od {lo} do {hi}
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` musí být pole
@msg Graphics map onto the Plane, Extrude and Revolve object types Grafika se mapuje na typy objektu Rovina, Vysunutí a Rotační těleso
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafika se mapuje na typy objektu Rovina, Vysunutí, Rotační těleso a Nafouknutí
@msg Revolve maps graphics onto its side: map them onto the front Rotační těleso mapuje grafiku na svůj bok: umístěte ji na přední stranu
@msg Inflate maps graphics onto its front and back, not onto a side Nafouknutí mapuje grafiku na přední a zadní stranu, ne na bok
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objekt {_1}: zadní strana Nafouknutí přijímá grafiku jen se zapnutými volbami Obě strany a Uzávěr
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafika je pro tento povrch příliš složitá: zjednodušte kresbu symbolů nebo snižte Segmenty
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` přijímá nejvýše {MAX_GRAPHICS} grafik
@msg A plane has one face: map its graphics onto the front Rovina má jednu stranu: umístěte její grafiku na přední stranu
@@ -10797,6 +10802,15 @@ breakText Glyphs Glyfy
@msg A panel is not joined to the rest by a crease. Panel není se zbytkem spojen žádnou linií bigu.
@msg A fold line is on a non-printing layer. Linie skladu je na netisknutelné vrstvě.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panely: {panels}, panty: {hinges}, chyby: {errors}, upozornění: {warnings}
Nature Icons Ikony přírody
Flower Květina
Tree Strom
Mountain Hora
Ornamental Ornamentální
Scrollwork Rozvilina
Filigree Arrow Filigránový šíp
Petal Sweep Tah okvětních lístků
Twin Curl Dvojitá rozvilina
Vector Packs Vektorové balíčky
Compass Rose Směrová růžice
Botanical Sprig Botanická větvička
Can't render this file because it is too large.
+15 -1
View File
@@ -461,8 +461,10 @@ liquify-list-end {0}, {1} {0} og {1}
@msg `{GRAPHICS}` face must be front, back or side `{GRAPHICS}`: face skal være front, back eller side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}`: {key} skal være et tal fra {lo} til {hi}
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` skal være et array
@msg Graphics map onto the Plane, Extrude and Revolve object types Grafik kortlægges på objekttyperne Plan, Ekstrudér og Omdrej
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafik kortlægges på objekttyperne Plan, Ekstrudér, Omdrej og Pust op
@msg Revolve maps graphics onto its side: map them onto the front Omdrej kortlægger grafik på siden: kortlæg den på forsiden
@msg Inflate maps graphics onto its front and back, not onto a side Pust op kortlægger grafik på forsiden og bagsiden, ikke på en side
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objektet {_1}: bagsiden af Pust op tager kun imod grafik, når Begge sider og Kappe er slået til
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafikken er for kompleks til denne overflade: forenkl symbolernes grafik, eller reducér Segmenter
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` tager højst {MAX_GRAPHICS} grafikelementer
@msg A plane has one face: map its graphics onto the front Et plan har én flade: kortlæg dets grafik på forsiden
@@ -6280,6 +6282,8 @@ theme Appearance Udseende
Symbolism Tool Symbolværktøj
Image Trace Presets Forudindstillinger til billedsporing
Live Paint Bucket Live Paint-spand
Fill Area Udfyld område
Fill Area Tool Værktøjet Udfyld område
Live Paint Bucket (Stroke) Live Paint-spand (kontur)
Live Paint Info Live Paint-info
Shape Builder Formbygger
@@ -7733,6 +7737,7 @@ imageTrace Outline Kontur
@msg Saved {path} Gemte {path}
@msg Select text or click into text with the Type tool to insert glyphs Markér tekst, eller klik i tekst med tekstværktøjet, for at indsætte glyffer
@msg Shape Builder: no region under the pointer Figurbygger: intet område under markøren
@msg Fill Area: no enclosed area under the pointer Udfyld område: intet lukket område under markøren
@msg Shape Builder: select all paths you want to merge Figurbygger: markér alle kurver, du vil flette
@msg Shape Builder: select paths or compound paths Figurbygger: markér kurver eller sammensatte kurver
@msg Show All Hidden Attributes: nothing is hidden Vis alle skjulte attributter: intet er skjult
@@ -10859,6 +10864,15 @@ breakText Glyphs Glyffer
@msg A joint does not close by {gap} pt. En samling lukker ikke med {gap} pt.
@msg Two panels pass through each other. To paneler går gennem hinanden.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer skal være "singleLine", "everyLine", "standardSingleLine" eller "standardEveryLine"
Nature Icons Naturikoner
Flower Blomst
Tree Træ
Mountain Bjerg
Ornamental Ornamentik
Scrollwork Slyngværk
Filigree Arrow Filigranpil
Petal Sweep Kronbladssvirp
Twin Curl Dobbelt slyng
Vector Packs Vektorpakker
Compass Rose Kompasrose
Botanical Sprig Botanisk kvist
Can't render this file because it is too large.
+15 -1
View File
@@ -2169,6 +2169,8 @@ file-filter Templates Vorlagen
List Workspaces Arbeitsbereiche auflisten
Live Paint Interaktiv malen
Live Paint Bucket Interaktiv-malen-Werkzeug
Fill Area Fläche füllen
Fill Area Tool Fläche-füllen-Werkzeug
Live Paint Bucket (Stroke) Interaktiv-malen-Werkzeug (Kontur)
Live Paint Info Informationen zu „Interaktiv malen“
Live Paint Selection Tool Interaktiv-malen-Auswahlwerkzeug
@@ -5057,6 +5059,7 @@ liquify-list-end {0}, {1} {0} und {1}
@msg Saved {path} {path} gespeichert
@msg Select text or click into text with the Type tool to insert glyphs Wählen Sie Text aus oder klicken Sie mit dem Text-Werkzeug in einen Text, um Glyphen einzufügen
@msg Shape Builder: no region under the pointer Formerstellung: kein Bereich unter dem Zeiger
@msg Fill Area: no enclosed area under the pointer Fläche füllen: kein geschlossener Bereich unter dem Zeiger
@msg Shape Builder: select all paths you want to merge Formerstellung: Wählen Sie alle Pfade aus, die Sie zusammenfügen möchten
@msg Shape Builder: select paths or compound paths Formerstellung: Wählen Sie Pfade oder zusammengesetzte Pfade aus
@msg Show All Hidden Attributes: nothing is hidden Alle ausgeblendeten Attribute einblenden: Es ist nichts ausgeblendet
@@ -6474,8 +6477,10 @@ lighting Light Licht
@msg `{GRAPHICS}` face must be front, back or side face in `{GRAPHICS}` muss front, back oder side sein
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} in `{GRAPHICS}` muss eine Zahl von {lo} bis {hi} sein
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` muss ein Array sein
@msg Graphics map onto the Plane, Extrude and Revolve object types Grafiken werden auf die Objekttypen Ebene, Extrudieren und Kreiseln abgebildet
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafiken werden auf die Objekttypen Ebene, Extrudieren, Kreiseln und Aufblasen abgebildet
@msg Revolve maps graphics onto its side: map them onto the front Kreiseln bildet Grafiken auf seiner Mantelfläche ab: Bilden Sie sie auf der Vorderseite ab
@msg Inflate maps graphics onto its front and back, not onto a side Aufblasen bildet Grafiken auf der Vorder- und Rückseite ab, nicht auf einer Seitenfläche
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on Objekt {_1}: Die Rückseite von „Aufblasen“ nimmt Grafiken nur mit aktivierten Optionen „Beidseitig“ und „Deckflächen“ auf
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Die Grafiken sind für diese Oberfläche zu komplex: Vereinfachen Sie das Bildmaterial der Symbole oder verringern Sie Segmente
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` nimmt höchstens {MAX_GRAPHICS} Grafiken auf
@msg A plane has one face: map its graphics onto the front Eine Ebene hat nur eine Seite: Bilden Sie ihre Grafiken auf der Vorderseite ab
@@ -10439,6 +10444,15 @@ breakText Glyphs Glyphen
@msg A panel is not joined to the rest by a crease. Ein Feld ist durch keine Rilllinie mit den übrigen verbunden.
@msg A fold line is on a non-printing layer. Eine Faltlinie liegt auf einer nicht druckbaren Ebene.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Felder: {panels}, Scharniere: {hinges}, Fehler: {errors}, Warnungen: {warnings}
Nature Icons Natursymbole
Flower Blume
Tree Baum
Mountain Berg
Ornamental Ornamental
Scrollwork Schnörkel
Filigree Arrow Filigranpfeil
Petal Sweep Blütenblattschwung
Twin Curl Doppelschnörkel
Vector Packs Vektorpakete
Compass Rose Kompassrose
Botanical Sprig Botanischer Zweig
Can't render this file because it is too large.
+15 -1
View File
@@ -2896,6 +2896,7 @@ liquify-list-end {0}, {1} {0} και {1}
@msg Saved {path} Αποθηκεύτηκε το {path}
@msg Select text or click into text with the Type tool to insert glyphs Επιλέξτε κείμενο ή κάντε κλικ μέσα σε κείμενο με το εργαλείο κειμένου για εισαγωγή γλύφων
@msg Shape Builder: no region under the pointer Δημιουργία σχημάτων: δεν υπάρχει περιοχή κάτω από τον δείκτη
@msg Fill Area: no enclosed area under the pointer Γέμισμα περιοχής: δεν υπάρχει κλειστή περιοχή κάτω από τον δείκτη
@msg Shape Builder: select all paths you want to merge Δημιουργία σχημάτων: επιλέξτε όλες τις διαδρομές που θέλετε να συγχωνεύσετε
@msg Shape Builder: select paths or compound paths Δημιουργία σχημάτων: επιλέξτε διαδρομές ή σύνθετες διαδρομές
@msg Show All Hidden Attributes: nothing is hidden Εμφάνιση όλων των κρυφών χαρακτηριστικών: δεν υπάρχουν κρυφά χαρακτηριστικά
@@ -3306,6 +3307,8 @@ theme Appearance Εμφάνιση
List View Προβολή λίστας
List Workspaces Λίστα χώρων εργασίας
Live Paint Bucket Κουβάς δυναμικής βαφής
Fill Area Γέμισμα περιοχής
Fill Area Tool Εργαλείο γεμίσματος περιοχής
Live Paint Bucket (Stroke) Κουβάς δυναμικής βαφής (περίγραμμα)
Live Paint Info Πληροφορίες δυναμικής βαφής
Live Paint Selection Tool Επιλογή δυναμικής βαφής (Live Paint Selection Tool)
@@ -6290,8 +6293,10 @@ variable-list-end {0}, {1} {0} και {1}
@msg `{GRAPHICS}` face must be front, back or side το face του `{GRAPHICS}` πρέπει να είναι front, back ή side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} το {key} του `{GRAPHICS}` πρέπει να είναι αριθμός από {lo} έως {hi}
@msg `{GRAPHICS}` must be an array το `{GRAPHICS}` πρέπει να είναι πίνακας
@msg Graphics map onto the Plane, Extrude and Revolve object types Τα γραφικά αντιστοιχίζονται στους τύπους αντικειμένου Επίπεδο, Εξώθηση και Περιστροφή γύρω από άξονα
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Τα γραφικά αντιστοιχίζονται στους τύπους αντικειμένου Επίπεδο, Εξώθηση, Περιστροφή γύρω από άξονα και Φούσκωμα
@msg Revolve maps graphics onto its side: map them onto the front Η Περιστροφή γύρω από άξονα αντιστοιχίζει τα γραφικά στην πλευρική της επιφάνεια: αντιστοιχίστε τα στην μπροστινή όψη
@msg Inflate maps graphics onto its front and back, not onto a side Το Φούσκωμα αντιστοιχίζει τα γραφικά στην μπροστινή και την πίσω όψη, όχι σε πλευρική επιφάνεια
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on το αντικείμενο {_1}: η πίσω όψη του Φουσκώματος δέχεται γραφικά μόνο με ενεργά τα Και οι δύο πλευρές και Κλείσιμο άκρου
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Τα γραφικά είναι πολύ σύνθετα για αυτή την επιφάνεια: απλοποιήστε το σχέδιο των συμβόλων ή μειώστε τα Τμήματα
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics το `{GRAPHICS}` δέχεται το πολύ {MAX_GRAPHICS} γραφικά
@msg A plane has one face: map its graphics onto the front Ένα επίπεδο έχει μία όψη: αντιστοιχίστε τα γραφικά του στην μπροστινή όψη
@@ -8946,6 +8951,15 @@ breakText Glyphs Γλύφοι
@msg A joint does not close by {gap} pt. Μια ένωση δεν κλείνει κατά {gap} pt.
@msg Two panels pass through each other. Δύο πάνελ διαπερνούν το ένα το άλλο.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" το composer πρέπει να είναι "singleLine", "everyLine", "standardSingleLine" ή "standardEveryLine"
Nature Icons Εικονίδια φύσης
Flower Λουλούδι
Tree Δέντρο
Mountain Βουνό
Ornamental Διακοσμητικά μοτίβα
Scrollwork Σπείρα
Filigree Arrow Φιλιγκράν βέλος
Petal Sweep Καμπύλη πετάλων
Twin Curl Διπλή σπείρα
Vector Packs Διανυσματικά πακέτα
Compass Rose Ρόδο πυξίδας
Botanical Sprig Βοτανικό κλαδάκι
Can't render this file because it is too large.
+16 -2
View File
@@ -2167,6 +2167,8 @@ font-technology Variable Variables
List Workspaces Enumerar espacios de trabajo
Live Paint Pintura interactiva
Live Paint Bucket Bote de pintura interactiva
Fill Area Rellenar área
Fill Area Tool Herramienta Rellenar área
Live Paint Bucket (Stroke) Bote de pintura interactiva (trazo)
Live Paint Info Información de pintura interactiva
Live Paint Selection Tool Herramienta Selección de pintura interactiva
@@ -5168,6 +5170,7 @@ liquify-list-end {0}, {1} {0}, {1}
@msg Saved {path} Se guardó {path}
@msg Select text or click into text with the Type tool to insert glyphs Selecciona texto o haz clic dentro del texto con la herramienta Texto para insertar glifos
@msg Shape Builder: no region under the pointer Generador de formas: no hay ninguna región bajo el puntero
@msg Fill Area: no enclosed area under the pointer Rellenar área: no hay ninguna área cerrada bajo el puntero
@msg Shape Builder: select all paths you want to merge Generador de formas: selecciona todos los trazados que quieras combinar
@msg Shape Builder: select paths or compound paths Generador de formas: selecciona trazados o trazados compuestos
@msg Show All Hidden Attributes: nothing is hidden Mostrar todos los atributos ocultos: no hay nada oculto
@@ -6880,9 +6883,11 @@ mark-style Japanese Japonesas
@msg `{GRAPHICS}` face must be front, back or side face de `{GRAPHICS}` debe ser front, back o side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} de `{GRAPHICS}` debe ser un número de {lo} a {hi}
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` debe ser una matriz
@msg Graphics map onto the Plane, Extrude and Revolve object types Los gráficos se asignan a los tipos de objeto Plano, Extrusión y Revolución
Graphics map onto the Plane, Extrude and Revolve object types. Los gráficos se asignan a los tipos de objeto Plano, Extrusión y Revolución.
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Los gráficos se asignan a los tipos de objeto Plano, Extrusión, Revolución e Inflar
Graphics map onto the Plane, Extrude, Revolve and Inflate object types. Los gráficos se asignan a los tipos de objeto Plano, Extrusión, Revolución e Inflar.
@msg Revolve maps graphics onto its side: map them onto the front Revolución asigna los gráficos a su lateral: asígnelos a la cara frontal
@msg Inflate maps graphics onto its front and back, not onto a side Inflar asigna los gráficos a la cara frontal y a la posterior, no a un lateral
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on el objeto {_1}: la cara posterior de Inflar admite gráficos solo con Ambos lados y Tapa activados
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Los gráficos son demasiado complejos para esta superficie: simplifique la ilustración de los símbolos o reduzca Segmentos
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` admite como máximo {MAX_GRAPHICS} gráficos
@msg A plane has one face: map its graphics onto the front Un plano tiene una sola cara: asigne sus gráficos a la cara frontal
@@ -10690,6 +10695,15 @@ breakText Glyphs Glifos
@msg A joint does not close by {gap} pt. Una unión no cierra por {gap} pt.
@msg Two panels pass through each other. Dos paneles se atraviesan entre sí.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer debe ser "singleLine", "everyLine", "standardSingleLine" o "standardEveryLine"
Nature Icons Iconos de naturaleza
Flower Flor
Tree Árbol
Mountain Montaña
Ornamental Ornamental
Scrollwork Voluta
Filigree Arrow Flecha de filigrana
Petal Sweep Trazo de pétalos
Twin Curl Voluta doble
Vector Packs Paquetes vectoriales
Compass Rose Rosa de los vientos
Botanical Sprig Ramita botánica
Can't render this file because it is too large.
+15 -1
View File
@@ -3739,6 +3739,8 @@ theme Appearance Ulkoasu
Symbolism Tool Symbolityökalu
Image Trace Presets Kuvan jäljityksen esiasetukset
Live Paint Bucket Elävän maalauksen ämpäri
Fill Area Täytä alue
Fill Area Tool Alueen täyttötyökalu
Live Paint Bucket (Stroke) Elävän maalauksen ämpäri (viiva)
Live Paint Info Elävän maalauksen tiedot
Shape Builder Muodonmuodostin
@@ -5409,6 +5411,7 @@ liquify-list-end {0}, {1} {0} ja {1}
@msg Saved {path} Tallennettiin {path}
@msg Select text or click into text with the Type tool to insert glyphs Valitse tekstiä tai napsauta tekstiin tekstityökalulla, niin voit lisätä merkkejä
@msg Shape Builder: no region under the pointer Muodonmuodostin: osoittimen alla ei ole aluetta
@msg Fill Area: no enclosed area under the pointer Täytä alue: osoittimen alla ei ole suljettua aluetta
@msg Shape Builder: select all paths you want to merge Muodonmuodostin: valitse kaikki polut, jotka haluat yhdistää
@msg Shape Builder: select paths or compound paths Muodonmuodostin: valitse polkuja tai yhdistelmäpolkuja
@msg Show All Hidden Attributes: nothing is hidden Näytä kaikki piilotetut attribuutit: mitään ei ole piilotettu
@@ -6808,8 +6811,10 @@ mark-style Japanese Japanilainen
@msg `{GRAPHICS}` face must be front, back or side `{GRAPHICS}`-kohteen face-arvon on oltava front, back tai side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}`-kohteen {key}-arvon on oltava luku, joka on vähintään {lo} ja enintään {hi}
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` on oltava taulukko
@msg Graphics map onto the Plane, Extrude and Revolve object types Grafiikat sijoitetaan objektityypeille Taso, Pursota ja Pyöräytä
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafiikat sijoitetaan objektityypeille Taso, Pursota, Pyöräytä ja Täytä ilmalla
@msg Revolve maps graphics onto its side: map them onto the front Pyöräytä sijoittaa grafiikat kylkeensä: sijoita ne etupuolelle
@msg Inflate maps graphics onto its front and back, not onto a side Täytä ilmalla sijoittaa grafiikat etu- ja takapuolelle, ei kylkeen
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objekti {_1}: Täytä ilmalla -tehosteen takapuoli ottaa grafiikoita vain, kun Molemmat puolet ja Pääty ovat käytössä
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafiikat ovat liian monimutkaisia tälle pinnalle: yksinkertaista symbolien kuvitusta tai pienennä Segmentit-arvoa
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` hyväksyy enintään {MAX_GRAPHICS} grafiikkaa
@msg A plane has one face: map its graphics onto the front Tasolla on yksi puoli: sijoita sen grafiikat etupuolelle
@@ -9029,6 +9034,15 @@ breakText Glyphs Merkit
@msg A joint does not close by {gap} pt. Liitos ei sulkeudu, rako {gap} pt.
@msg Two panels pass through each other. Kaksi paneelia kulkee toistensa läpi.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer on oltava "singleLine", "everyLine", "standardSingleLine" tai "standardEveryLine"
Nature Icons Luontokuvakkeet
Flower Kukka
Tree Puu
Mountain Vuori
Ornamental Koristekuviot
Scrollwork Kiemura
Filigree Arrow Filigraanin nuoli
Petal Sweep Terälehtipyyhkäisy
Twin Curl Kaksoiskiemura
Vector Packs Vektoripaketit
Compass Rose Kompassiruusu
Botanical Sprig Kasvinoksa
Can't render this file because it is too large.
+15 -1
View File
@@ -2157,6 +2157,8 @@ font-technology Variable Variables
List Workspaces Lister les espaces de travail
Live Paint Peinture dynamique
Live Paint Bucket Pot de peinture dynamique
Fill Area Remplir la zone
Fill Area Tool Outil Remplir la zone
Live Paint Bucket (Stroke) Pot de peinture dynamique (contour)
Live Paint Info Informations sur la peinture dynamique
Live Paint Selection Tool Outil Sélection de peinture dynamique
@@ -5126,6 +5128,7 @@ liquify-list-end {0}, {1} {0} et {1}
@msg Saved to User Defined: {_1} Enregistré dans Défini par l’utilisateur : {_1}
@msg Saved {path} {path} enregistré
@msg Select text or click into text with the Type tool to insert glyphs Sélectionnez du texte ou cliquez dans un texte avec l’outil Texte pour insérer des glyphes
@msg Fill Area: no enclosed area under the pointer Remplir la zone : aucune zone fermée sous le pointeur
@msg Shape Builder: no region under the pointer Concepteur de forme : aucune zone sous le pointeur
@msg Shape Builder: select all paths you want to merge Concepteur de forme : sélectionnez tous les tracés à fusionner
@msg Shape Builder: select paths or compound paths Concepteur de forme : sélectionnez des tracés ou des tracés transparents
@@ -6473,8 +6476,10 @@ lighting Light Lumière
@msg `{GRAPHICS}` face must be front or back face de `{GRAPHICS}` doit valoir front ou back
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} de `{GRAPHICS}` doit être un nombre de {lo} à {hi}
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` doit être un tableau
@msg Graphics map onto the Plane, Extrude and Revolve object types Les graphiques s’appliquent aux types d’objet Plan, Extrusion et Révolution
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Les graphiques s’appliquent aux types d’objet Plan, Extrusion, Révolution et Gonfler
@msg Revolve maps graphics onto its side: map them onto the front Révolution applique les graphiques sur sa face latérale : appliquez-les sur la face avant
@msg Inflate maps graphics onto its front and back, not onto a side Gonfler applique les graphiques sur la face avant et l’arrière, pas sur une face latérale
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objet {_1} : l’arrière de Gonfler n’accepte des graphiques qu’avec Deux côtés et Fermeture activés
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Les graphiques sont trop complexes pour cette surface : simplifiez l’illustration des symboles ou réduisez Segments
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` accepte au plus {MAX_GRAPHICS} graphiques
@msg A plane has one face: map its graphics onto the front Un plan n’a qu’une face : appliquez ses graphiques sur la face avant
@@ -10760,6 +10765,15 @@ breakText Glyphs Glyphes
@msg A joint does not close by {gap} pt. Un joint ne se ferme pas, avec un écart de {gap} pt.
@msg Two panels pass through each other. Deux panneaux se traversent.
@msg {_1} × {_2} pixels is too large for GIF (at most 65535 pixels a side): lower the resolution {_1} × {_2} pixels, c’est trop grand pour le GIF (65535 pixels par côté au plus) : réduisez la résolution
Nature Icons Icônes de nature
Flower Fleur
Tree Arbre
Mountain Montagne
Ornamental Ornemental
Scrollwork Volute
Filigree Arrow Flèche filigrane
Petal Sweep Courbe de pétales
Twin Curl Double volute
Vector Packs Packs vectoriels
Compass Rose Rose des vents
Botanical Sprig Rameau botanique
Can't render this file because it is too large.
+12 -1
View File
@@ -2180,6 +2180,8 @@
List Workspaces વર્કસ્પેસની યાદી
Live Paint લાઇવ પેઇન્ટ
Live Paint Bucket લાઇવ પેઇન્ટ બકેટ
Fill Area વિસ્તાર ભરો
Fill Area Tool વિસ્તાર ભરો ટૂલ
Live Paint Bucket (Stroke) લાઇવ પેઇન્ટ બકેટ (સ્ટ્રોક)
Live Paint Info લાઇવ પેઇન્ટ માહિતી
Live Paint Selection Tool લાઇવ પેઇન્ટ પસંદગી ટૂલ
@@ -5234,7 +5236,7 @@ antiAlias Sharp શાર્પ
Align On: આના પર સંરેખિત કરો:
Delete Tab ટૅબ કાઢી નાખો
Face સપાટી
Graphics map onto the Plane, Extrude and Revolve object types. ગ્રાફિક્સને Plane, Extrude અને Revolve પ્રકારના ઑબ્જેક્ટ્સ પર મેપ કરી શકાય છે.
Graphics map onto the Plane, Extrude, Revolve and Inflate object types. ગ્રાફિક્સને Plane, Extrude, Revolve અને Inflate પ્રકારના ઑબ્જેક્ટ્સ પર મેપ કરી શકાય છે.
Justify with last line aligned center છેલ્લી લાઇન મધ્યમાં રાખીને જસ્ટિફાઇ કરો
Justify with last line aligned right છેલ્લી લાઇન જમણે રાખીને જસ્ટિફાઇ કરો
Leader: લીડર:
@@ -5669,6 +5671,15 @@ swatch [Registration] [રજિસ્ટ્રેશન]
Standard Single-line Composer સ્ટાન્ડર્ડ સિંગલ-લાઇન કમ્પોઝર
Standard Every-line Composer સ્ટાન્ડર્ડ એવરી-લાઇન કમ્પોઝર
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer આમાંથી એક હોવું જોઈએ: "singleLine", "everyLine", "standardSingleLine" અથવા "standardEveryLine"
Nature Icons પ્રકૃતિ ચિહ્નો
Flower ફૂલ
Tree વૃક્ષ
Mountain પર્વત
Ornamental અલંકારિક
Scrollwork વળાંકવાળી સજાવટ
Filigree Arrow નાજુક કોતરણીવાળું તીર
Petal Sweep પાંખડીઓનો વળાંક
Twin Curl બેવડો વળાંક
Vector Packs વેક્ટર પૅક
Compass Rose દિશાસૂચક ગુલાબ
Botanical Sprig વનસ્પતિ ડાળી
Can't render this file because it contains an unexpected character in line 72 and column 5.
+15 -1
View File
@@ -3195,6 +3195,8 @@ arrowhead Feather पंख
Live curve fitting लाइव वक्र फिटिंग
Live Paint लाइव पेंट
Live Paint Bucket लाइव पेंट बकेट
Fill Area क्षेत्र भरें
Fill Area Tool क्षेत्र भरें टूल
Live Paint Bucket (Stroke) लाइव पेंट बाल्टी (स्ट्रोक)
Live Paint Info लाइव पेंट जानकारी
Live Paint Selection Tool लाइव पेंट सिलेक्शन टूल
@@ -9090,6 +9092,7 @@ liquify-list-end {0}, {1} {0} और {1}
@msg shadings of more than 4096 patches or triangles were left out 4096 से अधिक पैच या त्रिकोणों के छायांकन को छोड़ दिया गया था
@msg shadings whose functions are of an unknown type are filled with their middle colour छायांकन जिसका कार्य अज्ञात प्रकार के होते हैं, उनके मध्य रंग से भरे होते हैं
@msg Shape Builder: no region under the pointer आकृति बिल्डर: सूचक के तहत कोई क्षेत्र नहीं
@msg Fill Area: no enclosed area under the pointer क्षेत्र भरें: सूचक के तहत कोई बंद क्षेत्र नहीं
@msg Shape Builder: select all paths you want to merge आकृति बिल्डर: वे सभी पाथ सिलेक्ट करें जिन्हें आप मर्ज करना चाहते हैं
@msg Shape Builder: select paths or compound paths आकृति बिल्डर: पाथ या मिश्रित पाथ सिलेक्ट करें
@msg Shaper needs 1–64 source paths शेपर के लिए 1–64 स्रोत पाथ चाहिए
@@ -9222,8 +9225,10 @@ liquify-list-end {0}, {1} {0} और {1}
@msg `{GRAPHICS}` face must be front, back or side `{GRAPHICS}` का face, front, back या side होना चाहिए
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}` का {key}, {lo} से {hi} तक की संख्या होना चाहिए
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` एक ऐरे होना चाहिए
@msg Graphics map onto the Plane, Extrude and Revolve object types ग्राफ़िक्स समतल, एक्सट्रूड और रिवॉल्व ऑब्जेक्ट प्रकारों पर लगते हैं
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types ग्राफ़िक्स समतल, एक्सट्रूड, रिवॉल्व और फुलाएँ ऑब्जेक्ट प्रकारों पर लगते हैं
@msg Revolve maps graphics onto its side: map them onto the front रिवॉल्व ग्राफ़िक्स को अपनी बगल वाली सतह पर लगाता है: उन्हें सामने वाले फ़ेस पर लगाएँ
@msg Inflate maps graphics onto its front and back, not onto a side फुलाएँ ग्राफ़िक्स को सामने और पिछले फ़ेस पर लगाता है, बगल वाली सतह पर नहीं
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on ऑब्जेक्ट {_1}: फुलाएँ का पिछला फ़ेस ग्राफ़िक्स तभी लेता है जब दोनों तरफ़ और कैप चालू हों
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments ग्राफ़िक्स इस सतह के लिए बहुत जटिल हैं: सिंबल्स के आर्ट को सरल बनाएँ या सेगमेंट कम करें
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` अधिकतम {MAX_GRAPHICS} ग्राफ़िक्स लेता है
@msg A plane has one face: map its graphics onto the front समतल का एक ही फ़ेस होता है: उसके ग्राफ़िक्स को सामने वाले फ़ेस पर लगाएँ
@@ -10403,6 +10408,15 @@ theme Appearance अपीयरेंस
@msg A panel is not joined to the rest by a crease. कोई पैनल किसी क्रीज़ लाइन से बाकी से जुड़ा नहीं है।
@msg A fold line is on a non-printing layer. एक फ़ोल्ड लाइन नॉन-प्रिंटिंग लेयर पर है।
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} पैनल: {panels}, हिंज: {hinges}, एरर: {errors}, वॉर्निंग: {warnings}
Nature Icons प्रकृति चिह्न
Flower फूल
Tree पेड़
Mountain पर्वत
Ornamental अलंकरण
Scrollwork अलंकारी घुमाव
Filigree Arrow जालीदार तीर
Petal Sweep पंखुड़ियों का घुमाव
Twin Curl दोहरा घुमाव
Vector Packs वेक्टर पैक
Compass Rose दिशासूचक गुलाब
Botanical Sprig वनस्पति टहनी
Can't render this file because it is too large.
+15 -1
View File
@@ -2681,6 +2681,8 @@ file-filter Templates Sablonok
List Workspaces Munkaterületek listázása
Live Paint Élő festés
Live Paint Bucket Élő festékesvödör
Fill Area Terület kitöltése
Fill Area Tool Területkitöltő eszköz
Live Paint Bucket (Stroke) Élő festékesvödör (körvonal)
Live Paint Info Élő festés adatai
Live Paint Selection Tool Élőfestés-kijelölés
@@ -6466,6 +6468,7 @@ liquify-list-end {0}, {1} {0} és {1}
@msg shadings of more than 4096 patches or triangles were left out kimaradtak a 4096-nál több foltból vagy háromszögből álló árnyalások
@msg shadings whose functions are of an unknown type are filled with their middle colour az ismeretlen típusú függvényt használó árnyalások a középső színükkel kitöltve jelennek meg
@msg Shape Builder: no region under the pointer Alakzatépítő: a mutató alatt nincs terület
@msg Fill Area: no enclosed area under the pointer Terület kitöltése: a mutató alatt nincs zárt terület
@msg Shape Builder: select all paths you want to merge Alakzatépítő: jelöld ki az összes egyesítendő útvonalat
@msg Shape Builder: select paths or compound paths Alakzatépítő: jelölj ki útvonalakat vagy összetett útvonalakat
@msg shortcut for `{k}` must be a string `{k}` billentyűparancsa csak szöveg lehet
@@ -6892,8 +6895,10 @@ variable-list-end {0}, {1} {0} és {1}
@msg `{GRAPHICS}` face must be front, back or side a `{GRAPHICS}` face értéke front, back vagy side lehet
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} a `{GRAPHICS}` {key} értéke {lo} és {hi} közötti szám lehet
@msg `{GRAPHICS}` must be an array a `{GRAPHICS}` értéke tömb kell legyen
@msg Graphics map onto the Plane, Extrude and Revolve object types A grafikák a Sík, a Kihúzás és a Forgatás tengely körül objektumtípusra kerülnek
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types A grafikák a Sík, a Kihúzás, a Forgatás tengely körül és a Felfújás objektumtípusra kerülnek
@msg Revolve maps graphics onto its side: map them onto the front A Forgatás tengely körül a grafikákat a palástjára helyezi: az elülső oldalra helyezze őket
@msg Inflate maps graphics onto its front and back, not onto a side A Felfújás a grafikákat az elülső és a hátoldalra helyezi, nem az oldalára
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on {_1} objektum: a Felfújás hátoldala csak a Mindkét oldal és a Zárólap bekapcsolásával fogad grafikát
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments A grafikák túl összetettek ehhez a felülethez: egyszerűsítse a szimbólumok rajzát, vagy csökkentse a Szakaszok értékét
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics a `{GRAPHICS}` legfeljebb {MAX_GRAPHICS} grafikát fogad
@msg A plane has one face: map its graphics onto the front A síknak egy oldala van: a grafikáit az elülső oldalra helyezze
@@ -10786,6 +10791,15 @@ breakText Glyphs Glifák
@msg A panel is not joined to the rest by a crease. Egy panelt egyetlen bigvonal sem köt a többihez.
@msg A fold line is on a non-printing layer. Egy hajtásvonal nem nyomtatható rétegen van.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panelek: {panels}, zsanérok: {hinges}, hibák: {errors}, figyelmeztetések: {warnings}
Nature Icons Természetikonok
Flower Virág
Tree Fa
Mountain Hegy
Ornamental Díszítőmotívumok
Scrollwork Kacskaringó
Filigree Arrow Filigrán nyíl
Petal Sweep Sziromív
Twin Curl Kettős kacskaringó
Vector Packs Vektorcsomagok
Compass Rose Iránytűrózsa
Botanical Sprig Növényi ágacska
Can't render this file because it is too large.
+15 -1
View File
@@ -344,8 +344,10 @@
@msg `{GRAPHICS}` face must be front, back or side face `{GRAPHICS}` harus front, back, atau side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} `{GRAPHICS}` harus berupa angka dari {lo} sampai {hi}
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` harus berupa larik
@msg Graphics map onto the Plane, Extrude and Revolve object types Grafis dipetakan ke jenis objek Plane, Extrude, dan Revolve
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafis dipetakan ke jenis objek Bidang, Ekstrusi, Revolusi, dan Gelembungkan
@msg Revolve maps graphics onto its side: map them onto the front Revolusi memetakan grafis ke sisinya: petakan ke bagian depan
@msg Inflate maps graphics onto its front and back, not onto a side Gelembungkan memetakan grafis ke bagian depan dan belakangnya, bukan ke sisi
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objek {_1}: bagian belakang Gelembungkan hanya menerima grafis saat Kedua sisi dan Ujung diaktifkan
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafis terlalu rumit untuk permukaan ini: sederhanakan karya simbol atau kurangi Segmen
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` menerima paling banyak {MAX_GRAPHICS} grafis
@msg A plane has one face: map its graphics onto the front Bidang memiliki satu sisi: petakan grafisnya ke bagian depan
@@ -4148,6 +4150,8 @@ theme Appearance Tampilan
Symbolism Tool Alat simbolisme
Image Trace Presets Preset telusur gambar
Live Paint Bucket Ember Live Paint
Fill Area Isi Area
Fill Area Tool Alat Isi Area
Live Paint Bucket (Stroke) Ember Live Paint (guratan)
Live Paint Info Info Live Paint
Shape Builder Pembangun bentuk
@@ -5597,6 +5601,7 @@ imageTrace Outline Kontur
@msg Saved {path} Berhasil menyimpan {path}
@msg Select text or click into text with the Type tool to insert glyphs Pilih teks atau klik di dalam teks dengan alat Teks untuk menyisipkan glif
@msg Shape Builder: no region under the pointer Pembangun Bentuk: tidak ada area di bawah penunjuk
@msg Fill Area: no enclosed area under the pointer Isi Area: tidak ada area tertutup di bawah penunjuk
@msg Shape Builder: select paths or compound paths Pembangun Bentuk: pilih jalur atau jalur majemuk
@msg Show All Hidden Attributes: nothing is hidden Tampilkan semua atribut tersembunyi: tidak ada yang tersembunyi
@msg Split Into Grid: select paths large enough for the grid Bagi menjadi kisi: pilih jalur yang cukup besar untuk kisi
@@ -8631,6 +8636,15 @@ breakText Glyphs Glif
@msg A joint does not close by {gap} pt. Sebuah sambungan tidak menutup sejauh {gap} pt.
@msg Two panels pass through each other. Dua panel saling menembus.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer harus "singleLine", "everyLine", "standardSingleLine", atau "standardEveryLine"
Nature Icons Ikon Alam
Flower Bunga
Tree Pohon
Mountain Gunung
Ornamental Ornamental
Scrollwork Sulur Hias
Filigree Arrow Panah Filigran
Petal Sweep Sapuan Kelopak
Twin Curl Sulur Ganda
Vector Packs Paket Vektor
Compass Rose Mawar Kompas
Botanical Sprig Ranting Botani
Can't render this file because it is too large.
+15 -1
View File
@@ -2209,6 +2209,8 @@ file-filter Templates Modelli
List Workspaces Elenca aree di lavoro
Live Paint Pittura dinamica
Live Paint Bucket Secchiello pittura dinamica
Fill Area Riempi area
Fill Area Tool Strumento Riempi area
Live Paint Bucket (Stroke) Secchiello pittura dinamica (traccia)
Live Paint Info Informazioni pittura dinamica
Live Paint Selection Tool Strumento Selezione pittura dinamica
@@ -5195,6 +5197,7 @@ liquify-list-end {0}, {1} {0} e {1}
@msg Saved {path} Salvato {path}
@msg Select text or click into text with the Type tool to insert glyphs Seleziona del testo o fai clic nel testo con lo strumento Testo per inserire glifi
@msg Shape Builder: no region under the pointer Generatore forme: nessuna regione sotto il puntatore
@msg Fill Area: no enclosed area under the pointer Riempi area: nessuna area chiusa sotto il puntatore
@msg Shape Builder: select all paths you want to merge Generatore forme: seleziona tutti i tracciati da unire
@msg Shape Builder: select paths or compound paths Generatore forme: seleziona tracciati o tracciati composti
@msg Show All Hidden Attributes: nothing is hidden Mostra tutti gli attributi nascosti: non c'è nulla di nascosto
@@ -6521,8 +6524,10 @@ lighting Light Luce
@msg `{GRAPHICS}` face must be front, back or side face di `{GRAPHICS}` deve essere front, back o side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} di `{GRAPHICS}` deve essere un numero da {lo} a {hi}
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` deve essere un array
@msg Graphics map onto the Plane, Extrude and Revolve object types Le grafiche si applicano ai tipi di oggetto Piano, Estrusione e Rivoluzione
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Le grafiche si applicano ai tipi di oggetto Piano, Estrusione, Rivoluzione e Gonfia
@msg Revolve maps graphics onto its side: map them onto the front Rivoluzione applica le grafiche sul suo lato: applicatele sulla faccia anteriore
@msg Inflate maps graphics onto its front and back, not onto a side Gonfia applica le grafiche sulla faccia anteriore e sul retro, non su un lato
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on oggetto {_1}: il retro di Gonfia accetta grafiche solo con Entrambi i lati e Chiusura attivi
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Le grafiche sono troppo complesse per questa superficie: semplificate il disegno dei simboli o riducete Segmenti
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` accetta al massimo {MAX_GRAPHICS} grafiche
@msg A plane has one face: map its graphics onto the front Un piano ha una sola faccia: applicate le sue grafiche sulla faccia anteriore
@@ -10473,6 +10478,15 @@ breakText Glyphs Glifi
@msg A panel is not joined to the rest by a crease. Un pannello non è unito al resto da alcuna linea di cordonatura.
@msg A fold line is on a non-printing layer. Una linea di piega si trova su un livello non stampabile.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Pannelli: {panels}, cerniere: {hinges}, errori: {errors}, avvisi: {warnings}
Nature Icons Icone della natura
Flower Fiore
Tree Albero
Mountain Montagna
Ornamental Ornamentale
Scrollwork Voluta
Filigree Arrow Freccia filigranata
Petal Sweep Tratto a petali
Twin Curl Doppia voluta
Vector Packs Pacchetti vettoriali
Compass Rose Rosa dei venti
Botanical Sprig Rametto botanico
Can't render this file because it is too large.
+16 -2
View File
@@ -2479,6 +2479,8 @@ antiAlias Sharp シャープ
List View リスト表示
List Workspaces ワークスペースの一覧
Live Paint Bucket ライブペイントツール
Fill Area 領域を塗りつぶし
Fill Area Tool 領域塗りつぶしツール
Live Paint Bucket (Stroke) ライブペイントツール (線)
Live Paint Info ライブペイント情報
Live Paint Selection Tool ライブペイント選択ツール
@@ -5026,6 +5028,7 @@ swatch Bright Violet ビビッドバイオレット
@msg Live Paint: select paths or compound paths ライブペイント: パスまたは複合パスを選択してください
@msg Live Paint: these paths are too degenerate to paint ライブペイント: これらのパスは形状がつぶれすぎていてペイントできません
@msg Shape Builder: no region under the pointer シェイプ形成ツール: ポインターの下に領域がありません
@msg Fill Area: no enclosed area under the pointer 領域を塗りつぶし: ポインターの下に閉じた領域がありません
@msg Shape Builder: select all paths you want to merge シェイプ形成ツール: 結合するパスをすべて選択してください
@msg Shape Builder: select paths or compound paths シェイプ形成ツール: パスまたは複合パスを選択してください
@msg image data `{_1}` is missing 画像データ `{_1}` が見つかりません
@@ -6570,9 +6573,11 @@ lighting Light ライト
@msg `{GRAPHICS}` face must be front, back or side `{GRAPHICS}` の face には front、back、side のいずれかを指定してください
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}` の {key} は {lo} から {hi} までの数値にしてください
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` は配列にしてください
@msg Graphics map onto the Plane, Extrude and Revolve object types グラフィックはオブジェクトの種類が平面、押し出し、回転体のときにマッピングされます
Graphics map onto the Plane, Extrude and Revolve object types. グラフィックはオブジェクトの種類が平面、押し出し、回転体のときにマッピングされます。
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types グラフィックはオブジェクトの種類が平面、押し出し、回転体、膨張のときにマッピングされます
Graphics map onto the Plane, Extrude, Revolve and Inflate object types. グラフィックはオブジェクトの種類が平面、押し出し、回転体、膨張のときにマッピングされます。
@msg Revolve maps graphics onto its side: map them onto the front 回転体はグラフィックを側面にマッピングします。前面にマッピングしてください
@msg Inflate maps graphics onto its front and back, not onto a side 膨張はグラフィックを前面と背面にマッピングします。側面にはマッピングできません
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on オブジェクト {_1}: 「膨張」の背面にグラフィックをマッピングするには「両面」と「キャップ」をオンにしてください
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments グラフィックがこのサーフェスには複雑すぎます。シンボルのアートを単純化するか、分割数を減らしてください
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` に指定できるグラフィックは {MAX_GRAPHICS} 個までです
@msg A plane has one face: map its graphics onto the front 平面には面が 1 つしかありません。グラフィックは前面にマッピングしてください
@@ -10536,6 +10541,15 @@ breakText Glyphs 字形
@msg A panel is not joined to the rest by a crease. パネルがどの筋入れ線でも他とつながっていません。
@msg A fold line is on a non-printing layer. 折り線が印刷しないレイヤーにあります。
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} パネル: {panels}、ヒンジ: {hinges}、エラー: {errors}、警告: {warnings}
Nature Icons 自然アイコン
Flower 花
Tree 木
Mountain 山
Ornamental 装飾模様
Scrollwork スクロール装飾
Filigree Arrow フィリグリーの矢
Petal Sweep 花びらの流線
Twin Curl 二重カール
Vector Packs ベクターパック
Compass Rose 羅針盤のバラ
Botanical Sprig 植物の小枝
Can't render this file because it is too large.
+15 -1
View File
@@ -5560,6 +5560,8 @@ theme Appearance იერსახე
Symbolism Tool სიმბოლოების ხელსაწყო
Image Trace Presets გამოსახულების ვექტორიზაციის პრესეტები
Live Paint Bucket ცოცხალი შეღებვის სათლი
Fill Area არის შევსება
Fill Area Tool არის შევსების ხელსაწყო
Live Paint Bucket (Stroke) ცოცხალი შეღებვის სათლი (კონტური)
Live Paint Info ცოცხალი შეღებვის ინფორმაცია
Shape Builder ფიგურების კონსტრუქტორი
@@ -6965,6 +6967,7 @@ font-technology Variable ცვლადი
@msg Saved {path} შენახულია: {path}
@msg Select text or click into text with the Type tool to insert glyphs გლიფების ჩასასმელად მონიშნეთ ტექსტი ან ტექსტის ხელსაწყოთი დაწკაპეთ ტექსტში
@msg Shape Builder: no region under the pointer ფიგურების კონსტრუქტორი: მაჩვენებლის ქვეშ არე არ არის
@msg Fill Area: no enclosed area under the pointer არის შევსება: მაჩვენებლის ქვეშ დახურული არე არ არის
@msg Shape Builder: select all paths you want to merge ფიგურების კონსტრუქტორი: მონიშნეთ ყველა ტრაექტორია, რომლის გაერთიანებაც გსურთ
@msg Shape Builder: select paths or compound paths ფიგურების კონსტრუქტორი: მონიშნეთ ტრაექტორიები ან შედგენილი ტრაექტორიები
@msg Show All Hidden Attributes: nothing is hidden ყველა დამალული ატრიბუტის ჩვენება: დამალული არაფერია
@@ -8230,8 +8233,10 @@ arrowhead Feather ბუმბული
@msg `{GRAPHICS}` face must be front, back or side `{GRAPHICS}`-ის face უნდა იყოს front, back ან side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}`-ის {key} უნდა იყოს რიცხვი {lo}-დან {hi}-მდე
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` უნდა იყოს მასივი
@msg Graphics map onto the Plane, Extrude and Revolve object types გრაფიკა თავსდება ობიექტის ტიპებზე „სიბრტყე“, „ამოწევა“ და „ბრუნვა“
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types გრაფიკა თავსდება ობიექტის ტიპებზე „სიბრტყე“, „ამოწევა“, „ბრუნვა“ და „გაბერვა“
@msg Revolve maps graphics onto its side: map them onto the front ბრუნვა გრაფიკას თავის გვერდით ზედაპირზე ათავსებს: განათავსეთ ისინი წინა მხარეზე
@msg Inflate maps graphics onto its front and back, not onto a side გაბერვა გრაფიკას წინა და უკანა მხარეზე ათავსებს და არა გვერდით ზედაპირზე
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on ობიექტი {_1}: გაბერვის უკანა მხარე გრაფიკას იღებს მხოლოდ ჩართული „ორივე მხარე“ და „თავსახური“ პარამეტრებით
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments გრაფიკა ზედმეტად რთულია ამ ზედაპირისთვის: გაამარტივეთ სიმბოლოების ნახატი ან შეამცირეთ სეგმენტები
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` იღებს მაქსიმუმ {MAX_GRAPHICS} გრაფიკას
@msg A plane has one face: map its graphics onto the front სიბრტყეს ერთი მხარე აქვს: მისი გრაფიკა წინა მხარეზე განათავსეთ
@@ -11083,6 +11088,15 @@ font-script Japanese იაპონური
@msg A joint does not close by {gap} pt. შეერთება არ იხურება {gap} pt-ით.
@msg Two panels pass through each other. ორი პანელი ერთმანეთში გადის.
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer უნდა იყოს "singleLine", "everyLine", "standardSingleLine" ან "standardEveryLine"
Nature Icons ბუნების ხატულები
Flower ყვავილი
Tree ხე
Mountain მთა
Ornamental ორნამენტული
Scrollwork ხვეული
Filigree Arrow ფილიგრანული ისარი
Petal Sweep ფურცლების რკალი
Twin Curl ორმაგი ხვეული
Vector Packs ვექტორული პაკეტები
Compass Rose კომპასის ვარდი
Botanical Sprig ბოტანიკური ტოტი
Can't render this file because it is too large.
+15 -1
View File
@@ -2469,6 +2469,8 @@ antiAlias Sharp 날카롭게
List View 목록 보기
List Workspaces 작업 영역 목록
Live Paint Bucket 라이브 페인트 통
Fill Area 영역 채우기
Fill Area Tool 영역 채우기 도구
Live Paint Bucket (Stroke) 라이브 페인트 통 (선)
Live Paint Info 라이브 페인트 정보
Live Paint Selection Tool 라이브 페인트 선택 도구
@@ -4955,6 +4957,7 @@ theme Appearance 외관
@msg Live Paint: select paths or compound paths 라이브 페인트: 패스 또는 컴파운드 패스를 선택하세요
@msg Live Paint: these paths are too degenerate to paint 라이브 페인트: 이 패스는 퇴화되어 칠할 수 없습니다
@msg Shape Builder: no region under the pointer 모양 빌더: 포인터 아래에 영역이 없습니다
@msg Fill Area: no enclosed area under the pointer 영역 채우기: 포인터 아래에 닫힌 영역이 없습니다
@msg Shape Builder: select all paths you want to merge 모양 빌더: 병합할 패스를 모두 선택하세요
@msg Shape Builder: select paths or compound paths 모양 빌더: 패스 또는 컴파운드 패스를 선택하세요
@msg image data `{_1}` is missing 이미지 데이터 `{_1}`이(가) 없습니다
@@ -6491,8 +6494,10 @@ lighting Light 광원
@msg `{GRAPHICS}` face must be front, back or side `{GRAPHICS}`의 face는 front, back 또는 side여야 합니다
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}`의 {key}은(는) {lo}에서 {hi} 사이의 숫자여야 합니다
@msg `{GRAPHICS}` must be an array `{GRAPHICS}`은(는) 배열이어야 합니다
@msg Graphics map onto the Plane, Extrude and Revolve object types 그래픽은 평면, 돌출, 회전체 개체 유형에 매핑됩니다
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types 그래픽은 평면, 돌출, 회전체, 부풀리기 개체 유형에 매핑됩니다
@msg Revolve maps graphics onto its side: map them onto the front 회전체는 그래픽을 옆면에 매핑합니다. 앞면에 매핑하십시오
@msg Inflate maps graphics onto its front and back, not onto a side 부풀리기는 그래픽을 앞면과 뒷면에 매핑하며 옆면에는 매핑하지 않습니다
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on 개체 {_1}: 부풀리기의 뒷면에 그래픽을 매핑하려면 양면과 캡을 켜세요
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments 그래픽이 이 표면에 비해 너무 복잡합니다. 심볼의 아트를 단순화하거나 세그먼트를 줄이십시오
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}`에는 그래픽을 최대 {MAX_GRAPHICS}개까지 넣을 수 있습니다
@msg A plane has one face: map its graphics onto the front 평면에는 면이 하나뿐입니다. 그래픽을 앞면에 매핑하십시오
@@ -10436,6 +10441,15 @@ breakText Glyphs 글리프
@msg A panel is not joined to the rest by a crease. 패널이 어떤 오시선으로도 나머지와 연결되어 있지 않습니다.
@msg A fold line is on a non-printing layer. 접는 선이 인쇄되지 않는 레이어에 있습니다.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} 패널: {panels}, 힌지: {hinges}, 오류: {errors}, 경고: {warnings}
Nature Icons 자연 아이콘
Flower 꽃
Tree 나무
Mountain 산
Ornamental 장식 문양
Scrollwork 소용돌이 장식
Filigree Arrow 세공 화살표
Petal Sweep 꽃잎 곡선
Twin Curl 이중 소용돌이
Vector Packs 벡터 팩
Compass Rose 나침반 장미
Botanical Sprig 식물 가지
Can't render this file because it is too large.
+15 -1
View File
@@ -4148,6 +4148,8 @@ theme Appearance Vormgeving
Symbolism Tool Symbolisatiegereedschap
Image Trace Presets Voorinstellingen voor afbeeldingtracering
Live Paint Bucket Live Paint-emmer
Fill Area Gebied vullen
Fill Area Tool Gereedschap Gebied vullen
Live Paint Bucket (Stroke) Live Paint-emmer (streek)
Live Paint Info Live Paint-info
Shape Builder Vormopbouw
@@ -5602,6 +5604,7 @@ imageTrace Outline Contour
@msg Saved {path} {path} opgeslagen
@msg Select text or click into text with the Type tool to insert glyphs Selecteer tekst of klik met het tekstgereedschap in tekst om glyphs in te voegen
@msg Shape Builder: no region under the pointer Vormbouwer: geen gebied onder de aanwijzer
@msg Fill Area: no enclosed area under the pointer Gebied vullen: geen gesloten gebied onder de aanwijzer
@msg Shape Builder: select all paths you want to merge Vormbouwer: selecteer alle paden die je wilt samenvoegen
@msg Shape Builder: select paths or compound paths Vormbouwer: selecteer paden of samengestelde paden
@msg Show All Hidden Attributes: nothing is hidden Alle verborgen kenmerken tonen: er is niets verborgen
@@ -8656,8 +8659,10 @@ mark-style Japanese Japans
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} in `{GRAPHICS}` moet een getal van {lo} tot {hi} zijn
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` moet een array zijn
@msg Graphics map onto planar faces: use the Extrude or Plane object type Illustraties worden op platte vlakken geplaatst: gebruik het objecttype Extruderen of Vlak
@msg Graphics map onto the Plane, Extrude and Revolve object types Illustraties worden op de objecttypen Vlak, Extruderen en Draaien geplaatst
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Illustraties worden op de objecttypen Vlak, Extruderen, Draaien en Opblazen geplaatst
@msg Revolve maps graphics onto its side: map them onto the front Draaien plaatst illustraties op de zijkant: plaats ze op de voorkant
@msg Inflate maps graphics onto its front and back, not onto a side Opblazen plaatst illustraties op de voorkant en de achterkant, niet op een zijkant
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on object {_1}: de achterkant van Opblazen neemt alleen afbeeldingen aan met Beide zijden en Dop ingeschakeld
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments De illustraties zijn te complex voor dit oppervlak: vereenvoudig de illustraties van de symbolen of verlaag Segmenten
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` neemt maximaal {MAX_GRAPHICS} illustraties op
@msg A plane has one face: map its graphics onto the front Een vlak heeft één zijde: plaats de illustraties ervan op de voorkant
@@ -10836,6 +10841,15 @@ breakText Glyphs Glyphs
@msg A panel is not joined to the rest by a crease. Een paneel is door geen rillijn met de rest verbonden.
@msg A fold line is on a non-printing layer. Een vouwlijn staat op een laag die niet wordt afgedrukt.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panelen: {panels}, scharnieren: {hinges}, fouten: {errors}, waarschuwingen: {warnings}
Nature Icons Natuurpictogrammen
Flower Bloem
Tree Boom
Mountain Berg
Ornamental Ornamentaal
Scrollwork Krulwerk
Filigree Arrow Filigraanpijl
Petal Sweep Bloemblaadjeszwaai
Twin Curl Dubbele krul
Vector Packs Vectorpakketten
Compass Rose Kompasroos
Botanical Sprig Botanisch takje
Can't render this file because it is too large.
+15 -1
View File
@@ -3681,6 +3681,8 @@ theme Appearance Wygląd
Symbolism Tool Narzędzie symboli
Image Trace Presets Ustawienia obrysu obrazu
Live Paint Bucket Wiadro aktywnego malowania
Fill Area Wypełnij obszar
Fill Area Tool Narzędzie Wypełnij obszar
Live Paint Bucket (Stroke) Wiadro aktywnego malowania (obrys)
Live Paint Info Informacje o aktywnym malowaniu
Shape Builder Kreator kształtów
@@ -5300,6 +5302,7 @@ liquify-list-end {0}, {1} {0} i {1}
@msg Saved {path} Zapisano {path}
@msg Select text or click into text with the Type tool to insert glyphs Zaznacz tekst lub kliknij w tekst narzędziem Tekst, aby wstawić glify
@msg Shape Builder: no region under the pointer Kreator kształtów: brak obszaru pod wskaźnikiem
@msg Fill Area: no enclosed area under the pointer Wypełnij obszar: brak zamkniętego obszaru pod wskaźnikiem
@msg Shape Builder: select all paths you want to merge Kreator kształtów: zaznacz wszystkie ścieżki, które chcesz scalić
@msg Shape Builder: select paths or compound paths Kreator kształtów: zaznacz ścieżki lub ścieżki złożone
@msg Show All Hidden Attributes: nothing is hidden Pokaż wszystkie ukryte atrybuty: nic nie jest ukryte
@@ -6733,8 +6736,10 @@ mark-style Japanese Japońskie
@msg `{GRAPHICS}` face must be front, back or side face w `{GRAPHICS}` musi mieć wartość front, back lub side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} w `{GRAPHICS}` musi być liczbą od {lo} do {hi}
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` musi być tablicą
@msg Graphics map onto the Plane, Extrude and Revolve object types Grafiki są nakładane na obiekty typu Płaszczyzna, Wyciągnięcie i Obrót
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafiki są nakładane na obiekty typu Płaszczyzna, Wyciągnięcie, Obrót i Nadmuchanie
@msg Revolve maps graphics onto its side: map them onto the front Obrót nakłada grafiki na swoją powierzchnię boczną: umieść je na przedniej stronie
@msg Inflate maps graphics onto its front and back, not onto a side Nadmuchanie nakłada grafiki na przednią i tylną stronę, a nie na powierzchnię boczną
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on obiekt {_1}: tył Nadmuchania przyjmuje grafiki tylko przy włączonych opcjach Obie strony i Zakończenie
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafiki są zbyt złożone dla tej powierzchni: uprość kompozycje symboli lub zmniejsz Segmenty
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` przyjmuje najwyżej {MAX_GRAPHICS} grafik
@msg A plane has one face: map its graphics onto the front Płaszczyzna ma jedną stronę: umieść jej grafiki na przedniej stronie
@@ -10662,6 +10667,15 @@ breakText Glyphs Glify
@msg A panel is not joined to the rest by a crease. Panel nie jest połączony z resztą żadną linią bigowania.
@msg A fold line is on a non-printing layer. Linia zgięcia znajduje się na warstwie niedrukowanej.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Panele: {panels}, zawiasy: {hinges}, błędy: {errors}, ostrzeżenia: {warnings}
Nature Icons Ikony natury
Flower Kwiat
Tree Drzewo
Mountain Góra
Ornamental Ornamentalne
Scrollwork Zawijas
Filigree Arrow Filigranowa strzałka
Petal Sweep Smuga płatków
Twin Curl Podwójny zawijas
Vector Packs Pakiety wektorowe
Compass Rose Róża wiatrów
Botanical Sprig Gałązka botaniczna
Can't render this file because it is too large.
+15 -1
View File
@@ -1829,6 +1829,8 @@ antiAlias Sharp Nítido
List Workspaces Listar Espaços de Trabalho
Live Paint Pintura ao Vivo
Live Paint Bucket Balde de Pintura ao Vivo
Fill Area Preencher área
Fill Area Tool Ferramenta Preencher Área
Live Paint Bucket (Stroke) Balde de Pintura ao Vivo (Traçado)
Live Paint Info Informações da Pintura ao Vivo
Live Paint Selection Tool Ferramenta Seleção de Pintura ao Vivo
@@ -4450,6 +4452,7 @@ axis Both Ambos
@msg Saved {path} {path} salvo
@msg Select text or click into text with the Type tool to insert glyphs Selecione texto ou clique em um texto com a ferramenta Texto para inserir glifos
@msg Shape Builder: no region under the pointer Criador de formas: nenhuma região sob o ponteiro
@msg Fill Area: no enclosed area under the pointer Preencher área: nenhuma área fechada sob o ponteiro
@msg Shape Builder: select all paths you want to merge Criador de formas: selecione todos os traçados que deseja mesclar
@msg Shape Builder: select paths or compound paths Criador de formas: selecione traçados ou traçados compostos
@msg Show All Hidden Attributes: nothing is hidden Mostrar todos os atributos ocultos: nada está oculto
@@ -6855,8 +6858,10 @@ mark-style Japanese Japonesas
@msg `{GRAPHICS}` face must be front, back or side face de `{GRAPHICS}` deve ser front, back ou side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} de `{GRAPHICS}` deve ser um número de {lo} a {hi}
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` deve ser uma matriz
@msg Graphics map onto the Plane, Extrude and Revolve object types Os gráficos são mapeados nos tipos de objeto Plano, Extrusão e Revolver
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Os gráficos são mapeados nos tipos de objeto Plano, Extrusão, Revolver e Inflar
@msg Revolve maps graphics onto its side: map them onto the front Revolver mapeia os gráficos na sua lateral: mapeie-os na face frontal
@msg Inflate maps graphics onto its front and back, not onto a side Inflar mapeia os gráficos na face frontal e no verso, não em uma lateral
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objeto {_1}: o verso de Inflar recebe gráficos apenas com Ambos os Lados e Tampa ativados
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Os gráficos são complexos demais para esta superfície: simplifique a arte dos símbolos ou reduza Segmentos
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` aceita no máximo {MAX_GRAPHICS} gráficos
@msg A plane has one face: map its graphics onto the front Um plano tem uma única face: mapeie seus gráficos na face frontal
@@ -10869,6 +10874,15 @@ swatch Yellow Green Verde-amarelado
@msg A panel is not joined to the rest by a crease. Um painel não está unido ao restante por nenhuma linha de vinco.
@msg A fold line is on a non-printing layer. Uma linha de dobra está em uma camada não imprimível.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Painéis: {panels}, dobradiças: {hinges}, erros: {errors}, avisos: {warnings}
Nature Icons Ícones da natureza
Flower Flor
Tree Árvore
Mountain Montanha
Ornamental Ornamental
Scrollwork Voluta
Filigree Arrow Seta filigranada
Petal Sweep Traço de pétalas
Twin Curl Voluta dupla
Vector Packs Pacotes vetoriais
Compass Rose Rosa dos ventos
Botanical Sprig Ramo botânico
Can't render this file because it is too large.
+15 -1
View File
@@ -2195,6 +2195,8 @@ file-filter Templates Шаблоны
List Workspaces Перечислить рабочие среды
Live Paint Быстрая заливка
Live Paint Bucket Быстрая заливка (ведро)
Fill Area Заливка области
Fill Area Tool Инструмент «Заливка области»
Live Paint Bucket (Stroke) Быстрая заливка (обводка)
Live Paint Info Сведения о быстрой заливке
Live Paint Selection Tool Инструмент «Выделение быстрой заливки»
@@ -5190,6 +5192,7 @@ liquify-list-end {0}, {1} {0} и {1}
@msg Saved {path} Сохранено: {path}
@msg Select text or click into text with the Type tool to insert glyphs Выделите текст или щёлкните внутри текста инструментом «Текст», чтобы вставить глифы
@msg Shape Builder: no region under the pointer Создание фигур: под указателем нет области
@msg Fill Area: no enclosed area under the pointer Заливка области: под указателем нет замкнутой области
@msg Shape Builder: select all paths you want to merge Создание фигур: выделите все контуры, которые нужно объединить
@msg Shape Builder: select paths or compound paths Создание фигур: выделите контуры или составные контуры
@msg Show All Hidden Attributes: nothing is hidden Показать все скрытые атрибуты: ничего не скрыто
@@ -6518,8 +6521,10 @@ lighting Light Свет
@msg `{GRAPHICS}` face must be front, back or side face в `{GRAPHICS}` должен быть front, back или side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} в `{GRAPHICS}` должен быть числом от {lo} до {hi}
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` должен быть массивом
@msg Graphics map onto the Plane, Extrude and Revolve object types Графика наносится на объекты типов «Плоскость», «Выдавливание» и «Вращение»
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Графика наносится на объекты типов «Плоскость», «Выдавливание», «Вращение» и «Надувание»
@msg Revolve maps graphics onto its side: map them onto the front «Вращение» наносит графику на свою боковую поверхность: размещайте её на передней стороне
@msg Inflate maps graphics onto its front and back, not onto a side «Надувание» наносит графику на переднюю и заднюю стороны, а не на боковую поверхность
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on объект {_1}: задняя сторона «Надувания» принимает графику только при включённых параметрах «С обеих сторон» и «Торцы»
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Графика слишком сложна для этой поверхности: упростите иллюстрации символов или уменьшите «Сегменты»
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` принимает не более {MAX_GRAPHICS} графических элементов
@msg A plane has one face: map its graphics onto the front У плоскости одна сторона: размещайте её графику на передней стороне
@@ -10853,6 +10858,15 @@ shape Open Открытый
@msg Two panels pass through each other. Две панели проходят друг сквозь друга.
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} пикселей — слишком большой размер для PSD (не более {MAX_SIDE} пикселей по стороне): уменьшите разрешение
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer должен быть "singleLine", "everyLine", "standardSingleLine" или "standardEveryLine"
Nature Icons Значки природы
Flower Цветок
Tree Дерево
Mountain Гора
Ornamental Орнаментальные
Scrollwork Завиток
Filigree Arrow Филигранная стрела
Petal Sweep Лепестковый росчерк
Twin Curl Двойной завиток
Vector Packs Векторные наборы
Compass Rose Роза ветров
Botanical Sprig Ботаническая ветвь
Can't render this file because it is too large.
+16 -2
View File
@@ -2097,6 +2097,8 @@ font-technology Variable Variabla
List Workspaces Lista arbetslayouter
Live Paint Direktmålning
Live Paint Bucket Direktmålningshink
Fill Area Fyll område
Fill Area Tool Verktyget Fyll område
Live Paint Bucket (Stroke) Direktmålningshink (kontur)
Live Paint Info Direktmålningsinfo
Live Paint Selection Tool Markeringsverktyg för direktmålning
@@ -5065,6 +5067,7 @@ liquify-list-end {0}, {1} {0} och {1}
@msg Saved {path} Sparade {path}
@msg Select text or click into text with the Type tool to insert glyphs Markera text eller klicka i text med textverktyget för att infoga glyfer
@msg Shape Builder: no region under the pointer Formbyggare: inget område under pekaren
@msg Fill Area: no enclosed area under the pointer Fyll område: inget slutet område under pekaren
@msg Shape Builder: select all paths you want to merge Formbyggare: markera alla banor du vill sammanfoga
@msg Shape Builder: select paths or compound paths Formbyggare: markera banor eller sammansatta banor
@msg Show All Hidden Attributes: nothing is hidden Visa alla dolda attribut: ingenting är dolt
@@ -6385,9 +6388,11 @@ lighting Light Ljus
@msg `{GRAPHICS}` face must be front, back or side face i `{GRAPHICS}` måste vara front, back eller side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} i `{GRAPHICS}` måste vara ett tal från {lo} till {hi}
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` måste vara en matris
@msg Graphics map onto the Plane, Extrude and Revolve object types Grafik placeras på objekttyperna Plan, Extrudera och Rotera runt axel
Graphics map onto the Plane, Extrude and Revolve object types. Grafik placeras på objekttyperna Plan, Extrudera och Rotera runt axel.
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafik placeras på objekttyperna Plan, Extrudera, Rotera runt axel och Blås upp
Graphics map onto the Plane, Extrude, Revolve and Inflate object types. Grafik placeras på objekttyperna Plan, Extrudera, Rotera runt axel och Blås upp.
@msg Revolve maps graphics onto its side: map them onto the front Rotera runt axel placerar grafik på sin mantelyta: placera den på framsidan
@msg Inflate maps graphics onto its front and back, not onto a side Blås upp placerar grafik på framsidan och baksidan, inte på en sida
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on objekt {_1}: baksidan av Blås upp tar emot grafik bara när Båda sidor och Lock är på
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafiken är för komplex för den här ytan: förenkla symbolernas teckning eller minska Segment
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` tar högst {MAX_GRAPHICS} grafiker
@msg A plane has one face: map its graphics onto the front Ett plan har en sida: placera dess grafik på framsidan
@@ -10890,6 +10895,15 @@ digits Hindi Hindi
@msg A joint does not close by {gap} pt. En fog sluter inte med {gap} pt.
@msg Two panels pass through each other. Två paneler går igenom varandra.
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} pixlar är för stort för PSD (högst {MAX_SIDE} pixlar per sida): sänk upplösningen
Nature Icons Naturikoner
Flower Blomma
Tree Träd
Mountain Berg
Ornamental Ornament
Scrollwork Snirkel
Filigree Arrow Filigranpil
Petal Sweep Kronbladssvep
Twin Curl Dubbel snirkel
Vector Packs Vektorpaket
Compass Rose Kompassros
Botanical Sprig Botanisk kvist
Can't render this file because it is too large.
+37 -2
View File
@@ -438,7 +438,10 @@ fn swedish_svg_filter_spelling_and_3d_labels_are_complete() {
("Apply SVG Filter", "Använd SVG-filter"),
("Check Spelling", "Kontrollera stavning"),
("SVG Filter", "SVG-filter"),
("Graphics map onto the Plane, Extrude and Revolve object types.", "Grafik placeras på objekttyperna Plan, Extrudera och Rotera runt axel."),
(
"Graphics map onto the Plane, Extrude, Revolve and Inflate object types.",
"Grafik placeras på objekttyperna Plan, Extrudera, Rotera runt axel och Blås upp.",
),
] {
assert_eq!(sv.catalog().plain(en), Some(want), "{en}");
}
@@ -570,6 +573,16 @@ fn objects_on_path_detach_strings_are_in_complete_catalogs() {
}
}
/// The Nature Icons library and its symbols display in each complete UI language.
#[test]
fn nature_symbol_library_names_are_in_complete_catalogs() {
for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus) {
for name in ["Nature Icons", "Leaf", "Flower", "Tree", "Mountain", "Wave"] {
assert!(lang.catalog().plain(name).is_some(), "{} is missing {name}", lang.code);
}
}
}
/// The errors of Perspective Distort and Free Distort on an image, and of the image commands that
/// refuse a distorted image, are in every complete-message catalog.
#[test]
@@ -839,7 +852,7 @@ fn built_in_library_symbol_names_are_in_complete_catalogs() {
.flat_map(|(_, lib)| lib.doc.symbols.iter().map(|s| s.name.clone()).collect::<Vec<_>>())
.collect(),
);
assert_eq!(names.len(), 38, "{names:?}");
assert_eq!(names.len(), 43, "{names:?}");
let bad = lacking(&names, |c, n| c.plain(n).is_some());
assert!(bad.is_empty(), "{}", bad.join("\n"));
}
@@ -4140,6 +4153,28 @@ fn three_d_refusals_translate_with_their_values() {
assert_eq!(message(de(), &errors[1].0), "ungültige Parameter für `effect.apply`: Licht: intensity muss eine Zahl von 0 bis 100 sein");
}
/// Map Graphic's refusal of Inflate's back while Both sides or Cap is off shows in every
/// complete-message language, with the object's number as given.
#[test]
fn inflate_back_refusal_translates_in_every_complete_catalog() {
use serde_json::json;
let mut s = vectorcraft_engine::Session::new();
s.execute("file.new", &json!({"width": 400, "height": 400})).unwrap();
let mark = s.execute("path.create", &json!({"d": "M300 300L310 300L310 320L300 320Z"})).unwrap()["id"].clone();
s.execute("threeD.addGraphic", &json!({"name": "Mark", "ids": [mark]})).unwrap();
let id = s.execute("path.create", &json!({"d": "M100 100L200 100L200 200L100 200Z"})).unwrap()["id"].as_u64().unwrap();
s.execute("effect.apply", &json!({"effect": "threeD.inflate", "item": null, "params": {}})).unwrap();
let e = s.execute("threeD.mapGraphic", &json!({"symbol": "Mark", "face": "back", "ids": [id]})).unwrap_err().to_string();
let english = "Inflate's back takes graphics with Both sides and Cap on";
assert!(e.ends_with(&format!("object {id}: {english}")), "{e}");
assert_eq!(message(Lang::EN, &e), e);
for code in COMPLETE_MESSAGES {
let lang = Lang::from_code(code).expect("registered");
let shown = message(lang, &e);
assert!(!shown.contains(english) && shown.contains(&id.to_string()) && shown.contains("`threeD.mapGraphic`"), "{code}: {e} -> {shown}");
}
}
/// The Blob Brush's range refusals (`path.blob` `angle`, `roundness` and `fidelity`) show in every
/// complete-message language with the key and the range numbers as given; the error the command
/// returns stays English.
+15 -1
View File
@@ -1990,6 +1990,8 @@ font-technology Variable Değişken
List Workspaces Çalışma Alanlarını Listeleme
Live Paint Canlı Boyama
Live Paint Bucket Canlı Boyama Kovası
Fill Area Alanı Doldur
Fill Area Tool Alan Doldurma Aracı
Live Paint Bucket (Stroke) Canlı Boya Kovası (Strok)
Live Paint Info Canlı Boyama Bilgisi
Live Paint Selection Tool Canlı Boyama Seçim Aracı
@@ -4900,6 +4902,7 @@ liquify-list-end {0}, {1} {0} ve {1}
@msg Saved {path} {path} kaydedildi
@msg Select text or click into text with the Type tool to insert glyphs Glif eklemek için metni seçin veya Yazım aracıyla metne tıklayın
@msg Shape Builder: no region under the pointer Şekil Oluşturucu: işaretçinin altında bölge yok
@msg Fill Area: no enclosed area under the pointer Alanı Doldur: işaretçinin altında kapalı alan yok
@msg Shape Builder: select all paths you want to merge Şekil Oluşturucu: birleştirmek istediğiniz tüm yolları seçin
@msg Shape Builder: select paths or compound paths Şekil Oluşturucu: yolları veya bileşik yolları seçin
@msg Show All Hidden Attributes: nothing is hidden Tüm Gizli Özellikleri Göster: hiçbir şey gizli değildir
@@ -6211,8 +6214,10 @@ lighting Light Işık
@msg `{GRAPHICS}` face must be front, back or side `{GRAPHICS}` face değeri front, back veya side olmalıdır
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}` {key} değeri {lo} ile {hi} arasında bir sayı olmalıdır
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` bir dizi olmalıdır
@msg Graphics map onto the Plane, Extrude and Revolve object types Grafikler Düzlem, Ekstrüzyon ve Eksen Etrafında Döndür nesne türlerine eşlenir
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Grafikler Düzlem, Ekstrüzyon, Eksen Etrafında Döndür ve Şişir nesne türlerine eşlenir
@msg Revolve maps graphics onto its side: map them onto the front Eksen Etrafında Döndür grafikleri yan yüzeyine eşler: onları ön yüze eşle
@msg Inflate maps graphics onto its front and back, not onto a side Şişir grafikleri ön ve arka yüze eşler, yan yüze eşlemez
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on nesne {_1}: Şişir efektinin arka yüzü yalnızca Her iki taraf ve Kapak açıkken grafik alır
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Grafikler bu yüzey için çok karmaşık: sembollerin resmini basitleştir veya Segmentler değerini azalt
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` en fazla {MAX_GRAPHICS} grafik alır
@msg A plane has one face: map its graphics onto the front Bir düzlemin tek yüzü vardır: grafiklerini ön yüze eşle
@@ -10755,6 +10760,15 @@ breakText Glyphs Glifler
@msg A panel is not joined to the rest by a crease. Bir panel geri kalanlara hiçbir pilyaj çizgisiyle bağlı değil.
@msg A fold line is on a non-printing layer. Bir katlama çizgisi yazdırılmayan bir katmanda.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Paneller: {panels}, menteşeler: {hinges}, hatalar: {errors}, uyarılar: {warnings}
Nature Icons Doğa simgeleri
Flower Çiçek
Tree Ağaç
Mountain Dağ
Ornamental Süslemeli
Scrollwork Kıvrım süsü
Filigree Arrow Telkari ok
Petal Sweep Yaprakçık kıvrımı
Twin Curl Çift kıvrım
Vector Packs Vektör Paketleri
Compass Rose Pusula Gülü
Botanical Sprig Botanik Dal
Can't render this file because it is too large.
+15 -1
View File
@@ -2203,6 +2203,8 @@ file-filter Templates Шаблони
List Workspaces Перелічити робочі середовища
Live Paint Швидка заливка
Live Paint Bucket Швидка заливка (відро)
Fill Area Заливка області
Fill Area Tool Інструмент «Заливка області»
Live Paint Bucket (Stroke) Швидка заливка (обведення)
Live Paint Info Відомості про швидку заливку
Live Paint Selection Tool Інструмент «Виділення швидкої заливки»
@@ -5179,6 +5181,7 @@ liquify-list-end {0}, {1} {0} і {1}
@msg Saved {path} Збережено: {path}
@msg Select text or click into text with the Type tool to insert glyphs Виділіть текст або клацніть всередині тексту інструментом «Текст», щоб вставити гліфи
@msg Shape Builder: no region under the pointer Створення фігур: під вказівником немає області
@msg Fill Area: no enclosed area under the pointer Заливка області: під вказівником немає замкненої області
@msg Shape Builder: select all paths you want to merge Створення фігур: виділіть усі контури, які потрібно об’єднати
@msg Shape Builder: select paths or compound paths Створення фігур: виділіть контури або складені контури
@msg Show All Hidden Attributes: nothing is hidden Показати всі приховані атрибути: нічого не приховано
@@ -6501,8 +6504,10 @@ lighting Light Світло
@msg `{GRAPHICS}` face must be front, back or side face у `{GRAPHICS}` має бути front, back або side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} у `{GRAPHICS}` має бути числом від {lo} до {hi}
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` має бути масивом
@msg Graphics map onto the Plane, Extrude and Revolve object types Графіка наноситься на об’єкти типів «Площина», «Видавлювання» та «Обертання»
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Графіка наноситься на об’єкти типів «Площина», «Видавлювання», «Обертання» та «Надування»
@msg Revolve maps graphics onto its side: map them onto the front «Обертання» наносить графіку на свою бічну поверхню: розміщуйте її на передній стороні
@msg Inflate maps graphics onto its front and back, not onto a side «Надування» наносить графіку на передній і задній боки, а не на бічну поверхню
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on об’єкт {_1}: задній бік «Надування» приймає графіку лише з увімкненими параметрами «З обох боків» і «Торці»
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Графіка надто складна для цієї поверхні: спростіть ілюстрації символів або зменште «Сегменти»
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` приймає не більше {MAX_GRAPHICS} графічних елементів
@msg A plane has one face: map its graphics onto the front Площина має одну сторону: розміщуйте її графіку на передній стороні
@@ -10449,6 +10454,15 @@ breakText Glyphs Гліфи
@msg A panel is not joined to the rest by a crease. Панель не з’єднана з рештою жодною лінією біговки.
@msg A fold line is on a non-printing layer. Лінія згину лежить на шарі, що не друкується.
@msg Panels: {panels}, hinges: {hinges}, errors: {errors}, warnings: {warnings} Панелі: {panels}, шарніри: {hinges}, помилки: {errors}, попередження: {warnings}
Nature Icons Значки природи
Flower Квітка
Tree Дерево
Mountain Гора
Ornamental Орнаментальні
Scrollwork Завиток
Filigree Arrow Філігранна стріла
Petal Sweep Пелюстковий розчерк
Twin Curl Подвійний завиток
Vector Packs Векторні набори
Compass Rose Роза вітрів
Botanical Sprig Ботанічна гілочка
Can't render this file because it is too large.
+15 -1
View File
@@ -2519,6 +2519,8 @@ digits Hindi Hindi
List Workspaces Liệt kê không gian làm việc
Live Paint Tô trực tiếp
Live Paint Bucket Xô Tô trực tiếp
Fill Area Tô vùng
Fill Area Tool Công cụ Tô vùng
Live Paint Bucket (Stroke) Xô Tô trực tiếp (Nét)
Live Paint Info Thông tin Tô trực tiếp
Live Paint Selection Tool Công cụ Chọn Tô trực tiếp
@@ -6169,6 +6171,7 @@ liquify-list-end {0}, {1} {0} và {1}
@msg shadings of more than 4096 patches or triangles were left out các vùng tô có hơn 4096 mảnh hoặc tam giác đã bị bỏ qua
@msg shadings whose functions are of an unknown type are filled with their middle colour các vùng tô có hàm loại không xác định được tô bằng màu giữa
@msg Shape Builder: no region under the pointer Xây dựng hình dạng: không có vùng nào dưới con trỏ
@msg Fill Area: no enclosed area under the pointer Tô vùng: không có vùng kín nào dưới con trỏ
@msg Shape Builder: select all paths you want to merge Xây dựng hình dạng: chọn tất cả đường dẫn bạn muốn hợp nhất
@msg Shape Builder: select paths or compound paths Xây dựng hình dạng: chọn đường dẫn hoặc đường dẫn phức
@msg shortcut for `{k}` must be a string phím tắt cho `{k}` phải là chuỗi
@@ -6253,8 +6256,10 @@ liquify-list-end {0}, {1} {0} và {1}
@msg `{GRAPHICS}` face must be front, back or side face của `{GRAPHICS}` phải là front, back hoặc side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} {key} của `{GRAPHICS}` phải là số từ {lo} đến {hi}
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` phải là một mảng
@msg Graphics map onto the Plane, Extrude and Revolve object types Đồ họa được đặt lên các loại đối tượng Mặt phẳng, Kéo dài và Xoay tròn
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types Đồ họa được đặt lên các loại đối tượng Mặt phẳng, Kéo dài, Xoay tròn và Phình
@msg Revolve maps graphics onto its side: map them onto the front Xoay tròn đặt đồ họa lên mặt bên của nó: hãy đặt chúng lên mặt trước
@msg Inflate maps graphics onto its front and back, not onto a side Phình đặt đồ họa lên mặt trước và mặt sau, không đặt lên mặt bên
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on đối tượng {_1}: mặt sau của Phình chỉ nhận đồ họa khi bật Cả hai mặt và Nắp
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments Đồ họa quá phức tạp cho bề mặt này: hãy đơn giản hóa hình vẽ của các ký hiệu hoặc giảm Đoạn
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` nhận tối đa {MAX_GRAPHICS} đồ họa
@msg A plane has one face: map its graphics onto the front Mặt phẳng chỉ có một mặt: hãy đặt đồ họa của nó lên mặt trước
@@ -8646,6 +8651,15 @@ breakText Glyphs Glyph
@msg {width} × {height} pixels is too large for Targa (at most 65535 pixels a side): lower the resolution {width} × {height} điểm ảnh quá lớn cho Targa (tối đa 65535 điểm ảnh mỗi cạnh): hãy giảm độ phân giải
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} điểm ảnh quá lớn cho PSD (tối đa {MAX_SIDE} điểm ảnh mỗi cạnh): hãy giảm độ phân giải
@msg composer must be "singleLine", "everyLine", "standardSingleLine" or "standardEveryLine" composer phải là "singleLine", "everyLine", "standardSingleLine" hoặc "standardEveryLine"
Nature Icons Biểu tượng thiên nhiên
Flower Hoa
Tree Cây
Mountain Núi
Ornamental Hoa văn
Scrollwork Nét cuộn
Filigree Arrow Mũi tên hoa văn
Petal Sweep Nét cánh hoa
Twin Curl Nét cuộn đôi
Vector Packs Bộ cọ véc-tơ
Compass Rose Hoa la bàn
Botanical Sprig Cành cây
Can't render this file because it is too large.
+16 -2
View File
@@ -2079,6 +2079,8 @@ file-filter Templates 模板
List Workspaces 列出工作区
Live Paint 实时上色
Live Paint Bucket 实时上色工具
Fill Area 填充区域
Fill Area Tool 填充区域工具
Live Paint Bucket (Stroke) 实时上色工具 (描边)
Live Paint Info 实时上色信息
Live Paint Selection Tool 实时上色选择工具
@@ -4736,6 +4738,7 @@ imageTrace Outline 轮廓
@msg Live Paint: select paths or compound paths 实时上色:请选择路径或复合路径
@msg Live Paint: these paths are too degenerate to paint 实时上色:这些路径过于退化,无法上色
@msg Shape Builder: no region under the pointer 形状生成器:指针下方没有区域
@msg Fill Area: no enclosed area under the pointer 填充区域:指针下方没有封闭区域
@msg Shape Builder: select all paths you want to merge 形状生成器:请选择要合并的所有路径
@msg Shape Builder: select paths or compound paths 形状生成器:请选择路径或复合路径
@msg image data `{_1}` is missing 缺少图像数据 `{_1}`
@@ -6770,9 +6773,11 @@ lighting Light 光源
@msg `{GRAPHICS}` face must be front, back or side `{GRAPHICS}` 的 face 必须是 front、back 或 side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}` 的 {key} 必须是 {lo} 到 {hi} 之间的数字
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` 必须是数组
@msg Graphics map onto the Plane, Extrude and Revolve object types 图形映射到平面、突出和回转对象类型上
Graphics map onto the Plane, Extrude and Revolve object types. 图形映射到平面、突出和回转对象类型上。
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types 图形映射到平面、突出、回转和膨胀对象类型上
Graphics map onto the Plane, Extrude, Revolve and Inflate object types. 图形映射到平面、突出、回转和膨胀对象类型上。
@msg Revolve maps graphics onto its side: map them onto the front 回转将图形映射到其侧面:请将图形映射到正面
@msg Inflate maps graphics onto its front and back, not onto a side 膨胀将图形映射到正面和背面,不映射到侧面
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on 对象 {_1}:只有打开“双面”和“封口”后,膨胀的背面才能贴图
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments 图形对此表面过于复杂:请简化符号的图稿或减少分段数
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` 最多接受 {MAX_GRAPHICS} 个图形
@msg A plane has one face: map its graphics onto the front 平面只有一个面:请将其图形映射到正面
@@ -10640,6 +10645,15 @@ breakText Glyphs 字形
@msg A joint does not close by {gap} pt. 有一处接缝相差 {gap} pt 未闭合。
@msg Two panels pass through each other. 两个面板相互穿插。
@msg {w} × {h} pixels is too large for PSD (at most {MAX_SIDE} pixels a side): lower the resolution {w} × {h} 像素对 PSD 而言过大 (每边最多 {MAX_SIDE} 像素):请降低分辨率
Nature Icons 自然图标
Flower 花朵
Tree 树木
Mountain 山脉
Ornamental 装饰纹样
Scrollwork 卷饰
Filigree Arrow 花丝箭头
Petal Sweep 花瓣曲线
Twin Curl 双重卷饰
Vector Packs 矢量画笔包
Compass Rose 罗盘玫瑰
Botanical Sprig 植物枝条
Can't render this file because it is too large.
+16 -2
View File
@@ -2083,6 +2083,7 @@ file-filter Templates 範本
@msg Live Paint: select paths or compound paths 即時上色:請選取路徑或複合路徑
@msg Live Paint: these paths are too degenerate to paint 即時上色:這些路徑過度退化,無法上色
@msg Shape Builder: no region under the pointer 形狀建立:指標下方沒有區域
@msg Fill Area: no enclosed area under the pointer 填滿區域:指標下方沒有封閉區域
@msg Shape Builder: select all paths you want to merge 形狀建立:請選取要合併的所有路徑
@msg Shape Builder: select paths or compound paths 形狀建立:請選取路徑或複合路徑
@msg image data `{_1}` is missing 找不到影像資料 `{_1}`
@@ -3477,6 +3478,8 @@ liquify-list-end {0}, {1} {0}和{1}
List Workspaces 列出工作區
Live Paint 即時上色
Live Paint Bucket 即時上色油漆桶
Fill Area 填滿區域
Fill Area Tool 填滿區域工具
Live Paint Bucket (Stroke) 即時上色油漆桶 (筆畫)
Live Paint Info 即時上色資訊
Live Paint Selection Tool 即時上色選取工具
@@ -6619,9 +6622,11 @@ lighting Light 光源
@msg `{GRAPHICS}` face must be front, back or side `{GRAPHICS}` 的 face 必須是 front、back 或 side
@msg `{GRAPHICS}` {key} must be a number from {lo} to {hi} `{GRAPHICS}` 的 {key} 必須是介於 {lo} 到 {hi} 之間的數字
@msg `{GRAPHICS}` must be an array `{GRAPHICS}` 必須是陣列
@msg Graphics map onto the Plane, Extrude and Revolve object types 圖形會對應到「平面」、「突出」與「迴轉」物件類型
Graphics map onto the Plane, Extrude and Revolve object types. 圖形會對應到「平面」、「突出」與「迴轉」物件類型。
@msg Graphics map onto the Plane, Extrude, Revolve and Inflate object types 圖形會對應到「平面」、「突出」、「迴轉」與「膨脹」物件類型
Graphics map onto the Plane, Extrude, Revolve and Inflate object types. 圖形會對應到「平面」、「突出」、「迴轉」與「膨脹」物件類型。
@msg Revolve maps graphics onto its side: map them onto the front 迴轉會將圖形對應到其側面:請將圖形對應到正面
@msg Inflate maps graphics onto its front and back, not onto a side 膨脹會將圖形對應到正面和背面,不會對應到側面
@msg object {_1}: Inflate's back takes graphics with Both sides and Cap on 物件 {_1}:只有開啟「雙面」和「封口」後,膨脹的背面才能對應圖形
@msg The graphics are too complex for this surface: simplify the symbols' art or reduce Segments 圖形對此表面過於複雜:請簡化符號的圖稿或減少分段數
@msg `{GRAPHICS}` takes at most {MAX_GRAPHICS} graphics `{GRAPHICS}` 最多接受 {MAX_GRAPHICS} 個圖形
@msg A plane has one face: map its graphics onto the front 平面只有一個面:請將其圖形對應到正面
@@ -10456,6 +10461,15 @@ breakText Glyphs 字符
@msg A joint does not close by {gap} pt. 有一處接縫相差 {gap} pt 未閉合。
@msg Two panels pass through each other. 兩個面板相互穿插。
@msg {what} would print on more than {MAX_TILES} tiles: scale it down {what} 會列印在超過 {MAX_TILES} 個拼貼上:請縮小
Nature Icons 自然圖示
Flower 花朵
Tree 樹木
Mountain 山脈
Ornamental 裝飾紋樣
Scrollwork 卷飾
Filigree Arrow 花絲箭頭
Petal Sweep 花瓣曲線
Twin Curl 雙重卷飾
Vector Packs 向量筆刷包
Compass Rose 羅盤玫瑰
Botanical Sprig 植物枝條
Can't render this file because it is too large.
+1
View File
@@ -85,6 +85,7 @@ pub static ICONS: &[(&str, &[u8])] = &[
("dc-draw-inside", include_bytes!("../../../assets/icons/dc-draw-inside.svg")),
("dc-draw-normal", include_bytes!("../../../assets/icons/dc-draw-normal.svg")),
("dc-ellipse", include_bytes!("../../../assets/icons/dc-ellipse.svg")),
("dc-fill-area", include_bytes!("../../../assets/icons/dc-fill-area.svg")),
("dc-fill-none", include_bytes!("../../../assets/icons/dc-fill-none.svg")),
("dc-filter", include_bytes!("../../../assets/icons/dc-filter.svg")),
("dc-flare", include_bytes!("../../../assets/icons/dc-flare.svg")),
+1
View File
@@ -81,6 +81,7 @@ pub fn tool_icon(name: &str) -> &'static str {
"tool-puppet" => "dc-puppet",
"tool-shape-builder" => "dc-shape-builder",
"tool-bucket" => "dc-live-bucket",
"tool-fill-area" => "dc-fill-area",
"tool-live-select" => "dc-live-select",
"tool-perspective" => "dc-perspective",
"tool-perspective-select" => "dc-perspective",
+1 -1
View File
@@ -1176,7 +1176,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
"tool.options",
"Tool Options…",
"",
"{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's To Line truncated
"{tool: id} what double-clicking a tool button opens: hand → fits the artboard in the window (view.fitArtboard), zoom → 100% (view.actualSize), rotate|scale|reflect|shear → that Object › Transform dialog (dialog `rotate`, `scale`, `reflect` or `shear`; error `nothing selected` without a selection), selection|directSelection|groupSelection → the Move dialog (dialog `move`; the same error), gradient|magicWand → the Gradient or Magic Wand panel (window.panel), artboard → Artboard Options of the active artboard (dialog `artboardOptions`, fields index, name, x, y, width, height, showCenterMark, showCrossHairs; OK runs artboard.setProps, and with other artboards selected with the Artboard tool a new width or height goes to each of them too, in its `artboards` list, each resized about the reference point the form used for that size, or about its top-left corner when the size was set in the fields directly), flare → Flare Tool Options (dialog `flareOptions`, fields diameter and pathLength (pt), opacity, brightness, growth, fuzziness, longest, rayFuzziness, largest (%), rays, rings, direction (°), raysOn, ringsOn; OK runs tool.setOption {tool: \"flare\", values}: the next flare dragged out uses them, and a Flare click's dialog, which also has x, y and preview (on initially), previews one there and accepts it as one Undo step; Cancel rolls back the preview; with flares selected, the fields show the first one's settings, `flares` lists them and OK runs shape.editFlare with the settings changed instead, leaving the tool's options), lineSegment|arc|rectangularGrid|polarGrid → that tool's Tool Options, its click dialog without x and y (dialog kind = the tool id, `__toolOptions: true`; lineSegment: length (pt), angle (°), fillLine; arc: lengthX, lengthY (pt), reference (0–8), arcType: open|closed, baseAlong: x|y, slope (−100…100), fillArc; rectangularGrid: width, height (pt, the Default Size), reference (0–8), rows, columns, rowSkew, columnSkew (%), frame, fill; polarGrid: the same with concentric, radial, concentricSkew, radialSkew and compound for rows, columns, the skews and frame; OK runs tool.setOption {tool, values} and draws nothing: the next drag uses them (Fill Line, the arc's type, base, slope and fill, the grids' dividers, skews and switches) and a click's dialog opens at them), circle → Circle Tool Options (dialog `circleOptions`, fields center, radii, diameter (all on), color (red|blue|magenta|green|black|gray; blue), standardAnchors (on) and dragThird (on); OK runs tool.setOption {tool: \"circle\", values}), columnGraph|stackedColumnGraph|barGraph|stackedBarGraph|lineGraph|areaGraph|scatterGraph|pieGraph|radarGraph → Graph Type for the selected graph, or for the series picked in it with Group Selection (dialog `graphType`, fields the options graph.setType {} returns under their names, with legend, pieLegend, piePosition, pieSort, firstRowInFront, firstColumnInFront, filledLines and lineWidth held for every type; overrideValues and rightOverrideValues, Override Calculated Values of the left or only value axis and of the right one: while one is on OK sends axisMin, axisMax and ticks, or rightAxisMin, rightAxisMax and rightTicks, filled with the calculated values where the graph has none, and one turned off sends null, null and 0; __page: options|valueAxis|rightAxis|categoryAxis, the page shown, options when the type picked has no such page; OK runs graph.setType, and with nothing changed closes without a step of history; an overridden value axis whose maximum is not more than its minimum is an error and the dialog stays open; an error without a selected graph), typeOnPath|verticalTypeOnPath → Type on a Path Options for the selected type on a path (dialog `command` running type.pathOptions; error `nothing selected` without a selection, and the command's error when no type on a path is selected),symbolSprayer|symbolShifter|symbolScruncher|symbolSizer|symbolSpinner|symbolStainer|symbolScreener|symbolStyler → Symbolism Tools Options (dialog `symbolismOptions`, fields tool (the tool whose options show; the Tool row changes it), diameter (pt), intensity and density (1–10), usePressure, method: userDefined|average|random (not used by the Sprayer and the Shifter), showBrush, sprayScrunch, spraySize, spraySpin, sprayScreen, sprayStain and sprayStyle: average|userDefined (the Symbol Sprayer's), proportional and affectsDensity (the Symbol Sizer's), shared by the eight tools; OK runs tool.setOption {tool, values}, after symbol.setDensity from the density the dialog opened with to the new one when symbol sets are selected and it changed), blend → Blend Options, perspectiveGrid → Perspective Grid Options, eyedropper → Eyedropper Options (dialog `eyedropperOptions`, fields sampleSize, pickUp, apply; OK runs eyedropper.setOptions), printTiling → resets the print tiling (print.tiling.set {reset: true}), warp|twirl|pucker|bloat|scallop|crystallize|wrinkle → that tool's To Line truncated
),
(
"ui.colorGuideOptions",
+27 -6
View File
@@ -926,8 +926,28 @@ fn shows_targeted(view: &View, n: &Node, is_sel: bool) -> bool {
}
}
/// The target circle of `n`'s row at `c`: a ring, doubled while `n` is targeted, filled when `n`
/// has an appearance or transparency of its own. Its response is clicked to target `n`; dragging
/// The radius of the inner ring of a targeted item's target circle (the double ring); the outer
/// ring's radius is 5.
pub(super) const TARGET_RING: f32 = 2.8;
/// The width of the inner ring.
pub(super) const TARGET_STROKE: f32 = 1.0;
/// The radius of the dot filling the circle of an item that has an appearance of its own and is
/// not targeted.
pub(super) const TARGET_DOT: f32 = 3.2;
/// The radius of that dot inside a targeted item's inner ring: clear of the ring, so a targeted
/// item with an appearance of its own shows both (#8711).
pub(super) const TARGET_DOT_IN_RING: f32 = 1.5;
/// The marks inside a target circle's outer ring: the inner ring's radius when the item is
/// `targeted`, and the appearance dot's radius when it is `styled` (has an appearance of its own).
/// Each of the four combinations looks different, as the Layers panel's target icons do.
pub(super) fn target_marks(targeted: bool, styled: bool) -> (Option<f32>, Option<f32>) {
let dot = if targeted { TARGET_DOT_IN_RING } else { TARGET_DOT };
(targeted.then_some(TARGET_RING), styled.then_some(dot))
}
/// The target circle of `n`'s row at `c`: a ring, doubled while `n` is targeted, with a dot when
/// `n` has an appearance or transparency of its own ([`target_marks`]). Its response is clicked to target `n`; dragging
/// it carries `n`'s appearance ([`PanelDrag::Appearance`]) onto another row's circle (Alt
/// copies it) or the trash.
fn target_circle(ui: &mut Ui, n: &Node, c: egui::Pos2, h: f32, targeted: bool, actions: &mut Vec<(String, Value)>, t: &Tokens) -> egui::Response {
@@ -946,11 +966,12 @@ fn target_circle(ui: &mut Ui, n: &Node, c: egui::Pos2, h: f32, targeted: bool, a
}
let ring = if held { t.accent } else { t.icon };
ui.painter().circle_stroke(c, 5.0, Stroke::new(if held { 1.5 } else { 1.0 }, ring));
if targeted {
ui.painter().circle_stroke(c, 2.8, Stroke::new(1.0, t.icon));
let (inner, dot) = target_marks(targeted, has_styled_target(n));
if let Some(r) = inner {
ui.painter().circle_stroke(c, r, Stroke::new(TARGET_STROKE, t.icon));
}
if has_styled_target(n) {
ui.painter().circle_filled(c, 3.2, t.icon);
if let Some(r) = dot {
ui.painter().circle_filled(c, r, t.icon);
}
if resp.dragged_by(egui::PointerButton::Primary) {
ui.ctx().set_cursor_icon(egui::CursorIcon::Grabbing);
+58 -2
View File
@@ -7,7 +7,8 @@ use super::*;
fn filled_targets(app: &mut VectorcraftApp, ctx: &egui::Context) -> usize {
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| show(app, ui));
out.textures_delta.clear();
out.shapes.iter().filter(|c| matches!(&c.shape, egui::Shape::Circle(cs) if cs.radius == 3.2 && cs.fill != Color32::TRANSPARENT)).count()
let dot = |r: f32| r == rows::TARGET_DOT || r == rows::TARGET_DOT_IN_RING;
out.shapes.iter().filter(|c| matches!(&c.shape, egui::Shape::Circle(cs) if dot(cs.radius) && cs.fill != Color32::TRANSPARENT)).count()
}
/// A generated `<Kind>` name is translated where painted; an unnamed text object's text never
@@ -417,12 +418,67 @@ fn targeted_rows(app: &mut VectorcraftApp, ctx: &egui::Context) -> Vec<usize> {
let rings: Vec<egui::Pos2> = out
.shapes
.iter()
.filter(|c| matches!(&c.shape, egui::Shape::Circle(cs) if cs.radius == 2.8))
.filter(|c| matches!(&c.shape, egui::Shape::Circle(cs) if cs.radius == rows::TARGET_RING))
.map(|c| c.shape.visual_bounding_rect().center())
.collect();
circles.iter().enumerate().filter(|(_, c)| rings.iter().any(|r| r.distance(**c) < 0.5)).map(|(i, _)| i).collect()
}
/// The marks one headless frame paints inside the outer ring of each target circle, top row
/// first: per circle, its (radius, fill, stroke width) circles, sorted by radius.
fn target_marks_painted(app: &mut VectorcraftApp, ctx: &egui::Context) -> Vec<Vec<(f32, bool, f32)>> {
let (circles, _) = frame(app, ctx, vec![], false);
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| show(app, ui));
out.textures_delta.clear();
circles
.iter()
.map(|c| {
let mut marks: Vec<(f32, bool, f32)> = out
.shapes
.iter()
.filter_map(|s| match &s.shape {
egui::Shape::Circle(cs) if cs.radius < 5.0 && cs.center.distance(*c) < 0.01 => {
Some((cs.radius, cs.fill != Color32::TRANSPARENT, cs.stroke.width))
}
_ => None,
})
.collect();
marks.sort_by(|a, b| a.0.total_cmp(&b.0));
marks
})
.collect()
}
/// A targeted item with an appearance of its own keeps its inner ring in view: the appearance
/// dot sits inside the ring with a gap, so the four looks (neither, targeted, with an appearance,
/// both) differ, as the target icons the Appearance attributes help describes do (#8711).
#[test]
fn a_targeted_circle_with_an_appearance_shows_both_ring_and_dot() {
let (mut app, _layer, [a, b]) = two_rects();
app.session.execute("transparency.set", &json!({"ids": [a.0], "opacity": 30})).unwrap();
let ctx = egui::Context::default();
// Rows top down: the layer, b, a.
let marks = target_marks_painted(&mut app, &ctx);
assert_eq!(marks.len(), 3);
let (neither, styled) = (marks[1].clone(), marks[2].clone());
app.session.execute("layer.target", &json!({"id": b.0})).unwrap();
let targeted = target_marks_painted(&mut app, &ctx)[1].clone();
app.session.execute("layer.target", &json!({"id": a.0})).unwrap();
let both = target_marks_painted(&mut app, &ctx)[2].clone();
// The inner ring is painted, and nothing filled reaches its inner edge.
let ring = both.iter().find(|m| m.0 == rows::TARGET_RING && !m.1).expect("the inner ring");
let inner_edge = ring.0 - ring.2 / 2.0;
let dot = both.iter().find(|m| m.1).expect("the appearance dot");
assert!(dot.0 + dot.2 / 2.0 < inner_edge - 0.5, "the dot {dot:?} covers the ring {ring:?}");
let looks = [&neither, &targeted, &styled, &both];
for (i, x) in looks.iter().enumerate() {
for y in &looks[i + 1..] {
assert_ne!(x, y, "two states look the same: {looks:?}");
}
}
assert_eq!(neither, vec![]);
}
/// A layer added to the selection from its target circle shows as targeted, as an object added
/// the same way does (#8646): with nothing targeted, a layer's circle shows its inner ring while
/// all of its visible, unlocked art is selected, and not while only part of it is.
@@ -200,6 +200,7 @@ fn the_window_menu_and_the_brushes_panel_open_brush_libraries() {
json!("paint"),
json!("pattern-borders"),
json!("decorative"),
json!("ornamental"),
json!("scatter-shapes"),
json!("stipple"),
json!("game-trails"),
@@ -257,6 +258,17 @@ fn the_window_menu_and_the_brushes_panel_open_brush_libraries() {
click(&mut app, &ctx, "Compass Rose", Modifiers::NONE, 4.0);
assert!(has(&app, "Compass Rose") && !has(&app, "Facet Diamond"));
assert_eq!(undo_len(&app), undo + 1);
let r = app.run("window.brushLibrary", json!({"library": "Ornamental"})).unwrap();
assert_eq!((r["open"].as_str(), r["count"].as_u64()), (Some("ornamental"), Some(4)));
let path = app.run("shape.line", json!({"x1": 10, "y1": 100, "x2": 180, "y2": 100})).unwrap()["id"].as_u64().unwrap();
let undo = undo_len(&app);
click(&mut app, &ctx, "Scrollwork", Modifiers::NONE, 5.0);
assert!(has(&app, "Scrollwork") && !has(&app, "Twin Curl"));
assert_eq!(undo_len(&app), undo + 1);
assert_eq!(
app.session.doc().unwrap().doc.node(vectorcraft_doc::NodeId(path)).unwrap().appearance.stroke().unwrap().brush.as_deref(),
Some("Scrollwork")
);
// Without brushes there is nothing to save.
let all: Vec<String> = vectorcraft_brush::library(&app.session.doc().unwrap().doc).into_iter().map(|b| b.name).collect();
app.run("brush.delete", json!({ "names": all })).unwrap();
@@ -153,6 +153,7 @@ fn the_window_menu_and_the_symbols_panel_open_symbol_libraries() {
json!("inventory-icons"),
json!("skill-icons"),
json!("weather-icons"),
json!("nature-icons"),
json!("media-controls"),
]
);
+37 -2
View File
@@ -645,12 +645,16 @@ fn the_materials_tab_lists_the_graphics_and_maps_one_in_one_undo_step() {
let nodes = controls(&mut app, &ctx);
named(&nodes, "Remove Graphic");
named(&nodes, "Scale");
// Inflate takes no graphics.
// Inflate keeps the graphic and lists it with its face and settings.
set_type(&mut app, "inflate").unwrap();
assert_eq!(graphics(&app).as_array().map(Vec::len), Some(1));
let nodes = controls(&mut app, &ctx);
named(&nodes, "Remove Graphic");
named(&nodes, "Scale");
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| show(&mut app, ui));
out.textures_delta.clear();
let text = crate::tests_labels::shapes_text(&out);
assert!(text.contains("Graphics map onto the Plane, Extrude and Revolve object types"), "{text}");
assert!(text.contains("Face") && !text.contains("Graphics map onto"), "{text}");
}
#[test]
@@ -742,6 +746,8 @@ fn a_graphics_handle_drags_it_over_its_face_in_one_undo_step() {
let n = std::sync::Arc::make_mut(&mut st.doc).node_mut(id).unwrap();
n.appearance.effects[0].visible = false;
n.appearance.effects.push(vectorcraft_effects::new_effect("threeD.extrude", &json!({})).unwrap());
// An edit moves the revision, as a command's does.
st.revision += 1;
}
let mut shown = true;
ctx.run_ui(egui::RawInput::default(), |ui| {
@@ -757,6 +763,35 @@ fn a_graphics_handle_drags_it_over_its_face_in_one_undo_step() {
assert!(!frame(&mut app, vec![button(target, true)]));
}
/// The frame the graphics' handles are placed on is built once for each revision of the document,
/// and not at all for an object without graphics.
#[test]
fn the_graphics_frame_is_built_once_for_each_revision() {
type Cached = (super::FrameKey, Option<std::sync::Arc<vectorcraft_effects::GraphicFrame>>);
let (mut app, ctx) = materials_app();
let cached = |ctx: &egui::Context| ctx.data(|m| m.get_temp::<Cached>(super::frame_cache_id())).and_then(|(_, frame)| frame);
let handles = |app: &VectorcraftApp| {
let mut shown = false;
ctx.run_ui(egui::RawInput::default(), |ui| {
crate::panels::set_pstate(ui.ctx(), super::DRAWN, Some(super::root_pass(ui.ctx())));
shown = super::graphic_handles(app, ui.ctx()).is_some();
})
.textures_delta
.clear();
shown
};
assert!(!handles(&app));
assert!(cached(&ctx).is_none(), "no graphics, no frame");
app.run("threeD.mapGraphic", json!({"symbol": "Graphic"})).unwrap();
assert!(handles(&app));
let first = cached(&ctx).unwrap();
assert!(handles(&app));
assert!(std::sync::Arc::ptr_eq(&first, &cached(&ctx).unwrap()), "the same revision reuses the frame");
app.run("threeD.mapGraphic", json!({"symbol": "Graphic"})).unwrap();
assert!(handles(&app));
assert!(!std::sync::Arc::ptr_eq(&first, &cached(&ctx).unwrap()), "an edit builds it again");
}
/// One frame of the artboard's graphic handles over an 800 × 600 canvas with `events`: whether the
/// handles took the pointer.
fn handles_frame(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec<egui::Event>) -> bool {
+28 -3
View File
@@ -8,6 +8,8 @@
//! adds the selected objects that have a 3D effect to Asset Export as 3D assets (`assets.add3D`)
//! and shows that panel with their assets selected.
use std::sync::Arc;
use egui::Ui;
use serde_json::{Map, Value, json};
use vectorcraft_doc::{Effect, Node, NodeId, NodeKind};
@@ -425,7 +427,7 @@ fn materials_open(ctx: &egui::Context) -> bool {
/// What [`graphic_handles`] gives: the object's frame, its graphics, and each seen graphic's index
/// and page point.
type Handles = (vectorcraft_effects::GraphicFrame, Vec<vectorcraft_effects::MappedGraphic>, Vec<(usize, vectorcraft_geom::Point)>);
type Handles = (Arc<vectorcraft_effects::GraphicFrame>, Vec<vectorcraft_effects::MappedGraphic>, Vec<(usize, vectorcraft_geom::Point)>);
/// The handles of the graphics mapped onto the first selected object, while the Materials tab is
/// open: each graphic's index, its face and where its center lands on the page, for the graphics
@@ -443,8 +445,6 @@ fn graphic_handles(app: &VectorcraftApp, ctx: &egui::Context) -> Option<Handles>
if t.item.is_some_and(|k| n.appearance.items.get(k).is_none_or(|it| !it.visible())) {
return None;
}
// The frame of the effect whose graphics are listed: none while that effect is hidden.
let frame = vectorcraft_effects::graphic_frame_at(Some(&st.doc), n, t.item, t.index)?;
// A geometry effect after the 3D effect of any selected object moves or bends its drawn
// graphics away from their places in the frame: no handles, so a drag does not put a graphic
// away from the pointer.
@@ -453,15 +453,40 @@ fn graphic_handles(app: &VectorcraftApp, ctx: &egui::Context) -> Option<Handles>
return None;
}
let list = vectorcraft_effects::mapped_graphics(&vectorcraft_effects::merged_params(&t.effect, &t.params));
// Without graphics there are no handles, and no frame is built.
if list.is_empty() {
return None;
}
// Selected objects with different graphics show no handles: a drag sends the whole list.
let graphics_of = |t: Target| vectorcraft_effects::mapped_graphics(&vectorcraft_effects::merged_params(&t.effect, &t.params));
if st.selection.objects.iter().skip(1).filter_map(|id| find(st.doc.node(*id)?)).any(|o| graphics_of(o) != list) {
return None;
}
// The frame of the effect whose graphics are listed: none while that effect is hidden. It is
// built once for each revision of the document, not on every frame the panel draws.
let key: FrameKey = (st.uid, st.revision, n.id.0, t.item, t.index);
let cached = ctx.data(|m| m.get_temp::<(FrameKey, Option<Arc<vectorcraft_effects::GraphicFrame>>)>(frame_cache_id()));
let frame = match cached {
Some((k, frame)) if k == key => frame,
_ => {
let frame = vectorcraft_effects::graphic_frame_at(Some(&st.doc), n, t.item, t.index).map(Arc::new);
ctx.data_mut(|m| m.insert_temp(frame_cache_id(), (key, frame.clone())));
frame
}
}?;
let handles = list.iter().enumerate().filter_map(|(i, g)| frame.handle(g).filter(|(_, seen)| *seen).map(|(p, _)| (i, p))).collect();
Some((frame, list, handles))
}
/// What the cached frame of [`graphic_handles`] was built for: the document's uid and revision, the
/// object's id, and the fill or stroke and index of its 3D effect.
type FrameKey = (u64, u64, u64, Option<usize>, usize);
/// Temp-memory key of the frame [`graphic_handles`] last built.
fn frame_cache_id() -> egui::Id {
egui::Id::unique("three-d-graphic-frame")
}
/// Temp-memory key of a drag of a graphic's handle on the artboard.
fn handle_drag_id() -> egui::Id {
egui::Id::unique("three-d-graphic-handle-drag")
+3 -2
View File
@@ -58,7 +58,7 @@ pub const BASIC: &[(&str, &[&[&str]])] = &[
&[
&["width", "warp", "twirl", "pucker", "bloat", "scallop", "crystallize", "wrinkle"],
&["rotate", "reflect", "scale", "shear", "reshape", "freeTransform", "puppetWarp"],
&["shapeBuilder", "livePaintBucket", "livePaintSelection", "blend"],
&["shapeBuilder", "livePaintBucket", "fillArea", "livePaintSelection", "blend"],
&["dimension"],
],
),
@@ -469,7 +469,8 @@ pub fn open_options(app: &mut VectorcraftApp, tool: &str) -> Result<serde_json::
crate::dialogs::perspective_options::open(app);
Ok(json!({ "dialog": crate::dialogs::perspective_options::KIND }))
}
"shapeBuilder" => Ok(crate::dialogs::shape_builder_options::open(app)),
// Fill Area uses the Shape Builder's Gap Detection and open-filled-path options.
"shapeBuilder" | "fillArea" => Ok(crate::dialogs::shape_builder_options::open(app)),
// The Objects on Path tool: the Pivot and Rotate of the objects it attaches next.
"objectsOnPath" => Ok(crate::dialogs::objects_on_path_options::open(app)),
// The Line Segment, Arc and grid tools: their Tool Options, the options of their next
+9
View File
@@ -764,6 +764,15 @@ fn menu_access_stationary_pointer_repeat_and_rerun_do_not_retarget_or_double_inv
assert_eq!(s.app.ui.view.rulers, !before, "one Text/Key pair invokes exactly once across passes");
s.end_access();
// Wait for any background font scan and ensure > 20 families even on minimal runners.
let db = vectorcraft_text::FontDb::global();
let _ = db.families();
for i in 0..24 {
if db.menu_family_list_now().len() > 20 {
break;
}
db.add_font(vectorcraft_testkit::fonts::renamed(&format!("Menu Test Font {i:02}")));
}
let text = s.app.run("text.create", json!({"x": 250, "y": 200, "text": "Menu", "font": "Inter", "size": 12})).unwrap()["id"].clone();
s.app.run("select.set", json!({"ids": [text]})).unwrap();
let size = vec2(640.0, 420.0);
+2 -1
View File
@@ -713,7 +713,8 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi
Libraries Menu open each library in a library panel of its own (seven original libraries generated in code,
Basic Shapes, UI Frames with default 9-slice guides on Panel, Button and Bar, Map Markers with Pin,
Flag, Crosshair and Checkpoint, Inventory Icons with Sword, Shield, Potion, Key and Gem, Skill Icons with
Attack, Defend, Heal, Buff and Ult, Weather Icons with Sun, Moon, Cloud, Rain, Thunder and Snow, and Media Controls with
Attack, Defend, Heal, Buff and Ult, Weather Icons with Sun, Moon, Cloud, Rain, Thunder and Snow, Nature Icons with Leaf, Flower, Tree,
Mountain and Wave, and Media Controls with
Play, Pause, Stop, Skip Next, Shuffle and Repeat; User Defined; Other
Library… reads the symbols of any document VectorCraft opens); a click
adds a symbol to the document's Symbols with its Symbol Options and the resources it uses, as one undo
+42 -9
View File
@@ -2388,7 +2388,7 @@ and `type.fractionalWidths`; `flip` in `type.dynamicTextPreset`; `remove` and `o
`swatch.addUsedColors`; `visible` in `appearance.setItem`; `copy` in `appearance.transfer`; `reverse` and `append` in
`appearance.copyFrom`; `reverse` and `stroke` in `paint.editGradient`; `stroke` in `paint.setGradientGeom` and in
`paint.freeform.addPoint`, `setPoint`, `deletePoint`, `addLine`, `splitLine` and `get`; `erase`,
`openFilledAsClosed` and `splitStroke` in `shapeBuilder.merge`; `openFilledAsClosed` in `shapeBuilder.regions`; `closeGaps` in `livePaint.gapOptions`; and
`openFilledAsClosed` and `splitStroke` in `shapeBuilder.merge`; `openFilledAsClosed` in `shapeBuilder.regions` and `shapeBuilder.copyRegion`; `closeGaps` in `livePaint.gapOptions`; and
`enhanced` in `imageTrace.make` and `imageTrace.makeAndExpand`. A null is read as a key left out.
These commands refuse a string or another value that is not a number with `` `radius` must be a number, not "2" ``,
@@ -2409,7 +2409,7 @@ and `fitMinPercent` in `text.areaOptions`; `x` and `y` in `symbol.place`; `radiu
`symbol.spray`; `radius` and `intensity` in `symbol.adjust`; `to` in `swatch.move`; `weight` and `opacity` in
`appearance.setItem`; `r`, `g`, `b`, `c`, `m`, `y`, `k`, `gray` and `tint` in `edit.colors.adjustBalance`; `steps`
and `amount` in `color.harmony`; `angle` in `paint.editGradient` and in the `gradient` of a command that takes a paint; `t` in
`paint.freeform.splitLine`; `tolerance` and `gap` in `shapeBuilder.merge`; `gap` in `shapeBuilder.regions`; and
`paint.freeform.splitLine`; `tolerance` and `gap` in `shapeBuilder.merge`; `gap` in `shapeBuilder.regions` and `shapeBuilder.copyRegion`; and
`width` and `tolerance` in `livePaint.strokeEdge`. A null is read as a key left out. A gradient stop that names a
swatch refuses a `tint` that is not a number with `` stop 0: `tint` must be a number ``.
@@ -5167,7 +5167,8 @@ joins the edges, so with such an effect its paths can differ from the drawn ones
draw the edges, and `effect.expandAppearance` keeps them as paths. Past 1,000,000 edges the source path is drawn, as
it is for a solid past its limits. A `render` that is not an object, a key other than `mode`, another mode, and
`render` on Extrude & Bevel (Classic), Revolve (Classic) or Rotate (Classic) are refused before the document
changes. See [three-d.md](three-d.md#3d-and-materials-panel).
changes. In wireframe mode the graphics' art is not checked against the graphics limits, so art too complex for the
shaded surface does not refuse the wireframe. See [three-d.md](three-d.md#3d-and-materials-panel).
```json
{"name":"run_command","arguments":{"command":"effect.setParams","params":{"index":0,"item":null,"params":{"render":{"mode":"wireframe"}}}}}
@@ -5200,19 +5201,22 @@ offset in points of the graphic's center from the center of the object's bounds
percentage of the symbol's size (1..10000; omitted, 100 or less so the graphic fits inside the object) and
`rotation` is in degrees counterclockwise (-360..360). Without `index` each object's first 3D effect takes it, and `item` is refused.
Every object's 3D effect must be Extrude & Bevel (front only at a depth of 0; `front` and `back` need Cap on, and
`side`, its walls and bevels, does not), Rotate (the Plane type, front only) or Revolve (front only: its swept
side), and `symbol` must name a document symbol; otherwise the command is refused and nothing changes. It returns `{ids, graphic}`.
`side`, its walls and bevels, does not), Rotate (the Plane type, front only), Revolve (front only: its swept
side) or Inflate (`front` or `back`, and `back` only with Both sides and Cap on), and `symbol` must name a document symbol; otherwise the command is refused and nothing changes. It returns `{ids, graphic}`.
On Revolve and on Extrude & Bevel's side, `x` and `y` are measured on the side unrolled flat from its middle (on
Extrude & Bevel, `x` along the outline, clockwise from its top, and `y` from the front toward the back), and a
graphic that does not fit starts scaled to fit the part of Extrude & Bevel's side unrolled about `x` = 0 that does
not reach its cut, or the half of Revolve's side seen from the front ([three-d.md](three-d.md#graphics)).
On Inflate, `x` and `y` are measured in the art's plane, and the graphic is carried straight out onto the puffed
face, Twist and Taper turning and shrinking the back's with it.
The graphics are the `graphics` parameter of `threeD.extrude`, `threeD.rotate` and `threeD.revolve`, which `effect.setParams` also
The graphics are the `graphics` parameter of `threeD.extrude`, `threeD.rotate`, `threeD.revolve` and `threeD.inflate`, which `effect.setParams` also
edits: an array of up to 64 `{symbol, face, x, y, scale, rotation}` objects, drawn on the face turned,
foreshortened and shaded with it and clipped to it ([Map artworks on 3D object](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/map-artwork-on-3d-objects.html)).
Revolve takes graphics on its swept side and shades them with the object's light ([the archived reference, page 185](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=185));
how a graphic wraps around the side is VectorCraft's own rule. Extrude & Bevel takes graphics on its side, its
walls and bevels unrolled as one surface; how they are unrolled is VectorCraft's own rule.
how a graphic wraps around the side, and how one follows Inflate's puff, are VectorCraft's own rules. Extrude &
Bevel takes graphics on its side, its walls and bevels unrolled as one surface; how they are unrolled is
VectorCraft's own rule.
A graphic naming a symbol the document does not have is refused, unless the effect already holds a graphic of it.
The drawing rules are VectorCraft's own; see [three-d.md](three-d.md#graphics).
@@ -5871,7 +5875,7 @@ left out.
## Symbol libraries
Symbol libraries are read-only sets of symbols: seven generated in code (Basic Shapes, UI Frames, Map Markers,
Inventory Icons, Skill Icons, Weather Icons, Media Controls), the `.vectorcraft` files in
Inventory Icons, Skill Icons, Weather Icons, Nature Icons with Leaf, Flower, Tree, Mountain and Wave, Media Controls), the `.vectorcraft` files in
the user library folder of the desktop app (User Defined) and the symbols of any document loaded with
`symbol.loadLibrary`. `symbol.libraries` lists them (`id`, `name`, `category`: `builtIn`, `user` or `loaded`, `count`)
and `symbol.library {library}` returns one's symbols (`name`, `size`, `registration`, `exportType`; `library` is an
@@ -13561,6 +13565,35 @@ a stroke when it has `rect`. With both `rect` and `points`, the command also tou
{"name":"run_command","arguments":{"command":"shapeBuilder.merge","params":{"rect":[50,50,200,200]}}}
```
The Fill Area tool (`fillArea`, in the Live Paint Bucket's group) adds a new closed path of the area under a click
and leaves the paths around it as they are. Nothing needs to be selected: the visible, unlocked paths on every layer
bound areas, filled or not, open paths included, and the overlap of two filled shapes is an area of its own. While the
pointer hovers an area, the tool outlines it in red and the pointer shows the bucket with paint; elsewhere the pointer
shows the empty bucket, and a click there does nothing. The new path appears on the press and is kept on the release;
Escape or a canceled touch before the release takes it back. In a document of more than 128 path segments the tool looks
for the hovered area on another thread, and the outline appears when that search is done. The tool sends `shapeBuilder.copyRegion` with `point`, the Shape Builder's gap
length (`gap`, 0 with Gap Detection off) and its `openFilledAsClosed`: the two tools share `gapDetection`, `gapLength`
and `openFilledAsClosed`, so `tool.setOption` on either one sets them for both, and `fillArea` has no other options.
Double-clicking the Fill Area tool opens the Shape Builder Tool Options (`tool.options {tool: "fillArea"}`, dialog
`shapeBuilderOptions`).
The new path takes the current fill, stroke and stroke weight (`fill` and `stroke` override the paints), goes directly
above the front-most object along the area (one whose outline touches the area's outline, or that covers it) and is
selected. When a group, Live Paint group, Shaper group or clipping group holds that object, the new path goes above the
outermost group in its layer, not inside it, and the group keeps its members. In isolation mode only the paths in
the isolated layer or group bound areas, for the tool's hover and click and for the command (with `ids`, only the
paths of the listed objects that are in it), and the new path goes inside the isolated layer or group, directly above
the object in it that holds that path. No area is found while the isolated object is not a layer or group (a path
or compound path), is a Live Paint group, compound shape, Shaper group, graph, Image Trace result, dimension, flare or
Objects on Path group, is a layer or group with a live effect or a clipping mask, or lies inside one of these or
inside an envelope. A point in no enclosed area is the error "Fill Area: no enclosed area under the pointer" and records no undo
step; a `gap` outside 0 to 72 is an error. It returns `{id, above}`. The command looks for the area among the paths
near the point first. When the paths together have more than 65,536 segments and the paths near the point do not
enclose it, the point counts as in no enclosed area.
```json
{"name":"run_command","arguments":{"command":"shapeBuilder.copyRegion","params":{"point":[50,70],"gap":3}}}
```
## Perspective grid
The grid is document data (`perspective.grid.set` edits the model directly). `perspective.grid.get` reads it:
+3 -2
View File
@@ -1,6 +1,6 @@
# Roadmap: milestones and what's next
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (M11: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: M5: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame (an edit that changes more than half of the frame, or a change of more than the view and the document, still renders it whole at once), and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); M11: a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: M4: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: M4: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, #8200; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: M4: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, #8128; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: M1: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; M1: an Alt-drag in the Layers panel copies a row above or below its own place, #8237; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regresLine truncated
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (M1: Layers: a targeted item with an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the target circle's four looks differ, #8711; scores and estimates unchanged; previously: M11: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: M5: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame (an edit that changes more than half of the frame, or a change of more than the view and the document, still renders it whole at once), and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); M11: a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: M4: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: M4: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, #8200; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: M4: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, #8128; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: M1: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; M1: an Alt-drag in the Layers panel copies a row above or below its own place, #8237; scores and estimates unchanged; previously: PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked, #8300; PDF import: translucent type filled and stroked comes in as a filled type object and a stroked one, as the file composites them, and an upright glyph is never kept as the outline of its glyph alone, #8015; PDF import: type filled and stroked by one text-showing operator comes in as one type object, filled and stroked, not a stroked copy over a filled one, #8015; M1: Layers panel Alt-drag shows the copy cursor, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip shows the white arrow with a Line truncated
>
> Oversized artboard import update (2026-11-12): Explicit editing-data import retains a single artboard beyond a capped 14,400 pt PDF page (#6865).
>
@@ -178,7 +178,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule
| # | Milestone | Status | Est. remaining, one agent (h) |
|---|---|---|---|
| M0 | Skeleton + vertical slice | ✅ done | — |
| M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (path and compound-path interior selection follows enabled fill rows (#6625); a marquee leaves locked or hidden guide paths out inside groups, as clicks do (#8538); hidden-fill and no-fill stroke cap/join CPU regressions passed; document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 |
| M1 | Selection, transform, layers, MCP (common command tools, strict keys, session resources and version-aware result hints) | ✅ mostly done (a targeted Layers item with an appearance of its own shows its inner ring around a smaller appearance dot (#8711); path and compound-path interior selection follows enabled fill rows (#6625); a marquee leaves locked or hidden guide paths out inside groups, as clicks do (#8538); hidden-fill and no-fill stroke cap/join CPU regressions passed; document-tab artwork drag with lossless resource transfer and one target Undo; malformed MCP app replies discard the connection without replay, #1761; bounded control socket waits and connection-slot recovery, #1726; bounded synthetic control input, #1709; no-op anchor Align keeps Undo, Redo and saved state (#1180 follow-up); transform reference point snaps to anchors/centres; rotated objects keep a rotated bounding box and their angle; Free Transform, Scale and Reflect along a rotated box pending; the Transform fields take one Tab each, the W/H link after them) | 4–6 |
| M2 | Drawing tools + smart guides | ✅ mostly done (Eraser preserves fill outside fixed and varied tip sweeps and Alt-drag marquees on fill-only open paths and keeps their compound holes; clipping masks retain surviving contours or empty geometry in the same node; ordinary Group/Layer paints and evaluated gradient placements are preserved when the stored paint reproduces their appearance; hidden Rasterize and Along/Across stroke rows do not block visible gradients; replacement-art effects, plug-ins/Rasterize, along/across-stroke gradients and placements that cannot be reproduced keep their existing fitting; stroked open paths retain main behavior (#6582); #3380 deletion creates independent selected path pieces and keeps bounds-fitted gradients in place; endpoint highlighting remains open; Polygon/Star exact-size count persistence, with repeated-drag, tool-switch and Cancel regression coverage; Curvature point markers without direction handles (#1236, in part); Direct Selection segment click/Delete preserves neighboring edges, #1278; Flare, Reshape, Live Corners widget dragging and per-corner radii and kinds landed, on any path's corners; Shaper rough-shape recognition and orientation steps, the remaining Pen modifier nuances; Shaper Groups with editable sources and separate fill/stroke edits landed; custom ruler origin with drag preview, active-artboard reset, relative X/Y fields and native round-trip (#1212); construction widget/refinements pending); a shape just drawn moves by its centre point and turns from the zone outside a corner with its tool still active (#5477); Tangent and straight-segment perpendicular snapping use saved Smart Guides Geometric Guides preferences and Control bar quick access (#2537), including the existing Snap to Glyph and Alignment Guides toggles (#6164); no View submenu; Copy and Cut with the Pen or Curvature tool take the anchors a Cmd/Ctrl-lent Direct Selection picked (#6123); Scissors hover and cuts use the Pen's path/align/intersect/anchor snaps, with Alt Add Anchor and cut endpoint selection retained (#6470); Scissors previews the current anchor or curve cut point (#8655) | 12–18 |
| M3 | Paint & appearance (swatches, color, gradient, stroke, appearance, transparency, styles) | ✅ done (M3.7–M3.98): swatches, groups, libraries, tints, Lab spots and Registration; Eyedropper copies transformed character dimensions (#6404) and styles highlighted text only (atomic transparency rejection); Eyedropper reads visible locked and outside-isolation sources (#1251); Color Picker, Color panel (its spectrum grows with a resized panel, #8005), Color Guide, Color Themes, Edit Colors and Recolor Artwork (screen-bounded Edit chip list, #3416; native Lab entry and swatch libraries in the picker, Assign-row menus, #8031/#4028); gradients that follow every transform, the annotator, linked stops, freeform gradients, focal points, gradients on strokes and Expand; visible strokes when paint is added to inherited None/zero-width art (#1253); stroke geometry, arrowheads, dashes fitted to corners, stroke on type, width profiles and the Width tool (Shift-double-click enables adjoining adjustment in Width Point Edit; finite-arithmetic follow-up regressions and full CI passed ([Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area))), Scale Strokes and preview bounds; Appearance targeting, container appearance, target circles, Expand Appearance; knockout, isolation, blend accuracy, CMYK blending, overprint, Attributes, masks and clipping, Flatten Transparency; graphic styles, links and libraries; CSS library export preserves fractional linear and radial gradient stop positions. Left: freeform gradients in SVG/PDF, mixed spot/process gradients in SVG and PDF gradients mixing a spot color with RGB or Lab stops export as stops or process colors; PDF export writes dithered gradient fills with spot stops, and Perceptual spot gradients with RGB or Lab stops other than white or more than 4,096 stops on their curve, as images in process colors; confirm the Scale Strokes & Effects default; Recolor model selection is available through the engine and MCP only (#2520); the dialog retains its existing controls; Library panels' lists (swatch, Color Book, brush, symbol and graphic style libraries) fill a taller panel above its footer (#2992; scores and estimates unchanged); Graphic Styles list fills a taller panel above its footer (#2992; scores and estimates unchanged); Swatches list fills a taller panel above its footer (#1638; `the_list_fills_a_tall_panel_above_its_footer`; scores and estimates unchanged); | 4–8 |
| M4 | Files (native, SVG, PDF, raster, Export for Screens, clipboard interop) | `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths (#8128; estimates unchanged); Production Preflight checks fonts, overflow, links and image resolution with clickable findings and automatic rechecking (VectorCraft addition; estimates unchanged); PDF import: a glyph filled only after a glyph filled and stroked comes in filled only, not stroked (#8300; estimates unchanged); PDF import: type filled and stroked by one text-showing operator comes in as one filled and stroked type object (#8015; not for type filled and stroked at less than full opacity, which still comes in as a filled object and a stroked one, as the file composites them; estimates unchanged); PDF import: type filled and stroked by a `TJ` whose kerning starts a new line part way through comes in filled and stroked, a type object for each part, also where it draws a glyph again where it drew one, in an `ActualText` span too, where it stays one replacement type object on the first glyph's line and in its style; a `TJ` over more than 65 lines (the 64 its fill pass finished, kept back, and the open one) stays a filled object and a stroked one for each part (#8543; estimates unchanged); PDF import: type filled and stroked after a page of type filled only (more than 64 lines) comes in as one filled and stroked type object again, with or without a path between, and a `TJ` over more lines than are kept with a glyph kept as an outline still stays a filled object and a stroked one for each part (#8549 follow-up; estimates unchanged); PDF import: stroked type keeps the file's line cap, line join and miter limit (#7741; estimates unchanged); Rename artboards in Export for Screens (#7275); Explicit editing-data import keeps oversized capped-page artboards (#6865; estimates unchanged); Save refusal continuation (#6146): ordinary Save offers Save As; unchanged format keeps options, changed format opens its Save options; cancellation/automation isolation; focused UI regressions passed, native acceptance pending; PDF authored ActualText preserved once in editable import (#6165; first-glyph line/style, bounded input; estimates unchanged); PDF export keeps harakat and zero-advance Noto Arabic dot glyphs in one compatible batch per layout line, with per-glyph vertical offsets (#6309). `crates/pdf/src/tests/realtext.rs` (`mark_text_*`) checks decoded cluster mappings, mixed Arabic/Latin/digits, contour placement against outline export, vertical columns, differing path rotations and PDF/X-1a/3/4. Editable-text import preserves authored ActualText separately (#6165), with cross-line/style layout limits; separately styled or differently rotated clusters and external viewer search/copy remain outside this export-only evidence. `.ai`/EPS type from the text document keeps its paragraphs' tab stops (#6147); `.ai`/EPS type from the text document keeps auto leading per line, its hyphenation options, and may show more of the last lines the file sets in an area frame of its own, when growing the frame by its lines' deepest descent plus 0.05 pt shows them (#6137); ✅ done (M4.14–M4.98 on 2026-10-05): Save As/Save a Copy/Revert/templates, Data Recovery and background save, SVG import and export fidelity (units, text, symbols, filters, SVGZ, Preserve Editing, SVG Options), shared guarded PDF writer and windowed reader ([pdf-backend.md](pdf-backend.md)), PDF import (colours, layers, masks, editable text, security) and export (presets, marks, bleed, ICC and output intent, raster effects, subset fonts, PDF/X-1a, X-3 and X-4, PDF layers, overprint, page thumbnails, fast web view, PDF 1.3), Place and Links, Package, EPS and DXF in and out (EPS legacy mesh corners, vector opacity masks and raster page comparison verified; closed SPLINE flags round-trip and circular paths export as native CIRCLE/ARC, #1299), EMF/WMF, TIFF/BMP/Targa/PSD/GIF/PNG-8 export, Print and print presets, slices, Save for Web, TIFF in Export for Screens and Asset Export, clipboard flavours, File Info; AF.1–AF.4 add Affinity import (native layers, artboards, vectors, text and images from Affinity 1–3 files; the embedded preview only as a warned fallback; AF.4 expands current `.af` fixtures and every-board round-trip validation); EPS Save and Save As keep an opened EPS as EPS with its page frame and complete editable VectorCraft document (2026-10-26; G9 import fidelity unchanged). Left: DWG (use DXF), PSD placement as layers, overprint read back from PDF, Affinity export, polish; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; SVG CSS classes survive export and repeated import in all four styling modes (#2480); current-main integration retains event attributes and scripts; PDF import: glyphs inside a marked-content span with an empty `ActualText` come in as outlines in their fill and stroke, adding Line truncated
@@ -235,6 +235,7 @@ not take the artwork yet. Overflow-menu drag remains separate. Scores and hours
| Date | Change | Summary |
|---|---|---|
| 2026-11-19 | minor | M1: Layers: a target circle whose item is targeted and has an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the four looks (not targeted, targeted, with an appearance, both) differ (#8711). Scores and estimates unchanged. |
| 2026-11-19 | minor | M11: View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid; a ruler drag or double-click makes no guide meanwhile (#8363). Scores and estimates unchanged |
| 2026-11-19 | minor | Scissors previews its actual anchor or curve cut point with a native point marker while hovering, retaining existing snapping, Alt Add Anchor and cut behavior (#8655). Scores and estimates unchanged. |
| 2026-11-19 | minor | M5: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame (an edit that changes more than half of the frame, or a change of more than the view and the document, still renders it whole at once), and edits that go on once the view is still don't put off its render (#8688). Scores and estimates unchanged. |
+8 -2
View File
@@ -1,6 +1,6 @@
# Parity with Adobe Illustrator
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: G12: Brushes panel: item right-click context menu (Brush Options, Duplicate Brush, Delete Brush) with selection handling; scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame, and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…) with selection handling; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: #8200: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, its tints linked to the swatch; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: SVG export preserves document units on root width/height for physical units, #864; G11 estimate 8–15 → 6–13 h; previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: #8128: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, so the compound clipping path clips its clipping group; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic recLine truncated
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (Layers: a targeted item with an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the target circle's four looks differ, #8711; scores and estimates unchanged; previously: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: G12: Brushes panel: item right-click context menu (Brush Options, Duplicate Brush, Delete Brush) with selection handling; scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame, and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…) with selection handling; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: #8200: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, its tints linked to the swatch; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: SVG export preserves document units on root width/height for physical units, #864; G11 estimate 8–15 → 6–13 h; previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: #8128: `.ai` and EPS import: clipping paths grouped in a compound path are its subpaths, so the compound clipping path clips its clipping group; scores and estimates unchanged; previously: import: type filled and stroked by a `TJ` whose kerning starts a new line comes in filled and stroked, #8543; PDF Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that cLine truncated
>
> Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5).
>
@@ -75,6 +75,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard
| Date | Change | Summary |
|---|---|---|
| 2026-11-19 | minor | Layers: a target circle whose item is targeted and has an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the four looks (not targeted, targeted, with an appearance, both) differ (#8711). Scores and estimates unchanged. |
| 2026-11-19 | minor | G12: Brushes panel item right-click context menu offering Brush Options…, Duplicate Brush, and Delete Brush (disabled if the last remaining brush); right-clicking an unselected brush selects it first, and right-clicking within a multi-selection preserves it offering Duplicate Brushes / Delete Brushes; headless tests in `crates/ui-egui/src/panels/brushes/tests.rs`; scores and estimates unchanged. |
| 2026-11-19 | minor | G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…); right-clicking an unselected link row selects it first, and right-clicking within a multi-selection preserves it; headless tests in `crates/ui-egui/src/panels/tests_links.rs`; scores and estimates unchanged. |
| 2026-11-19 | minor | PDF import (#8549 follow-up): type filled and stroked after a page of type filled only came in as a filled object and a stroked one: since #8549 lines filled only are kept for a stroke pass too, and the glyphs of the lines finished past the 64 kept were remembered until the next stroke, so `2 Tr (Title) Tj` after more than 64 lines of type filled only took its first stroke for the start of a stroke pass over them, always once more than 4,096 glyphs had been finished so. Those glyphs are now forgotten when anything else is drawn (a path, an image, a Type 3 glyph's art, a change of blend mode or soft mask: nothing is drawn between an operator's fill pass and its stroke pass), and past the first 4,096 glyphs none are remembered instead of every stroke matching. A `TJ` over more lines than are kept still comes in as a filled object and a stroked one for each part, also when it ends where it began, and when a glyph kept as an outline comes before that (the line it starts keeps the glyphs of the lines finished). Remaining: with nothing drawn between them, type filled and stroked at exactly the place, font, size and text of a glyph filled only on a line finished so still comes in as a filled object and a stroked one, as the device can't tell its stroke pass from the start of one over that glyph. Tests: `type_filled_and_stroked_after_a_dense_page_of_filled_type_is_filled_and_stroked`, `type_filled_and_stroked_over_a_finished_glyph_after_a_path_is_filled_and_stroked`, `an_outline_glyph_in_a_tj_over_more_lines_than_are_kept_leaves_fill_and_stroke_apart`; scores and estimates unchanged. |
@@ -756,6 +757,7 @@ since 2026-10-01.
- **Large Shift-marquee selections and Select › Inverse:** `select.toggle` and `select.add` with many ids (a Shift-drag marquee sends them together) go through the selection once instead of once per id, and Select › Inverse looks each object up in a set of the selected ones. The resulting selection, its order and the reply are the same as before. With 50,000 objects the selection step of toggling every object off took 528 to 655 ms before and 2.5 to 4.6 ms after in 7 runs, wall clock on a machine that was running other builds (`cargo run --release -p vectorcraft-engine --example selection_bench`). Regression tests: `add_all_does_what_adding_each_does` and `toggle_all_does_what_toggling_each_does` in `crates/doc/src/selection/tests.rs`, and `toggle_and_add_handle_each_listed_id_in_order` in `crates/engine/tests/it/selection_commands.rs`.
- **Shift-click in the Layers panel's selection column on a large layer:** `layer.selectAll {id, add: true}` checks whether the row's art is all selected with a set of the selected objects, and removes or adds that art in one pass instead of once per object. The resulting selection, its order, the reply and the highlighted rows are the same as before. On a layer of 50,000 objects the whole command took a median of 733 ms before and 6.9 ms after when all of the layer's art was selected, and 369 ms before and 24 ms after when every other object was, in 7 runs each, wall clock on Linux while other builds were running (`cargo run --release -p vectorcraft-engine --example layer_select_bench`). Regression test: `a_shift_click_in_the_selection_column_matches_adding_or_removing_each_id` in `crates/engine/src/tests/layers.rs`.
- **Layers added to the selection from their target circles show as targeted (#8646):** with several items picked from their circles (nothing targeted), a layer or sublayer's circle shows its inner ring while all of its visible, unlocked art is selected, as an object's circle does while the object is selected. A layer is never selected itself, only its art, so its circle used to keep a single ring. Regression test: `a_layer_added_from_its_target_circle_shows_as_targeted` in `crates/ui-egui/src/panels/layers/tests.rs`.
- **A targeted item with an appearance of its own shows both marks (#8711):** its target circle keeps the inner ring of a targeted item, with the appearance dot drawn smaller inside it and a gap between them, so not targeted, targeted, with an appearance and both look different, as the target icons in [Appearance attributes](https://helpx.adobe.com/illustrator/using/appearance-attributes.html) do. The dot used to cover the ring. Regression test: `a_targeted_circle_with_an_appearance_shows_both_ring_and_dot` in `crates/ui-egui/src/panels/layers/tests.rs`.
- **Selection passes through raster effects:** clicks with the Selection, Direct Selection and Group Selection tools (Group Selection's repeated click included), the Selection tool's pointer and marquee, Direct Selection's marquee, pointer and anchor highlight, and Group Selection's marquee (E for enclosed objects included) leave out the area that a drop shadow, a glow, a blur or another raster effect paints beyond an object. A click on a shadow selects the object under it, or nothing over an empty canvas, a repeated Group Selection click there adds the groups of the object under it, and a press on the shadow of a selected object does not move it ([the help page](https://helpx.adobe.com/illustrator/using/selecting-objects.html)). Over a shadow, Direct Selection highlights only the anchors of the object under it, and Group Selection keeps its own pointer and highlights no anchor, as it does everywhere (VectorCraft's own rule). No setting changes this. This covers paths, groups, type, symbol instances and images. Regression tests: `crates/engine/src/tests/select_effects.rs`.
- **Symbol instances are selected where their art draws past their box:** a click or a marquee selects a symbol instance where a clipping path in its art, moved or reshaped by its live geometry effects, shows the art past the instance's box, as it selects a group of the same art; a click also selects it where a stroke in its art paints past the box ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/select-objects/select-objects.html)). The rest is VectorCraft's own rule: inside the box the instance is selected as before; in Outline view and below a layer whose Preview is off only the box counts; hidden art and the area a raster effect paints are left out. This covers instances in groups, nested in other symbols' art, moved and scaled. Regression tests: `a_symbol_instance_is_hit_where_a_moved_clipping_path_in_its_art_shows_the_art` and `a_symbol_instance_is_hit_on_the_stroke_of_its_art_past_its_box` in `crates/doc/src/hit/tests.rs`.
- **Selection follows geometry effects:** a click or a marquee with the selection tools selects a path or compound path where its live geometry effects (Transform, Offset Path, Roughen, Zig Zag and the other effects that reshape a path, on the object or on its fills and strokes) draw it, the copies a Transform effect makes included, and not where its own geometry no longer paints. The members of a group or layer whose own geometry effects move or reshape them are selected where they are drawn, at the depth each tool selects, and a locked member there lets the click through to what is below and is listed there in the Unlock submenu. A group's own fills and strokes are clicked where they paint its members, and a clipping path inside such a group is taken on its drawn outline before the art it clips. A compound path keeps its holes, Object Selection by Path Only takes the drawn outline and not its fill, and stacking order is kept. The selection tools select objects by clicking or by a marquee ([the help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/select-objects/select-objects.html)), and the effects leave the art they reshape editable ([the help page](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/apply-and-modify-effects.html)); where clicks land on the reshaped art is VectorCraft's own rule. In Outline view clicks and marquees use the plain paths, and in a layer with Preview off they take outlines only. The area a raster effect paints is still left out. Regression tests: `a_*_shifted_art_*`, `a_click_hits_a_paths_copy_and_evaluates_its_art_once_until_it_changes`, `a_groups_own_effect_moves_where_its_members_are_hit`, `a_layers_own_effect_moves_where_its_art_is_hit`, `a_preview_off_sublayer_of_an_effected_layer_is_clicked_in_outline`, `a_painted_group_around_an_effected_symbols_instance_is_hit_where_its_art_is_drawn`, `an_intertwine_group_in_a_layers_drawn_art_is_hit_in_its_woven_order`, `a_click_in_a_plain_group_evaluates_only_its_member_with_effects`, `a_clip_groups_own_effect_moves_where_its_mask_outline_is_hit`, `an_isolated_clip_group_with_its_own_effect_is_marqueed_by_its_members_own_geometry` and `a_clip_groups_art_is_hit_when_its_drawn_art_holds_only_the_clipping_path` in `crates/doc/src/hit/tests.rs`, and `a_click_and_a_marquee_select_art_where_its_transform_effect_draws_it`, `a_click_selects_a_group_where_its_own_fill_paints_a_moved_member`, `a_marquee_takes_an_inner_groups_own_fill_inside_a_painted_group` and `a_marquee_takes_a_groups_own_fill_inside_a_painted_layer` in `crates/engine/src/tests/select_effects.rs`.
@@ -1107,6 +1109,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- A floating panel's OS window hides while a tool group's flyout or the All Tools drawer is open in the main window, as it does under a modal dialog or a menu, and shows again when the flyout or the drawer closes (#5813; `a_tool_flyout_hides_the_palette_windows_until_it_closes`).
- Focus moving between the app's own windows passes through a frame where none has it (a press on a panel's bar takes it from the main window): the panels' OS windows keep their level then, and leave the top level only once the app has had no focus for 0.25 s. Before, that frame lowered them, so with two floating panels a press on one panel's bar handed the keyboard to the other (the main window's tool cursor did not come back) and could leave both behind the main window (#6986; `focus_moving_between_the_apps_windows_leaves_the_palettes_on_top`).
- On the desktop a floating panel in an OS window stores the monitor it is on and reopens there at the next launch. When that monitor is no longer connected, the panel opens on the main window's monitor at the same offset (#5582). Outside macOS, a desktop whose monitors have different scale factors keeps opening floating panels on the main window's monitor. Test: `panel_docking::native_tests::a_floating_panel_reopens_on_the_monitor_where_it_was_left`.
- The monitors given to floating panels carry each monitor's work area (the part without the taskbar, Dock or menu bar) on macOS, and on Windows when the monitors share one scale factor (a build without the `wgpu` feature reads none). A floating panel that reopens without enough of its title bar inside any work area to grab moves into the work area of the nearest monitor. A restored main window is kept inside its monitor's work area the same way. Tests: `floating_panels_get_each_monitors_work_area_in_the_same_points`, `macos_screen_rects_turn_into_winits_top_left_pixels` and `a_restored_window_keeps_its_title_bar_out_of_a_taskbar_along_the_top`.
- A menu in a floating panel's OS window stops at that window's bottom edge and scrolls past it, and is never taller than the window (#5347; `a_long_panel_menu_scrolls_inside_a_short_native_window`). A panel's long submenus (Digits, Stylistic Sets, Save Selection, Move to Group), the libraries menu, the Color Guide's Limit to Library menu and the Layers panel's Filter popup scroll the same way.
- The dock's double arrow collapses Properties, Layers and Libraries to icons at the top of the icon column, popping out like the other icon panels, and expands them again (`window.collapseDock`, kept with the preferences and in saved workspaces). The icon column's own arrow (expanding the icon panels into a full column) is not done.
- Window › Toolbars › New Toolbar… and New Toolbar… in the All Tools drawer's menu ask for a name and make a blank toolbar that floats on its own, moved by its title bar and listed under Window › Toolbars, whose item shows or hides it. The title bar's × hides it, and its double arrow shows its tools in one column or two. Its ••• button opens the All Tools drawer beside it, and tools dragged from the drawer fill it. The toolbars are kept with the workspace they were made in: switching workspaces shows that workspace's toolbars, Reset Workspace keeps them, and New Workspace starts the new workspace with a copy of them (<https://helpx.adobe.com/illustrator/using/tools.html>; `window.toolbar.new`, `window.toolbar.custom`, the `toolbar` param of `window.editToolbar` and `toolbar.addTool`/`removeTool`/`reset`; `tools_added_to_a_new_toolbar_survive_a_workspace_reload`).
@@ -1218,7 +1221,8 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- macOS: Finder opens every format File › Open reads with VectorCraft (double-click, Open With, a drop on the Dock icon, `open -a`), at launch or while it runs; the release and `cargo xtask bundle` apps share one `Info.plist` that declares those document types, owning only VectorCraft's own formats. The DMG opens on a designed Finder window, VectorCraft.app beside the `Applications` link over a background with the app icon (#493).
- Swatch and graphic style libraries, Libraries panel files, presets and plug-ins open wherever they are dropped on the window, as File › Open opens them.
- File › Open has a filter for each kind of file it opens other than a document, Graphic Style Libraries (`.vcstyles`, after Swatch libraries) and Perspective grid presets (`.vcperspective`, after Print presets) among them, and Other Library… lists its library filter once. Graph designs are stored in the document, with no file type or filter of their own. Tests: `open_exts_cover_every_readable_format`, `library_open_filters_list_library_formats_first`.
- **Symbol libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-or-import-symbol-libraries.html)): Window › Symbol Libraries and the Symbols panel's Symbol Libraries Menu open each library in a library panel of its own, as swatch and graphic style libraries do. The built-in libraries, Basic Shapes, UI Frames (Panel, Button and Bar with default 9-slice guides), Map Markers (Pin, Flag, Crosshair and Checkpoint, no default 9-slice), Inventory Icons (Sword, Shield, Potion, Key and Gem, no default 9-slice), Skill Icons (Attack, Defend, Heal, Buff and Ult, no default 9-slice), Weather Icons (Sun, Moon, Cloud, Rain, Thunder and Snow, no default 9-slice) and Media Controls (Play, Pause, Stop, Skip Next, Shuffle and Repeat, no default 9-slice), are original art generated in code (`crates/engine/src/cmd/symbollib.rs`). A click on a symbol adds it to the document's Symbols as one undo step, with its Symbol Options (size, registration, export type, 9-slice guides) and every resource it uses (the symbols it nests, patterns, swatches, brushes, graphic styles, images), and makes it the current symbol; a symbol the document already has is not added again and another symbol of the same name keeps its name, the library's comes in numbered. Thumbnails, in the library panels and the Symbols panel, draw a symbol with the symbols it nests and the patterns and images it uses. Dragging a library symbol onto the canvas also places an instance there, in the same step ([placing from a library](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-and-place-symbols.html)). Save Symbols (the library menu) and Save Symbol Library… (the Symbols panel menu) write the document's symbols as a `.vectorcraft` document holding only them, into the user library folder (listed under User Defined) or a file; Other Library… reads the symbols of any document VectorCraft opens; a file it can't read is an error and opens no panel. Tests: `crates/engine/src/tests/symbollib.rs`, `crates/ui-egui/src/panels/tests_symbol_libraries.rs`, `panels::symbols::tests::thumbnails_show_the_symbols_a_symbol_nests`, `canvas::tests::a_library_symbol_dropped_on_the_canvas_is_added_and_placed_there_in_one_step`.
- **Symbol libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-or-import-symbol-libraries.html)): Window › Symbol Libraries and the Symbols panel's Symbol Libraries Menu open each library in a library panel of its own, as swatch and graphic style libraries do. The built-in libraries, Basic Shapes, UI Frames (Panel, Button and Bar with default 9-slice guides), Map Markers (Pin, Flag, Crosshair and Checkpoint, no default 9-slice), Inventory Icons (Sword, Shield, Potion, Key and Gem, no default 9-slice), Skill Icons (Attack, Defend, Heal, Buff and Ult, no default 9-slice), Weather Icons (Sun, Moon, Cloud, Rain, Thunder and Snow, no default 9-slice), Nature Icons (Leaf, Flower, Tree, Mountain and Wave, no default 9-slice) and Media Controls (Play, Pause, Stop, Skip Next, Shuffle and Repeat, no default 9-slice), are original art generated in code (`crates/engine/src/cmd/symbollib.rs`). A click on a symbol adds it to the document's Symbols as one undo step, with its Symbol Options (size, registration, export type, 9-slice guides) and every resource it uses (the symbols it nests, patterns, swatches, brushes, graphic styles, images), and makes it the current symbol; a symbol the document already has is not added again and another symbol of the same name keeps its name, the library's comes in numbered. Thumbnails, in the library panels and the Symbols panel, draw a symbol with the symbols it nests and the patterns and images it uses. Dragging a library symbol onto the canvas also places an instance there, in the same step ([placing from a library](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-and-place-symbols.html)). Save Symbols (the library menu) and Save Symbol Library… (the Symbols panel menu) write the document's symbols as a `.vectorcraft` document holding only them, into the user library folder (listed under User Defined) or a file; Other Library… reads the symbols of any document VectorCraft opens; a file it can't read is an error and opens no panel. Tests: `crates/engine/src/tests/symbollib.rs`, `crates/ui-egui/src/panels/tests_symbol_libraries.rs`, `panels::symbols::tests::thumbnails_show_the_symbols_a_symbol_nests`, `canvas::tests::a_library_symbol_dropped_on_the_canvas_is_added_and_placed_there_in_one_step`.
- **Nature Icons library:** Leaf, Flower, Tree, Mountain and Wave are five original procedural vector symbols. Each has a finite natural size, can be added and placed through the symbol library controls, and survives saving to a library file; no 9-slice guides are assigned by default.
- **9-slice scaling** ([public source](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/maintain-proportions-while-scaling-symbols.html)): a scaled instance of a symbol with Enable Guides for 9-Slice Scaling on stays an instance and keeps the parts of its art outside the guides at their size. New guides sit a quarter of the symbol's width and height in from each edge ([reference](https://help.adobe.com/archive/en/illustrator/cs6/illustrator_reference.pdf), Use 9-slice scaling section); saved guides keep their values. The rest is VectorCraft's own rule: the corners keep both sizes, the top and bottom edges stretch in width, the left and right edges in height and the center in both; an instance smaller than its two outer cells on an axis shrinks them in proportion and leaves the center empty; the cells are sized along the symbol's axes before the instance's rotation, shear or reflection. A path with solid paint that crosses a guide is cut there and stays one path, its stroke at its weight with Scale Strokes & Effects on or off; type, images, live objects and gradient or pattern paint that cross a guide are drawn in each cell they reach, clipped to it, except those that draw symbol art (a nested instance, type with an inline graphic, a placed document, a brushed stroke, or a pattern whose tile draws one of these), which are placed by the cell their center is in; an object in one cell is placed by that cell and stays as it is. The canvas, bounds, the Eyedropper, Break Link to Symbol and the PDF, EPS, DXF, EMF/WMF and SVG exports place the art the same way; SVG writes such an instance as its placed art instead of a `<use>`, and DXF and WMF, which do not clip, cut every path that crosses a guide and place other such objects by the cell their center is in. Tests: `symbol_nine_slice::tests` in `crates/doc`, `crates/engine/src/tests/symbol_nine_slice.rs`, `a_scaled_nine_slice_instance_keeps_its_corners` (PDF), `a_scaled_nine_slice_instance_is_written_as_the_canvas_draws_it` (SVG), `a_scaled_nine_slice_instance_is_sampled_as_it_is_drawn` (Eyedropper).
- **Symbol editing mode** ([Edit symbols](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/edit-symbols.html), [Symbols panel options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbols-panel-options.html)): a double-click on a symbol instance, the Control bar's Edit Symbol button, a double-click on a symbol in the Symbols panel and the panel menu's Edit Symbol (`symbol.edit`) open the symbol's art on a temporary isolated layer, where the instance shows it (from the panel: centered on the active artboard, or in the view in a document without artboards), with the rest of the document dimmed. Each edit there changes every instance at once; the instances keep their own transforms and stay linked (Break Link to Symbol still expands one), and a dynamic symbol's instances keep their appearance changes to the objects the art still has. Escape, the isolation bar's back button, the Control bar's Exit Symbol Editing Mode and a double-click outside the art leave the mode (`symbol.exitEditing`); leaving without an edit adds no undo step. Saving leaves the editing layer out. Tests: `crates/engine/src/tests/symboledit.rs`, `select::tests::a_double_click_on_a_symbol_instance_edits_its_symbol`, `panels::symbols::tests::edit_symbol_from_the_panel_centers_the_art_on_the_active_artboard_or_the_view`.
- **Dynamic symbol appearance follows what an object draws** (VectorCraft's own rule): `symbol.instance.setAppearance` refuses a fill or stroke for an object of the art that does not draw it (a guide, blend, envelope, Repeat, Intertwine group, gradient mesh or placed document; a nested symbol instance's stroke, and its fill unless a solid color or none, which stains its art; an image's fill or stroke without a Convert to Shape or Outline Object effect) with an error that names the key and the object, and the call changes nothing. Opacity, blend and `null`, which takes a stored change back, are taken for every object. Tests: `crates/engine/src/tests/dynamic_symbols.rs`.
@@ -1546,6 +1550,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
With Pick Color From Artwork, a merged shape takes the appearance, opacity and blending mode of the object where the drag starts, else of the object where it ends, else of the front-most selected object, as the [Shape Builder combine page](https://web.archive.org/web/20251006211643/https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/combine-shapes-with-shape-builder-tool.html) describes. A click in an area that no selected object covers, such as a hole other shapes enclose, takes the front-most selected object's look (`shapeBuilder.merge` `points`: the first point is where the drag starts, and the last point is where it ends).
A Shift-drag with the Shape Builder tool draws a rectangular marquee for merging many paths at once, as [Combine shapes with the Shape Builder tool](https://web.archive.org/web/20251006211643/https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/combine-shapes-with-shape-builder-tool.html) describes: the regions it reaches are shaded while it is drawn and merge into one shape on release, or with Alt they are deleted. The marquee reaches each region whose outline crosses it or has an anchor inside it, and the region that holds the whole marquee; this rule is VectorCraft's own. For Pick Color From Artwork, the marquee's starting corner is where the drag starts and the opposite corner is where it ends (`shapeBuilder.merge` `rect`).
The Shape Builder works on the selected paths, as [Combine shapes with the Shape Builder tool](https://web.archive.org/web/20251006211643/https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/combine-shapes-with-shape-builder-tool.html) describes. As VectorCraft's own rule, a click or drag that builds nothing says why in the status bar when it is released: "Shape Builder: select paths or compound paths" when nothing is selected or the selection holds no unlocked, visible path; "Shape Builder: select all paths you want to merge" when the release is over a path or compound path that is not selected; and "Shape Builder: no region under the pointer" otherwise. The document, the selection and the undo history stay as they were, and the next gesture that builds something clears the message. Regression tests: `shape_builder_with_nothing_selected_says_what_to_select`, `shape_builder_names_the_unselected_path_under_a_release_that_built_nothing` and `shape_builder_replayed_gesture_over_nothing_gives_its_status_once` in `builder/tests.rs`, and `tests::build::shape_builder_click_that_builds_nothing_shows_why`.
As VectorCraft's own tool, Fill Area (in the Live Paint Bucket's group) adds a new closed path of the area under a click with the current fill and stroke, directly above the front-most object along it, and leaves the paths around it as they are. It needs no selection: the visible, unlocked paths on every layer bound areas, open paths and the overlap of filled shapes included, and it uses the Shape Builder's Gap Detection (`shapeBuilder.copyRegion`). In isolation mode only the isolated layer or group's paths bound areas and the new path goes inside it. It finds no area while the isolated object is not a layer or group, is a group that makes, moves or combines its own art (Live Paint, compound shapes, Shaper groups, graphs, Image Trace results, dimensions, flares, Objects on Path), is a layer or group with a live effect or a clipping mask, or lies inside one of these or inside an envelope. Regression tests: `tests::fill_area::*`.
Shape Builder pieces on dense hatches (lines at exact 0.25 or 0.5 pt steps across another line) come back one per stretch between crossings, with no speck where the sweep cut a line's two passes a rounding error apart: the planar map contracts the stub between such cuts into one vertex, bounded by each cluster's extent so a run of tiny level segments keeps its length (`crates/pathops/src/planar.rs` tests `a_dense_hatch_at_exact_binary_steps_cuts_each_line_once_per_crossing`, `a_run_of_tiny_level_segments_is_not_contracted_as_stubs`, `a_line_crossed_where_its_two_passes_part_is_cut_once`).
The Shape Builder's gray hatch over the region under the pointer and the regions a drag has touched is drawn by a sweep that tests each hatch line only against the region's edges that span it, instead of every edge on every line. The hatch lines are the same, coordinate for coordinate; on a 2,000-sided region 1,000 hatches take about 83 ms of CPU time instead of 356 ms (release build, median of 7 alternating runs), and on a region of 40 sides the time is about the same, so the gain is on large, complex regions such as traced art (`crates/tools/src/builder/tests.rs` tests `hatch_matches_testing_every_edge`, `hatch_tests_only_the_edges_spanning_each_line` and `hatch_sweep_finds_the_crossings_of_every_edge`; timing: `hatch_perf`).
The planar map's edge-source grid stays linear in memory on any input: a segment is filed once per cell it crosses, and the grid holds at most a budget of cell references (a few dozen per item plus a few rows' worth), past which the remaining items go to a short scanned list and are still found, so thousands of coincident segments cannot make the index quadratic (`crates/pathops/src/planar.rs` test `rect_index_holds_a_bounded_number_of_references`).
@@ -3139,6 +3144,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s
| Date | Change | Summary |
|---|---|---|
| 2026-11-19 | minor | Layers: a target circle whose item is targeted and has an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the four looks (not targeted, targeted, with an appearance, both) differ (#8711). Scores and estimates unchanged. |
| 2026-11-19 | minor | Guides, grids, smart guides, snapping, rulers: View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out their Show/Hide items; a ruler drag or double-click makes no guide meanwhile (#8363). Scores and estimates unchanged. |
| 2026-11-19 | minor | Scissors previews its actual anchor or curve cut point with a native point marker while hovering, retaining existing snapping, Alt Add Anchor and cut behavior (#8655). Scores and estimates unchanged. |
| 2026-11-19 | minor | Performance: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame, and edits that go on once the view is still don't put off its render (#8688). Evidence added; scores and estimates unchanged. |
+24 -10
View File
@@ -491,8 +491,9 @@ The public [Map artworks on 3D object](https://helpx.adobe.com/illustrator/deskt
page describes graphics: art kept with the document and placed on single surfaces of a 3D object, and the
[3D and Materials panel options](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/create-3d-graphics/3d-materials-panel-options.html)
page lists Graphics and Add Materials and Graphics on the Materials tab. VectorCraft maps graphics onto
Extrude & Bevel's front and back caps and its side (its walls and bevels), the plane of the Plane type (Rotate), and
the swept side of Revolve, which the public page's example of a label on a bottle describes.
Extrude & Bevel's front and back caps and its side (its walls and bevels), the plane of the Plane type (Rotate),
the swept side of Revolve, which the public page's example of a label on a bottle describes, and Inflate's puffed
front and back.
- The panel's **Materials** tab shows the document's graphics as thumbnails. A graphic is a document symbol, as
the public page allows existing symbols to be used. **Add as Single Graphic** keeps the selected art as a new
@@ -501,9 +502,9 @@ the swept side of Revolve, which the public page's example of a label on a bottl
- Clicking a thumbnail maps that graphic onto the front of the 3D effect of each selected object
(`threeD.mapGraphic`), in one undo step. A graphic larger than the object starts scaled down to fit inside it.
- Below the thumbnails the tab lists the graphics mapped onto the first selected object. The selected one shows
its Face (Front, Back or Side; Plane and Revolve show no Face, as a plane has only a front and Revolve's graphics
go on its side), X and Y (the offset of its center from the center of the
object's bounds, in the face's plane, or on a side from its middle unrolled flat), Scale (a percentage of the symbol's size) and Rotation
its Face (Front, Back or Side, on Inflate Front or Back for its puffed front or back; Plane and Revolve show no
Face, as a plane has only a front and Revolve's graphics go on its side), X and Y (the offset of its center from
the center of the object's bounds, in the face's plane, or on a side from its middle unrolled flat), Scale (a percentage of the symbol's size) and Rotation
(counterclockwise), and **Remove Graphic** takes it off. Each change is one undo step.
- While the tab is open, a blue handle sits on the center of each mapped graphic whose face is turned toward the
viewer. Dragging a handle moves that graphic over its face, previewed while the pointer is down and recorded as
@@ -524,6 +525,18 @@ These rules are VectorCraft's own:
their own. A graphic on a face turned away from the viewer is not drawn.
- On the back cap, X runs to the right as the back is seen from behind, so the graphic reads the right way round
there.
- On Inflate a graphic is placed in the art's plane, X and Y measured from the center of the object's bounds as on
a cap, and carried straight out onto the puffed face above each point, so it follows the puff. The back takes
graphics only with Both sides and Cap on (`threeD.mapGraphic` refuses one otherwise, and one already there is
not drawn); it reads the right way round from behind, and Twist and Taper turn and shrink its graphics with it.
The membrane is cut into triangles, and each one draws the part of the graphic that falls on it, shaded as
that triangle is shaded and drawn only where the surface's outside faces the viewer; nearer triangles drawn
after it cover it. When a cell of the membrane cannot be cut into triangles, the object draws without its
graphics and commands refuse them, as when the triangles take more faces than a 3D effect draws. Every solid of
the object (a fill's, and a stroke's outline) carries the graphics. The handle sits on the point of the puffed
face above the graphic's center, and only where the viewer sees that face. The cutting into straight pieces,
the seam strokes and the limits below are those of Revolve; when the triangles take more faces than a 3D
effect draws, the object draws without its graphics and commands refuse them.
- On Revolve a graphic lies on the swept side, which has one face (Front), unrolled flat. X runs around the axis:
the angle from the middle of the side times the profile's distance from the axis at that point, so a graphic
keeps its size at every distance and wraps farther around the axis where the profile comes nearer to it. Y runs
@@ -573,9 +586,10 @@ These rules are VectorCraft's own:
draws the object without a graphic past the first limit, and without all of its graphics past the second.
- A hollow Extrude & Bevel has no caps, so the graphics on its caps are not drawn until Cap is turned on again,
and `threeD.mapGraphic` refuses to map a new one onto a cap; its side takes graphics. With a depth of 0 the object
is a plane, and `threeD.mapGraphic` maps graphics onto its front only. Changing the type to Inflate drops the
graphics, and changing between Extrude, Plane and Revolve keeps them, except that Plane and Revolve drop the
graphics on the back cap and on Extrude & Bevel's side; on Revolve the front's graphics go on its side.
is a plane, and `threeD.mapGraphic` maps graphics onto its front only. Changing between Extrude, Plane, Revolve
and Inflate keeps the graphics, except that Plane and Revolve drop the graphics on the back cap, and Plane, Revolve
and Inflate drop the graphics on Extrude & Bevel's side; on Revolve the front's graphics go on its side, and on
Inflate the front's and back's go on the puffed faces.
- `effect.apply` and `effect.setParams` refuse a graphic that names a symbol the document does not have, unless
the effect already holds a graphic of that symbol. A graphic whose symbol is deleted is no longer drawn. Renaming a symbol renames it in the graphics that use it,
in the layers, in the art of symbols, patterns, graph designs, brushes and opacity masks, and in graphic
@@ -632,9 +646,9 @@ is VectorCraft's own.
uses: `rotationX`, `rotationY`, `rotationZ`, `perspectiveAngle` (degrees), `shade`, `lightColor` (`#rrggbb`, default `#ffffff`), `lightIntensity` (%), `lightRotation`,
`lightHeight` (degrees), `lightSoftness` (%), `ambient` (%, to 200), `lightBehind`. Lengths are points and scale with the object (Scale Strokes & Effects).
Commands validate the shape and the parameters before the document changes. All four also take `lights`: null (the default, use the earlier single-light fields), or an array of one to ten objects. Each object takes `color` (opaque `#rrggbb`, white), `intensity` (0..100%, 80), `rotation` (-180..180 degrees, 125.26), `height` (0..90 degrees, 30), `softness` (0..100%, 0), and `behind` (boolean, false). Omitted settings use those defaults. An explicit list replaces the earlier single light; `ambient` and `shade` remain shared. Set `lights` to null to return to the single-light fields. Invalid lists, counts, keys and values are rejected before editing; malformed loaded lists fall back to the earlier light safely. All four take `shadow` (boolean, false), `shadowPosition` (`behind` or `below`), `shadowDistance` (0..100%, 0) and `shadowBounds` (10..400%, 100) ([Shadows](#shadows)); values out of range are rejected before editing.
`threeD.extrude`, `threeD.rotate` and `threeD.revolve` take `graphics` ([Graphics](#graphics)): an array of up to 64 objects, each
`threeD.extrude`, `threeD.rotate`, `threeD.revolve` and `threeD.inflate` take `graphics` ([Graphics](#graphics)): an array of up to 64 objects, each
with `symbol` (the name of a document symbol), `face` (`front`, `back` or `side`, default `front`; `threeD.rotate` and
`threeD.revolve` take `front` only), `x` and `y` (points, default 0), `scale` (1..10000%, default 100) and `rotation` (-360..360 degrees,
`threeD.revolve` take `front` only, and `threeD.inflate` `front` or `back`), `x` and `y` (points, default 0), `scale` (1..10000%, default 100) and `rotation` (-360..360 degrees,
default 0). Other keys, values out of range and graphics on the other 3D effects are rejected before editing.
All four take `render` ([3D and Materials panel](#3d-and-materials-panel)): an object whose `mode` is `shaded` (the
default) or `wireframe`. A `render` that is not an object, a key other than `mode`, another mode, and `render` on
+2 -1
View File
@@ -1,6 +1,6 @@
# UI and interaction parity
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); Canvas context menu: a right-click on a path offers Simplify… next to Smooth…, opening the Simplify slider, or the Simplify dialog kept for next time, as Object › Path › Simplify… does, #8344; scores and estimates unchanged; previously: a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: : selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: Layersselected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); scores and estimates unchanged; previously: Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selected-art square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchanged; previously: #8005: the Color spectrum fills a resized panel; scores and estimates unchanged; previously: Pencil continuation, straight-line and closing cursors; scores and estimates unchanged; previously: GLine truncated
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (Layers: a targeted item with an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the target circle's four looks differ, #8711; scores and estimates unchanged; previously: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); Canvas context menu: a right-click on a path offers Simplify… next to Smooth…, opening the Simplify slider, or the Simplify dialog kept for next time, as Object › Path › Simplify… does, #8344; scores and estimates unchanged; previously: a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: : selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: Layersselected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact Tools offers optional denser main Tools spacing (#7234); default layout, scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: Floating panels keep their window level while focus moves between the app's windows, so a press on one panel's bar no longer hands the keyboard to another, #6986; scores and estimates unchanged; previously minor: Lock Guides: a selection marquee (Selection, Direct Selection, Group Selection, Enclosing Lasso) leaves out paths made into guides inside groups and compound paths too, as clicks do (#3074), so a group is no longer selected by a locked guide in it; an enclosing marquee measures a group without its locked or hidden guides, and Direct Selection takes no anchor or segment of a guide that can't be picked; a guide in a group still moves with its group (#8538); scores and estimates unchanged; previously: Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: Layers panel: an Alt-drag copies a row above or below itself, so the top layer dragged up, the bottom layer dragged down and a lone layer are copied, #8237; scores and estimates unchanged; previously: Layers panel: Alt over the list shows the copy cursor while rows or the selected-art square are dragged, #8217; scores and estimates unchanged; previously: Gradient panel: the add-stop strip under the ramp shows the white arrow with a plus on Windows and X11, #8241; scores and estimates unchanged; previously: Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchangeLine truncated
>
> Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5).
>
@@ -626,6 +626,7 @@ before release (#6373). [Paint faces and edges](https://helpx.adobe.com/illustra
| Date | Change | Summary |
|---|---|---|
| 2026-11-19 | minor | Layers: a target circle whose item is targeted and has an appearance of its own keeps its inner ring visible, with a smaller appearance dot inside it and a gap between them, so not targeted, targeted, with an appearance and both look different, as the target icons in [Appearance attributes](https://helpx.adobe.com/illustrator/using/appearance-attributes.html) (Targeting items for appearance attributes) do. Before, the dot covered the ring and a targeted item with an appearance looked untargeted, #8711. Scores and estimates unchanged. |
| 2026-11-19 | minor | View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid until it is off; the choices come back as they were and the rulers stay, though dragging or double-clicking them makes no guide meanwhile (#8363). Scores and estimates unchanged. |
| 2026-11-19 | minor | Scissors previews its actual anchor or curve cut point with a native point marker while hovering, retaining existing snapping, Alt Add Anchor and cut behavior (#8655). Scores and estimates unchanged. |
| 2026-11-19 | minor | Artboard tool: Shift held once a move or an Alt-drag copy of an artboard is under way keeps it to the level, upright or 45° line from General › Constrain Angle, and snaps slide it along that line; a Shift-press still draws an artboard inside another or marquee-selects (#2497), #8580. Scores and estimates unchanged. |
+158 -30
View File
@@ -13,6 +13,7 @@ mod layers;
mod pdf_deps;
mod pngsuite;
mod sha256;
mod shards;
mod stats;
mod test262;
mod ui_commands;
@@ -37,6 +38,11 @@ commands:
wasm cargo check --target wasm32-unknown-unknown for the wasm-safe crates and the web app
test the workspace tests (cargo nextest when installed, else cargo test), then the doctests
ci fmt --check, clippy -D warnings, test, doctests, no-bundled-fonts, pdf-deps, assets, brands, cursors (warnings only), ui-commands --check, layers, wasm (stops at first failure)
ci shard shard $GATE_SHARD of $GATE_SHARDS of ci (xtask/src/shards.rs): a test shard runs
the tests and doctests of its crates, the last shard the other steps
ci warm build what every shard builds, without running it (fills the gate's cache)
shards list the crates each shard tests; fails when a member is in no shard or in two,
or builds with other features in its shard than in the whole workspace
corpus [--download] [--affinity]
show where test corpora live; --download fetches PngSuite into corpus/pngsuite,
--affinity the pinned public Affinity documents into corpus/affinity
@@ -66,7 +72,10 @@ fn main() -> ExitCode {
Some("pdf-deps") => pdf_deps::run(&root()),
Some("wasm") => cmd_wasm(),
Some("test") => cmd_test().and_then(|()| cmd_doctests()),
Some("ci") if rest.first() == Some(&"shard") => cmd_ci_shard(),
Some("ci") if rest.first() == Some(&"warm") => cmd_ci_warm(),
Some("ci") => cmd_ci(),
Some("shards") => shards::run().map(drop),
Some("corpus") if rest.contains(&"--affinity") => affinity_corpus::fetch(),
Some("corpus") => cmd_corpus(rest.contains(&"--download")),
Some("bundle") => bundle::run(&root()),
@@ -246,30 +255,162 @@ fn has_nextest() -> bool {
/// The workspace's unit and integration tests, without examples (clippy still checks those).
/// nextest runs each test in its own process, in parallel across all test binaries.
fn cmd_test() -> Result<(), String> {
test_packages(&["--workspace".to_owned()], "--workspace")
}
/// [`cmd_test`] for the packages `select` picks (`--workspace` or `-p` ids), shown as `shown`.
fn test_packages(select: &[String], shown: &str) -> Result<(), String> {
const TARGETS: [&str; 3] = ["--lib", "--bins", "--tests"];
let mut c = cargo();
if has_nextest() {
c.args(["nextest", "run", "--workspace"]).args(TARGETS);
run(c, "cargo nextest run --workspace --lib --bins --tests")
c.args(["nextest", "run"]).args(select).args(TARGETS);
run(c, &format!("cargo nextest run {shown} --lib --bins --tests"))
} else {
eprintln!("note: cargo-nextest is not installed; running cargo test (cargo install cargo-nextest for faster runs)");
c.args(["test", "--workspace"]).args(TARGETS);
run(c, "cargo test --workspace --lib --bins --tests")
c.arg("test").args(select).args(TARGETS);
run(c, &format!("cargo test {shown} --lib --bins --tests"))
}
}
/// The doctests, which nextest doesn't run.
fn cmd_doctests() -> Result<(), String> {
let mut c = cargo();
c.args(["test", "--workspace", "--doc"]);
run(c, "cargo test --workspace --doc")
doctest_packages(&["--workspace".to_owned()], "--workspace")
}
/// [`cmd_doctests`] for the packages `select` picks, shown as `shown`.
fn doctest_packages(select: &[String], shown: &str) -> Result<(), String> {
let mut c = cargo();
c.arg("test").args(select).arg("--doc");
run(c, &format!("cargo test {shown} --doc"))
}
/// One `cargo xtask ci` step: its name and what it runs.
type Step = (&'static str, Box<dyn Fn() -> Result<(), String>>);
/// The `ci` steps that build and run tests of the whole workspace; `ci shard` runs them per shard.
const TEST_STEPS: [&str; 3] = ["test", "doctests", "i18n-report"];
/// `cargo xtask ci`: each step in turn, stopping at the first that fails; the summary names the
/// steps that passed and, after a failure, the one that failed and those skipped.
fn cmd_ci() -> Result<(), String> {
type Step = (&'static str, Box<dyn Fn() -> Result<(), String>>);
let steps: Vec<Step> = vec![
run_steps(&ci_steps())
}
/// `cargo xtask ci shard`: shard `GATE_SHARD` of `GATE_SHARDS` (1-based, as the shared gate
/// workflow sets them). A test shard runs the shard checks, then the tests and doctests of its
/// crates, and the i18n report where it tests vectorcraft-ui-egui. The checks shard runs every
/// other `ci` step and the shard checks.
fn cmd_ci_shard() -> Result<(), String> {
let number = |key: &str| -> Result<usize, String> {
let value = std::env::var(key).map_err(|_| format!("ci shard: {key} is not set (the gate workflow sets it)"))?;
value.trim().parse().map_err(|_| format!("ci shard: {key} is `{value}`, not a number"))
};
let (shard, count) = (number("GATE_SHARD")?, number("GATE_SHARDS")?);
if count != shards::GROUPS.len() {
return Err(format!(
"ci shard: GATE_SHARDS is {count}, and xtask/src/shards.rs has {} shards (test-shards in .github/workflows/ci.yml)",
shards::GROUPS.len()
));
}
if !(1..=count).contains(&shard) {
return Err(format!("ci shard: GATE_SHARD is {shard}, not 1 to {count}"));
}
let checked = shards::run()?;
let mut steps: Vec<Step> = Vec::new();
match &checked[shard - 1] {
shards::Shard::Tests(crates) => {
let names = shards::names(crates);
eprintln!("ci shard {shard}/{count}: the tests of {names}");
let select = shards::select(crates);
let shown = crates.iter().map(|m| format!("-p {}", m.name)).collect::<Vec<_>>().join(" ");
let (s, w) = (select.clone(), shown.clone());
steps.push(("test", Box::new(move || test_packages(&s, &w))));
let (s, w) = (select.clone(), shown.clone());
steps.push(("doctests", Box::new(move || doctest_packages(&s, &w))));
if crates.iter().any(|m| m.name == "vectorcraft-ui-egui") {
steps.push(("i18n-report", Box::new(move || i18n_report_packages(&select, &shown))));
}
}
shards::Shard::Checks => {
eprintln!("ci shard {shard}/{count}: the ci steps other than the tests");
steps.extend(ci_steps().into_iter().filter(|(name, _)| !TEST_STEPS.contains(name)));
}
}
run_steps(&steps)
}
/// `cargo xtask ci warm`: for each test shard, builds its crates' library and binary tests without
/// running them, then builds what the checks shard builds, so one dependency-cache entry holds the
/// dependencies of every shard with the features that shard builds them with (cargo resolves
/// features over the packages each command selects). The integration tests are left out: they
/// build no dependency that the library tests do not, since both take the crate's dev-dependencies.
fn cmd_ci_warm() -> Result<(), String> {
let checked = shards::run()?;
let mut steps: Vec<Step> = Vec::new();
for shard in checked {
if let shards::Shard::Tests(crates) = shard {
steps.push((
"build tests",
Box::new(move || {
let mut c = cargo();
c.arg("test").args(shards::select(&crates)).args(["--lib", "--bins", "--no-run"]);
run(c, &format!("cargo test --lib --bins --no-run ({})", shards::names(&crates)))
}),
));
}
}
steps.push((
"clippy",
Box::new(|| {
let mut c = cargo();
c.args(["clippy", "--workspace", "--all-targets", "--keep-going"]);
run(c, "cargo clippy --workspace --all-targets --keep-going")
}),
));
steps.push((
"no-bundled-fonts",
Box::new(|| {
let mut c = cargo();
c.args(["test", "-p", "vectorcraft-text", "--no-default-features", "--test", "without_bundled_fonts", "--no-run"]);
run(c, "cargo test -p vectorcraft-text --no-default-features --test without_bundled_fonts --no-run")?;
let mut c = cargo();
c.args(["clippy", "-p", "vectorcraft-ui-egui", "--no-default-features", "--all-targets"]);
run(c, "cargo clippy -p vectorcraft-ui-egui --no-default-features --all-targets")?;
let mut c = cargo();
c.args(["test", "-p", "vectorcraft-ui-egui", "--no-default-features", "--test", "install_fonts", "--no-run"]);
run(c, "cargo test -p vectorcraft-ui-egui --no-default-features --test install_fonts --no-run")
}),
));
steps.push(("wasm", Box::new(cmd_wasm)));
run_steps(&steps)
}
/// Runs `steps` in turn, stopping at the first that fails; the summary names the steps that passed
/// and, after a failure, the one that failed and those skipped.
fn run_steps(steps: &[Step]) -> Result<(), String> {
let mut done = Vec::new();
for (name, f) in steps {
eprintln!("\n=== ci: {name} ===");
if let Err(e) = f() {
println!("\nCI summary:");
for d in &done {
println!(" ok {d}");
}
println!(" FAIL {name}: {e}");
for (n, _) in steps.iter().skip(done.len() + 1) {
println!(" skip {n}");
}
return Err(format!("ci failed at `{name}`"));
}
done.push(*name);
}
println!("\nCI summary: all {} steps passed ({})", done.len(), done.join(", "));
Ok(())
}
/// Every `cargo xtask ci` step, in order.
fn ci_steps() -> Vec<Step> {
vec![
(
"fmt",
Box::new(|| {
@@ -316,25 +457,7 @@ fn cmd_ci() -> Result<(), String> {
("ui-commands", Box::new(|| ui_commands::run(&root(), true))),
("layers", Box::new(cmd_layers)),
("wasm", Box::new(cmd_wasm)),
];
let mut done = Vec::new();
for (name, f) in &steps {
eprintln!("\n=== ci: {name} ===");
if let Err(e) = f() {
println!("\nCI summary:");
for d in &done {
println!(" ok {d}");
}
println!(" FAIL {name}: {e}");
for (n, _) in steps.iter().skip(done.len() + 1) {
println!(" skip {n}");
}
return Err(format!("ci failed at `{name}`"));
}
done.push(*name);
}
println!("\nCI summary: all {} steps passed ({})", done.len(), done.join(", "));
Ok(())
]
}
fn cmd_corpus(download: bool) -> Result<(), String> {
@@ -379,7 +502,12 @@ fn cmd_i18n_report() -> Result<(), String> {
/// differently and recompiled for about 3.5 minutes. Every other test binary runs with no test
/// matching the filter.
fn cmd_ci_i18n_report() -> Result<(), String> {
i18n_report_packages(&["--workspace".to_owned()], "--workspace")
}
/// [`cmd_ci_i18n_report`] for the packages `select` picks (a `ci shard`'s), shown as `shown`.
fn i18n_report_packages(select: &[String], shown: &str) -> Result<(), String> {
let mut c = cargo();
c.args(["test", "--workspace", "--lib", "--bins", "--tests", "--", "i18n::tests::untranslated_report", "--exact", "--nocapture"]);
run(c, "cargo test --workspace --lib --bins --tests -- i18n::tests::untranslated_report --exact --nocapture")
c.arg("test").args(select).args(["--lib", "--bins", "--tests", "--", "i18n::tests::untranslated_report", "--exact", "--nocapture"]);
run(c, &format!("cargo test {shown} --lib --bins --tests -- i18n::tests::untranslated_report --exact --nocapture"))
}
Loaded 100 of 102 files, more files were not shown because too many files have changed in this diff. Show more