mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
Merge main into fix/font-menu-test-order
This commit is contained in:
commit
881a94bce9
88 files changed
+2286
-525
No files matched your search
Generated
+80
-80
@@ -1134,7 +1134,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-automation",
|
||||
"craft-behavior",
|
||||
@@ -1175,7 +1175,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-affinity"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"flate2",
|
||||
@@ -1186,7 +1186,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-appkit"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"block2 0.6.2",
|
||||
"objc2-app-kit 0.3.2",
|
||||
@@ -1196,7 +1196,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-atomic"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"rustix 1.1.6",
|
||||
]
|
||||
@@ -1204,7 +1204,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-automation"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"base64 0.23.1",
|
||||
"craft-behavior",
|
||||
@@ -1229,7 +1229,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-behavior"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"bitflags 2.13.2",
|
||||
@@ -1247,7 +1247,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-browse"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-docpath",
|
||||
@@ -1265,7 +1265,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-cdr"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"flate2",
|
||||
@@ -1274,7 +1274,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-cloud-ui"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"egui",
|
||||
]
|
||||
@@ -1282,7 +1282,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-cms"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"md-5",
|
||||
"rayon",
|
||||
@@ -1291,12 +1291,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-codepage"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
|
||||
[[package]]
|
||||
name = "craft-color-ui"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-cms",
|
||||
@@ -1316,7 +1316,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-control"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"getrandom 0.3.4",
|
||||
"serde",
|
||||
@@ -1326,7 +1326,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-dds"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"rayon",
|
||||
]
|
||||
@@ -1334,7 +1334,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-dialogs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"block2 0.6.2",
|
||||
"craft-atomic",
|
||||
@@ -1359,7 +1359,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-docpath"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
@@ -1367,7 +1367,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-draw"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-color-ui",
|
||||
@@ -1386,7 +1386,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-dxf"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-codepage",
|
||||
"encoding_rs",
|
||||
@@ -1398,12 +1398,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-eps"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
|
||||
[[package]]
|
||||
name = "craft-font-catalog"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"fontique",
|
||||
"harfrust 0.13.3",
|
||||
@@ -1418,7 +1418,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-font-manager"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-font-catalog",
|
||||
@@ -1437,7 +1437,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-font-store"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"cap-primitives",
|
||||
"craft-atomic",
|
||||
@@ -1459,12 +1459,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-fonts-build"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
|
||||
[[package]]
|
||||
name = "craft-gif"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"gif",
|
||||
]
|
||||
@@ -1472,7 +1472,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-gzip"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
]
|
||||
@@ -1480,7 +1480,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-host"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"craft-i18n",
|
||||
@@ -1493,7 +1493,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-i18n"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"fixed_decimal",
|
||||
@@ -1521,7 +1521,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-image-codecs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-dds",
|
||||
"craft-jpeg",
|
||||
@@ -1548,7 +1548,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-imaging"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-color-ui",
|
||||
@@ -1566,7 +1566,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-jpeg"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
@@ -1574,7 +1574,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-jxl"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"brotli-decompressor 5.0.3",
|
||||
"jixel",
|
||||
@@ -1585,7 +1585,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-keymap"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-host",
|
||||
"craft-i18n",
|
||||
@@ -1600,7 +1600,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-layers"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-i18n",
|
||||
@@ -1614,7 +1614,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-menu"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -1632,7 +1632,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-metadata"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"brotli-decompressor 6.3.2",
|
||||
"chrono",
|
||||
@@ -1644,7 +1644,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-metafile"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"encoding_rs",
|
||||
"image",
|
||||
@@ -1655,7 +1655,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-mime"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"craft-codepage",
|
||||
@@ -1665,7 +1665,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-pages"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-keymap",
|
||||
@@ -1681,7 +1681,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-pdf"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"hayro-interpret",
|
||||
"hayro-syntax",
|
||||
@@ -1693,7 +1693,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-platform"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"async-io",
|
||||
@@ -1724,7 +1724,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-plotter"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"kurbo 0.13.1",
|
||||
"thiserror 2.0.21",
|
||||
@@ -1733,7 +1733,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-print"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -1757,7 +1757,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-proof"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"log",
|
||||
"miniz_oxide 0.9.1",
|
||||
@@ -1768,7 +1768,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ps"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-eps",
|
||||
"flate2",
|
||||
@@ -1782,7 +1782,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-psd"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"encoding_rs",
|
||||
"flate2",
|
||||
@@ -1793,7 +1793,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-quit"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"dispatch2",
|
||||
"egui",
|
||||
@@ -1806,7 +1806,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-review"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"base64 0.23.1",
|
||||
"craft-behavior",
|
||||
@@ -1825,7 +1825,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-settings"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-atomic",
|
||||
"craft-host",
|
||||
@@ -1842,7 +1842,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-stream-codecs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"fax",
|
||||
"hayro-ccitt",
|
||||
@@ -1853,7 +1853,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-svg"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-image-codecs",
|
||||
"craft-xml",
|
||||
@@ -1874,7 +1874,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-table"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-keymap",
|
||||
@@ -1886,7 +1886,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-text"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-font-manager",
|
||||
@@ -1911,7 +1911,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-theme"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"craft-tracked",
|
||||
@@ -1926,7 +1926,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-theme-store"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-atomic",
|
||||
"craft-behavior",
|
||||
@@ -1941,7 +1941,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-tiff"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"thiserror 2.0.21",
|
||||
@@ -1951,7 +1951,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-time"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"thiserror 2.0.21",
|
||||
@@ -1960,7 +1960,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-timeline"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-keymap",
|
||||
@@ -1975,12 +1975,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-tracked"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
|
||||
[[package]]
|
||||
name = "craft-ui"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-cloud-ui",
|
||||
"craft-ui-canvas",
|
||||
@@ -1994,7 +1994,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-canvas"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-i18n",
|
||||
@@ -2010,7 +2010,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-contract"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"craft-behavior",
|
||||
@@ -2048,7 +2048,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-macros"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"proc-macro-crate",
|
||||
"proc-macro2",
|
||||
@@ -2059,7 +2059,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-panels"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -2077,7 +2077,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-patterns"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -2098,7 +2098,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-shell"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -2119,7 +2119,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-widgets"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -2138,7 +2138,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-update"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"craft-host",
|
||||
@@ -2167,7 +2167,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-vectorcraft-format"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"serde",
|
||||
@@ -2178,7 +2178,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-wayland"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"raw-window-handle",
|
||||
"wayland-backend",
|
||||
@@ -2188,7 +2188,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-web-api"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"serde_json",
|
||||
@@ -2199,7 +2199,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-win32"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"winsafe",
|
||||
]
|
||||
@@ -2207,7 +2207,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-window"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"craft-appkit",
|
||||
"craft-atomic",
|
||||
@@ -2239,7 +2239,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-xml"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"quick-xml 0.41.0",
|
||||
"serde",
|
||||
@@ -3507,7 +3507,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a"
|
||||
[[package]]
|
||||
name = "hayro-cmap"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"brotli",
|
||||
"hayro-postscript",
|
||||
@@ -3516,7 +3516,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "hayro-interpret"
|
||||
version = "0.7.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"hayro-cmap",
|
||||
@@ -3534,7 +3534,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "hayro-jbig2"
|
||||
version = "0.3.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"fearless_simd",
|
||||
"hayro-ccitt",
|
||||
@@ -3552,12 +3552,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "hayro-postscript"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
|
||||
[[package]]
|
||||
name = "hayro-syntax"
|
||||
version = "0.7.2"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"hayro-ccitt",
|
||||
@@ -4488,7 +4488,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "krilla"
|
||||
version = "0.8.2"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"bumpalo",
|
||||
@@ -4645,7 +4645,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4"
|
||||
[[package]]
|
||||
name = "linesweeper"
|
||||
version = "0.5.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=4bed21baaa41d2b47bef90879c04df521f6f6043#4bed21baaa41d2b47bef90879c04df521f6f6043"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"kurbo 0.13.1",
|
||||
|
||||
+34
-34
@@ -11,44 +11,44 @@ rust-version = "1.95"
|
||||
repository = "https://github.com/storytold/vectorcraft"
|
||||
|
||||
[workspace.dependencies]
|
||||
craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043", default-features = false, features = ["interpret", "write"] }
|
||||
craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0", default-features = false, features = ["interpret", "write"] }
|
||||
craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
# 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 = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
# Native Affinity documents (craft-libs#914).
|
||||
craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
# Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778).
|
||||
craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
# SVG parsing, limits, SVGZ and writer (craft-libs#778).
|
||||
craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043", features = ["tree"] }
|
||||
craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0", features = ["tree"] }
|
||||
craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
# EPS container, previews, ASCII85 and DSC comments (craft-libs#778).
|
||||
craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
# DXF tags, reader and writer (craft-libs#778, #926, #927).
|
||||
craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
# WMF, EMF and EMF+ reader (craft-libs#778).
|
||||
craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043", default-features = false, features = ["read", "write"] }
|
||||
craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0", default-features = false, features = ["read", "write"] }
|
||||
craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
# The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names
|
||||
# the members it imports.
|
||||
craft = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
# Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui
|
||||
# without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes.
|
||||
craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
# internal
|
||||
vectorcraft-geom = { path = "crates/geom" }
|
||||
vectorcraft-color = { path = "crates/color" }
|
||||
@@ -191,13 +191,13 @@ lto = "thin"
|
||||
codegen-units = 1
|
||||
|
||||
[patch.crates-io]
|
||||
hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
krilla = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043" }
|
||||
hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
krilla = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" }
|
||||
ecolor = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" }
|
||||
emath = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" }
|
||||
epaint = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" }
|
||||
|
||||
+4
-3
@@ -2,7 +2,7 @@
|
||||
|
||||
**Stage: alpha** · next: beta, ~13 points (ready for real work ~62% → ~75%, and reliable `.ai` exchange) and ~170–270 h away
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-15 · **Change:** minor (G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); G5 estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: Raster effects 85% → 88%, gallery thumbnails and in-dialog preview in; headline numbers unchanged; Symbols area ~87% → ~88%: dynamic instance parts take opacity, blend, gradient and pattern on the canvas; G5 docs sync for Overlap and Pattern auto corners; previously minor: Tools stays beside the canvas with left-side panels; Hindi catalog draft complete under the translation tests; contributor loanword terminology reviewed; wider proofreading welcome; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; new gradients follow document color mode; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x)
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-22 · **Change:** minor (Upcoming: G11 names what is left (#864's unit preference, #885), not the fixed Shape Builder regions and Asset Export borders, with docs/roadmap.md's 6–13 h, and the Essentials row names Shape Builder's remaining depth, #8314; previously: G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); G5 estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: Raster effects 85% → 88%, gallery thumbnails and in-dialog preview in; headline numbers unchanged; Symbols area ~87% → ~88%: dynamic instance parts take opacity, blend, gradient and pattern on the canvas; G5 docs sync for Overlap and Pattern auto corners; previously minor: Tools stays beside the canvas with left-side panels; Hindi catalog draft complete under the translation tests; contributor loanword terminology reviewed; wider proofreading welcome; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; new gradients follow document color mode; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x)
|
||||
|
||||
VectorCraft is a clean-room, open-source, pure-Rust reimplementation of the Adobe Illustrator workflow. It runs
|
||||
on macOS, Windows, Linux, FreeBSD and the web (WASM), and agents can drive all of it over MCP, the CLI and a JSON
|
||||
@@ -35,7 +35,7 @@ blocking it ([Alpha gate](docs/roadmap.md#alpha-gate)).
|
||||
|---|---:|---:|---:|---|
|
||||
| **Full Illustrator** (ready for real work; decides the stage) | **~62%** (57–67%) | **~340–560 h** | ~95–160 h | the mainstream work below, plus 3D (50–85 h), raster effects (23–39 h), advanced type (20–28 h), generative AI (30–60 h), localization (50–85 h) and ecosystem |
|
||||
| **Mainstream illustrator** | **~65%** (60–70%) | **~230–380 h** | ~65–110 h | the interaction-fidelity pass (60–90 h), hardening and QA (30–50 h), stability (20–35 h), performance budgets (15–25 h), `.ai` exchange (10–20 h), the remaining depth of the everyday areas |
|
||||
| **Essentials user** | **~75%** (70–80%) | **~60–105 h** | ~25–45 h | launch and stability on Windows (20–35 h), in-app help and onboarding (8–15 h), basic QA (10–15 h), Shape Builder regions (4–8 h), UI polish |
|
||||
| **Essentials user** | **~75%** (70–80%) | **~60–105 h** | ~25–45 h | launch and stability on Windows (20–35 h), in-app help and onboarding (8–15 h), basic QA (10–15 h), Shape Builder depth (4–8 h; #937's reproduced case is fixed, unconfirmed on the reporter's file), UI polish |
|
||||
|
||||
Hours are Opus 5.5 agent wall-clock hours, calibrated from this repo's merged-PR timestamps (e.g. 0.7–1.2 h per
|
||||
Photoshop-style filter, ~0.8 h per medium feature); see [calibration](docs/target-app-parity.md#calibration).
|
||||
@@ -119,7 +119,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap
|
||||
1. **Interaction-fidelity pass** (G1), tool by tool from [ui-parity.md](docs/ui-parity.md): 60–90 h.
|
||||
2. **`.ai` files from real users** (G9): layer structure, guides, speed: 10–20 h.
|
||||
3. **Launch and stability on real machines** (G10): 20–35 h.
|
||||
4. **Core-tool correctness** (G11: Shape Builder regions, Asset Export borders): 8–15 h.
|
||||
4. **Core-tool correctness** (G11: the unit preference reverting to points, #864, SVG export units fixed; a Transform effect in a fill's or stroke's own effects, #885; Shape Builder regions and Asset Export borders are fixed): 6–13 h.
|
||||
5. **Then:** type core and advanced type (G4), the Illustrator 2026 additions (G13), 3D (G3). The Effect Gallery's filter thumbnails and in-dialog preview are in (G2).
|
||||
|
||||
## Progress log
|
||||
@@ -251,6 +251,7 @@ The full earlier record of what landed is kept in [docs/roadmap.md](docs/roadmap
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-22 | minor | Upcoming: the G11 item names what is left, the unit preference reverting to points (#864; SVG export units are fixed) and a Transform effect in a fill's or stroke's own effects (#885), instead of Shape Builder regions and Asset Export borders, which are fixed (#937, #983 / #1037); its estimate follows docs/roadmap.md and docs/gaps.md, 8–15 → 6–13 h, #8314. The Essentials readiness row's Shape Builder item names what its 4–8 h still covers (checking #937's fix on the reporter's file, still unconfirmed). Headline numbers unchanged. |
|
||||
| 2026-11-15 | minor | Graphic Styles: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); G5 estimate unchanged (3–13 h). |
|
||||
| 2026-11-14 | minor | Tech Circuit adds three original procedural brushes (Circuit Trace, Bus Lines, Terminal Nodes); ten built-in brush libraries. G5 remaining estimate 3–13 h (estimated); parity scores and headline totals unchanged. |
|
||||
| 2026-11-14 | minor | Gujarati (#6613): contributor proofreading completed for all 387 additions, with 11 wording corrections; 4,673 reviewed catalog rows. Status/error messages remain partial; web selection requires a bundled Gujarati face. Scores and estimates unchanged. |
|
||||
|
||||
@@ -27,7 +27,7 @@ log = { workspace = true }
|
||||
# `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback.
|
||||
eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] }
|
||||
# The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft.
|
||||
craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "4bed21baaa41d2b47bef90879c04df521f6f6043", version = "0.1.0" }
|
||||
craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0", version = "0.1.0" }
|
||||
|
||||
wasm-bindgen = "0.2"
|
||||
serde_json = { workspace = true }
|
||||
|
||||
@@ -398,6 +398,31 @@ pub fn adapter_order(
|
||||
order.into_iter().map(|(i, _)| i).collect()
|
||||
}
|
||||
|
||||
/// [`adapter_order`] without the adapters a restart left out after they failed (`skip`) and those
|
||||
/// that crashed an earlier start (`crashed`), and `true` when that left none and the ones that
|
||||
/// crashed are tried again. A crash record can't stop a start that has no other adapter to try:
|
||||
/// the record may be from a start ended from outside before its first frame (#9183), which looks
|
||||
/// the same as a crash in the driver. An adapter in `skip` failed in this run of the app and
|
||||
/// stays left out.
|
||||
pub fn order_leaving_out(
|
||||
candidates: &[Candidate],
|
||||
power: PowerPreference,
|
||||
displays: &[DisplayGpu],
|
||||
compositor: Option<(u32, u32)>,
|
||||
named: Option<&str>,
|
||||
skip: &[String],
|
||||
crashed: &[String],
|
||||
) -> (Vec<usize>, bool) {
|
||||
let left_out: Vec<String> = skip.iter().chain(crashed).cloned().collect();
|
||||
let order = adapter_order(candidates, power, displays, compositor, named, &left_out);
|
||||
if !order.is_empty() || crashed.is_empty() {
|
||||
return (order, false);
|
||||
}
|
||||
let again = adapter_order(candidates, power, displays, compositor, named, skip);
|
||||
let retried = !again.is_empty();
|
||||
(again, retried)
|
||||
}
|
||||
|
||||
/// wgpu's own ranking for a power preference: the preferred kind of GPU, the other kind, unknown,
|
||||
/// virtual, software.
|
||||
fn power_rank(t: DeviceType, power: PowerPreference) -> u8 {
|
||||
@@ -845,10 +870,9 @@ pub fn selector(
|
||||
) -> NativeAdapterSelectorMethod {
|
||||
let named = std::env::var(NAME_ENV).ok();
|
||||
let skip = skipped();
|
||||
let left_out: Vec<String> = skip.iter().chain(&crashed).cloned().collect();
|
||||
Arc::new(move |adapters, surface| {
|
||||
let candidates: Vec<Candidate> = adapters.iter().map(|a| Candidate::new(a, surface)).collect();
|
||||
let order = adapter_order(&candidates, power, &displays, compositor, named.as_deref(), &left_out);
|
||||
let (order, retried) = order_leaving_out(&candidates, power, &displays, compositor, named.as_deref(), &skip, &crashed);
|
||||
let listed: Vec<String> = candidates
|
||||
.iter()
|
||||
.map(|c| {
|
||||
@@ -872,6 +896,9 @@ pub fn selector(
|
||||
})
|
||||
.collect();
|
||||
log::info!("graphics adapters: {}", listed.join("; "));
|
||||
if retried {
|
||||
log::warn!("every graphics adapter that can show the window crashed an earlier start: trying them again");
|
||||
}
|
||||
let first = order.first().and_then(|&i| adapters.get(i).zip(candidates.get(i)));
|
||||
let Some((adapter, chosen)) = first else {
|
||||
startup.none_left();
|
||||
|
||||
@@ -827,3 +827,17 @@ fn pci_ids_reject_a_sign_in_the_hex_digits() {
|
||||
assert_eq!(pci_ids("PCI\\VEN_+10DE&DEV_2204"), None);
|
||||
assert_eq!(pci_ids("PCI\\VEN_10DE&DEV_+2204"), None);
|
||||
}
|
||||
|
||||
/// #9183: a Mac lists one adapter. A start ended from outside before its first frame left it
|
||||
/// recorded as crashed, and the next start left it out and had nothing to draw on. It is tried
|
||||
/// again when nothing else is left; an adapter a restart left out after it failed stays out, and
|
||||
/// with another adapter to try, the one that crashed is still left out.
|
||||
#[test]
|
||||
fn an_adapter_that_crashed_an_earlier_start_is_tried_again_when_no_other_is_left() {
|
||||
let mac = [gpu("Apple M6", Backend::Metal, DeviceType::IntegratedGpu)];
|
||||
let crashed = vec![mac[0].key.clone()];
|
||||
assert_eq!(order_leaving_out(&mac, PowerPreference::LowPower, &[], None, None, &[], &crashed), (vec![0], true));
|
||||
assert_eq!(order_leaving_out(&mac, PowerPreference::LowPower, &[], None, None, &crashed, &crashed), (vec![], false));
|
||||
let two = [gpu("Apple M6", Backend::Metal, DeviceType::IntegratedGpu), gpu("llvmpipe", Backend::Gl, DeviceType::Cpu)];
|
||||
assert_eq!(order_leaving_out(&two, PowerPreference::LowPower, &[], None, None, &[], &crashed), (vec![1], false));
|
||||
}
|
||||
@@ -2192,6 +2192,13 @@ pub fn blend_steps(keys: &[Arc<Node>], spec: &BlendSpec) -> Vec<usize> {
|
||||
StepCount::default().blend(keys, spec, Rail::new(keys, spec).as_ref()).0
|
||||
}
|
||||
|
||||
/// Most steps the blends in `n` and its subtree make in all when drawn: a step that copies a
|
||||
/// blend counts that blend's steps again, and each instance of a repeat counts its source's
|
||||
/// steps again. Objects that are not blend steps count 0.
|
||||
pub fn blend_steps_made(n: &Node) -> usize {
|
||||
StepCount::default().node(n, false)
|
||||
}
|
||||
|
||||
/// Does each pair of `keys` blended with `spec` ask for the same number of steps
|
||||
/// ([`blend_step_count`]) when each coordinate it counts from moves by up to `length` points and,
|
||||
/// for Smooth Color, the difference between keys of different colors by up to `color` (0 to 1)?
|
||||
|
||||
@@ -96,6 +96,18 @@ impl Unit {
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
/// The SVG length unit an export writes this unit's sizes in: the unit itself when SVG has it,
|
||||
/// else an SVG unit of the same kind (inches for feet and yards, centimeters for meters,
|
||||
/// millimeters for Q and Ha). `None` for points and pixels.
|
||||
pub fn svg_unit(self) -> Option<Unit> {
|
||||
match self {
|
||||
Unit::Millimeters | Unit::Centimeters | Unit::Inches | Unit::Picas => Some(self),
|
||||
Unit::FeetInches | Unit::Feet | Unit::Yards => Some(Unit::Inches),
|
||||
Unit::Meters => Some(Unit::Centimeters),
|
||||
Unit::Q | Unit::Ha => Some(Unit::Millimeters),
|
||||
Unit::Points | Unit::Pixels => None,
|
||||
}
|
||||
}
|
||||
pub const fn label(self) -> &'static str {
|
||||
match self {
|
||||
Unit::Points => "Points",
|
||||
|
||||
@@ -33,7 +33,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Export EPS",
|
||||
[],
|
||||
None,
|
||||
"{path?, level?: 2|3 (default; PostScript language level: 3 writes smooth gradients and masks transparent image pixels out, 2 steps gradients and writes those pixels white), previewFormat?: none|tiffBw|tiffColor (default: a TIFF preview other apps show), transparentPreview?: true (else on white), overprints?: preserve (default)|discard, flattenerPreset?: \"medium\" (default; high, low or a saved preset: flattener.presets.list), flattener?: {the options of object.flattenTransparency over the preset}, embedFonts?: true (type is always written as outlines, so no fonts are needed), includeLinkedFiles?: false (the embedded document keeps linked images whole, not just their previews), thumbnails?: true (a PNG thumbnail in the file), cmykPostScript?: true (RGB documents written in CMYK), compatibleGradients?: false (stepped gradients at level 3 too), selectedOnly?: false, useArtboards?: true (one file per chosen artboard, artboards?/range?, {stem}_{artboard}.eps, the bounding box the artboard; with two or more, also the central file {stem}.eps first: the whole document, the bounding box the visible art; none when no art shows) | false (one file, the bounding box the visible art, y up from the first artboard's bottom-left corner, even when artboards are named; the default when none are named), format?: \"eps\", artboard?: i | artboards?: [i…] | range?: \"1-3, 5\" (the artboards written; naming them without useArtboards works as useArtboards: true)} → {path, bytes, warnings, files?}; no path → {dataBase64, …}. Transparency is flattened with the preset (EPS has none); the native document rides along in comments, for reopening the file as it was. Same as document.export {format: eps}. A key EPS doesn't take, and an unknown key inside flattener, are refused",
|
||||
"{path?, level?: 2|3 (default; PostScript language level: 3 writes smooth gradients and masks transparent image pixels out, 2 steps gradients and writes those pixels white), previewFormat?: none|tiffBw|tiffColor (default: a TIFF preview other apps show), transparentPreview?: true (else on white), overprints?: preserve (default; paper white fills and strokes knock out with document.setup discardWhiteOverprint; white linked to a spot swatch that has a color, at a tint above 0%, still overprints)|discard, flattenerPreset?: \"medium\" (default; high, low or a saved preset: flattener.presets.list), flattener?: {the options of object.flattenTransparency over the preset}, embedFonts?: true (type is always written as outlines, so no fonts are needed), includeLinkedFiles?: false (the embedded document keeps linked images whole, not just their previews), thumbnails?: true (a PNG thumbnail in the file), cmykPostScript?: true (RGB documents written in CMYK), compatibleGradients?: false (stepped gradients at level 3 too), selectedOnly?: false, useArtboards?: true (one file per chosen artboard, artboards?/range?, {stem}_{artboard}.eps, the bounding box the artboard; with two or more, also the central file {stem}.eps first: the whole document, the bounding box the visible art; none when no art shows) | false (one file, the bounding box the visible art, y up from the first artboard's bottom-left corner, even when artboards are named; the default when none are named), format?: \"eps\", artboard?: i | artboards?: [i…] | range?: \"1-3, 5\" (the artboards written; naming them without useArtboards works as useArtboards: true)} → {path, bytes, warnings, files?}; no path → {dataBase64, …}. Transparency is flattened with the preset (EPS has none); the native document rides along in comments, for reopening the file as it was. Same as document.export {format: eps}. A key EPS doesn't take, and an unknown key inside flattener, are refused",
|
||||
has_doc,
|
||||
export_eps
|
||||
)]
|
||||
|
||||
@@ -212,11 +212,29 @@ fn flattening_cropped_art_keeps_the_art_under_its_hidden_part() {
|
||||
fn overprints_are_kept_or_discarded() {
|
||||
let mut s = session(100.0, 100.0, 1);
|
||||
let id = s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 30, "height": 30})).unwrap()["id"].as_u64().unwrap();
|
||||
s.execute("paint.setFill", &json!({"ids": [id], "color": {"c": 100, "m": 0, "y": 0, "k": 0}})).unwrap();
|
||||
s.execute("attributes.set", &json!({"ids": [id], "overprintFill": true})).unwrap();
|
||||
let kept = postscript(&b64(&s.execute("document.exportEps", &json!({"previewFormat": "none"})).unwrap()));
|
||||
assert!(kept.contains("true op\n"), "{kept}");
|
||||
let dropped = postscript(&b64(&s.execute("document.exportEps", &json!({"previewFormat": "none", "overprints": "discard"})).unwrap()));
|
||||
assert!(!dropped.contains("true op"));
|
||||
|
||||
// A white fill or stroke that overprints knocks out with Discard White Overprint (on by
|
||||
// default), and overprints without it, as in PDF export.
|
||||
let white = json!({"c": 0, "m": 0, "y": 0, "k": 0});
|
||||
let filled = [json!({"ids": [id], "color": white}), json!({"ids": [id], "none": true})];
|
||||
let stroked = [json!({"ids": [id], "none": true}), json!({"ids": [id], "color": white})];
|
||||
for (i, [fill, stroke]) in [filled, stroked].iter().enumerate() {
|
||||
s.execute("paint.setFill", fill).unwrap();
|
||||
s.execute("paint.setStroke", stroke).unwrap();
|
||||
s.execute("attributes.set", &json!({"ids": [id], "overprintFill": i == 0, "overprintStroke": i == 1})).unwrap();
|
||||
s.execute("document.setup", &json!({"discardWhiteOverprint": true})).unwrap();
|
||||
let knocked_out = postscript(&b64(&s.execute("document.exportEps", &json!({"previewFormat": "none"})).unwrap()));
|
||||
assert!(!knocked_out.contains("true op"), "{i}: {knocked_out}");
|
||||
s.execute("document.setup", &json!({"discardWhiteOverprint": false})).unwrap();
|
||||
let overprinted = postscript(&b64(&s.execute("document.exportEps", &json!({"previewFormat": "none"})).unwrap()));
|
||||
assert!(overprinted.contains("true op\n"), "{i}: {overprinted}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -156,7 +156,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Artboard Options…",
|
||||
["Window", "Artboards"],
|
||||
None,
|
||||
"{index | artboards: [{index, name?, color?, guideLabel?, locked?, showCenterMark?, showCrossHairs?, showVideoSafeAreas?, videoRulerPixelAspectRatio?, x?, y?, width?, height?}…] (several artboards in one undo step, each with its own fields; the art inside each before any of them changes goes with it, and an object inside several goes with the first listed that moves or scales its art), name?, color?: color (\"#rrggbb\", {c,m,y,k}, … as the paint commands take, #rrggbbaa and #rgba refused: the background color the canvas draws the artboard's paper in, multiplied with the Simulate Colored Paper color while that is on; exports and print leave it out) | null (no background color), guideLabel?: name | \"#rrggbb\" | null (the guide label: the canvas draws the artboard's own guides (guide.add with artboard) in this color instead of the guide color preference, selected ones still in the selection color; a layer color's name spelled exactly as Layer Options lists it (\"Light Blue\", \"Red\", …) or #rrggbb; null for none, which new artboards and older files have; screen-only, so exports and print leave it out; it can change on a locked artboard; an invalid value anywhere in the list changes nothing), locked?: bool (the Artboards panel's lock column: a locked artboard keeps its rectangle (a new x, y, width or height is an error unless locked is false), can't be moved, deleted or cut, and Rearrange and Fit to Artwork Bounds leave it as it is; the art on it (each object of a layer or sublayer whose bounds with strokes overlap it, a group as one object) acts as locked art until it is unlocked: clicks, marquees, select.set, select.all and the tools pass over it (art drawn or pasted onto it stays selected and editable until a selection leaves it out or it is moved off the locked artboards), it is deselected, and when another artboard moves or scales it stays unless lockedAndHidden), showCenterMark?: bool (Artboard Options' Show Center Mark: the canvas draws a mark at the artboard's center), showCrossHairs?: bool (Show Cross Hairs: the canvas draws a line from the middle of each side through the center), showVideoSafeAreas?: bool (Show Video Safe Areas: the canvas draws the action-safe area 3.5% and the title-safe area 5% in from each edge, as EBU R 95 sets them; the three are screen-only, as the artboard's edges are: exports and print leave them out), videoRulerPixelAspectRatio?: number 0.1–10 (Video Ruler Pixel Aspect Ratio: the width of one video pixel over its height, which View › Rulers › Show Video Rulers counts the artboard in; default 1, square pixels), x?, y?, width?, height?, moveArt?: bool (default false; a position-only change moves the contained art with its artboard), scaleArt?: bool (Scale Artwork with Artboard: resized, the artboard takes the art fully inside it (locked and hidden art only with lockedAndHidden?: bool, default prefs moveLockedWithArtboard) and its guides from its old rectangle onto the new one, each side by its own ratio; strokes/corners/patterns as object.scale), strokes?: bool, corners?: bool, patterns?: bool (the three as object.scale, for art that moves or scales with the artboard), lockedAndHidden?: bool (locked and hidden art moves along; default: the preference; recorded in the journal so a replay matches)} → null, or with scaleArt {scaled: the art scaled}; no undo step when nothing changes",
|
||||
"{index | artboards: [{index, name?, color?, guideLabel?, locked?, showCenterMark?, showCrossHairs?, showVideoSafeAreas?, videoRulerPixelAspectRatio?, x?, y?, width?, height?}…] (several artboards in one undo step, each with its own fields; the art inside each before any of them changes goes with it, and an object inside several goes with the first listed that moves or scales its art), name?, color?: color (\"#rrggbb\", {c,m,y,k}, … as the paint commands take, #rrggbbaa and #rgba refused: the background color the canvas draws the artboard's paper in, multiplied with the Simulate Colored Paper color while that is on. Supported artboard exports and printing include it by default. This includes raster exports with `selectedOnly: true` when the output area is an artboard. Set `includeArtboardFill: false` on the export or print command to omit it. Exports cropped to selection bounds, artwork bounds, or an explicit raster region leave it out, as do formats that do not support artboard fills) | null (no background color), guideLabel?: name | \"#rrggbb\" | null (the guide label: the canvas draws the artboard's own guides (guide.add with artboard) in this color instead of the guide color preference, selected ones still in the selection color; a layer color's name spelled exactly as Layer Options lists it (\"Light Blue\", \"Red\", …) or #rrggbb; null for none, which new artboards and older files have; screen-only, so exports and print leave it out; it can change on a locked artboard; an invalid value anywhere in the list changes nothing), locked?: bool (the Artboards panel's lock column: a locked artboard keeps its rectangle (a new x, y, width or height is an error unless locked is false), can't be moved, deleted or cut, and Rearrange and Fit to Artwork Bounds leave it as it is; the art on it (each object of a layer or sublayer whose bounds with strokes overlap it, a group as one object) acts as locked art until it is unlocked: clicks, marquees, select.set, select.all and the tools pass over it (art drawn or pasted onto it stays selected and editable until a selection leaves it out or it is moved off the locked artboards), it is deselected, and when another artboard moves or scales it stays unless lockedAndHidden), showCenterMark?: bool (Artboard Options' Show Center Mark: the canvas draws a mark at the artboard's center), showCrossHairs?: bool (Show Cross Hairs: the canvas draws a line from the middle of each side through the center), showVideoSafeAreas?: bool (Show Video Safe Areas: the canvas draws the action-safe area 3.5% and the title-safe area 5% in from each edge, as EBU R 95 sets them; the three are screen-only, as the artboard's edges are: exports and print leave them out), videoRulerPixelAspectRatio?: number 0.1–10 (Video Ruler Pixel Aspect Ratio: the width of one video pixel over its height, which View › Rulers › Show Video Rulers counts the artboard in; default 1, square pixels), x?, y?, width?, height?, moveArt?: bool (default false; a position-only change moves the contained art with its artboard), scaleArt?: bool (Scale Artwork with Artboard: resized, the artboard takes the art fully inside it (locked and hidden art only with lockedAndHidden?: bool, default prefs moveLockedWithArtboard) and its guides from its old rectangle onto the new one, each side by its own ratio; strokes/corners/patterns as object.scale), strokes?: bool, corners?: bool, patterns?: bool (the three as object.scale, for art that moves or scales with the artboard), lockedAndHidden?: bool (locked and hidden art moves along; default: the preference; recorded in the journal so a replay matches)} → null, or with scaleArt {scaled: the art scaled}; no undo step when nothing changes",
|
||||
has_doc,
|
||||
artboard_set
|
||||
),
|
||||
|
||||
@@ -326,7 +326,7 @@ impl Files {
|
||||
|
||||
/// The options a file of this run is parsed with, preprocessor lines aside.
|
||||
pub(crate) fn options(&self) -> Options {
|
||||
Options { max_source_units: MAX_TOTAL_BYTES, es2015: self.es2015, ..Options::default() }
|
||||
Options { max_source_units: MAX_TOTAL_BYTES, es2015: self.es2015, e4x: true, ..Options::default() }
|
||||
}
|
||||
|
||||
/// The `JSINCLUDE` folders of this process: absolute folders separated by `;`.
|
||||
|
||||
@@ -2009,7 +2009,7 @@ impl Session {
|
||||
// A `.js` script reads ECMAScript 2015; `eval`, `Function`, includes and `$.evalFile` read
|
||||
// code the way the script does.
|
||||
let es2015 = include::es2015_script(request.file.as_deref());
|
||||
let options = Options { max_source_units: include::MAX_TOTAL_BYTES.saturating_mul(2), es2015, ..Options::default() };
|
||||
let options = Options { max_source_units: include::MAX_TOTAL_BYTES.saturating_mul(2), es2015, e4x: true, ..Options::default() };
|
||||
let strict = options.strict;
|
||||
// A kept engine reads each run's code the way that run's script does.
|
||||
let mut realm = match realm {
|
||||
|
||||
@@ -391,6 +391,40 @@ fn a_js_script_reads_optional_chains_and_coalescing_and_a_jsx_script_does_not()
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn every_script_reads_e4x_and_has_the_xml_objects() {
|
||||
let dir = fresh_folder("e4x");
|
||||
let write = |name: &str, text: &str| {
|
||||
let p = dir.join(name);
|
||||
std::fs::write(&p, text).unwrap();
|
||||
p.to_string_lossy().into_owned()
|
||||
};
|
||||
let mut s = two_docs();
|
||||
let path = |p: &str| json!({"path": p});
|
||||
// Script text: literals, selectors, for each and the four constructors.
|
||||
let text = "var x = <list><item id=\"a\">1</item><item id=\"b\">2</item></list>;\n\
|
||||
vc.log(x.item.length() + ' ' + x.item.(@id == 'b').toString() + ' ' + x..item[0].@id);\n\
|
||||
var sum = 0; for each (var i in x.item) sum += Number(i); vc.log(sum);\n\
|
||||
vc.log(new XML('<a><b/></a>').b.length() + new XMLList('<c/><c/>').length());\n\
|
||||
vc.log(new Namespace('p', 'urn:p').prefix + ' ' + new QName('urn:q', 'n').localName + ' ' + isXMLName('ok'));\n\
|
||||
vc.log(typeof setDefaultXMLNamespace + ' ' + (1 < 2));\n";
|
||||
let r = run(&mut s, text).unwrap();
|
||||
assert_eq!(r["log"], json!(["2 2 a", 3, 3, "p n true", "function true"]), "{r}");
|
||||
// A .js file, a file it includes, eval, Function and $.evalFile read XML as well.
|
||||
write("lib.jsxinc", "var fromLib = <lib n=\"7\"/>.@n.toString();\n");
|
||||
write("more.jsx", "<m>{fromLib}</m>.toString();\n");
|
||||
let modern = "#include \"lib.jsxinc\"\nlet tag = <t>{fromLib}</t>;\nvc.log(tag.toString());\n\
|
||||
vc.log(eval('<e>5</e>').toString());\nvc.log(new Function('return <f>6</f>.toString()')());\n\
|
||||
vc.log($.evalFile(File($.fileName).parent + '/more.jsx'));\n";
|
||||
let r = s.execute("script.run", &path(&write("modern.js", modern))).unwrap();
|
||||
assert_eq!(r["log"], json!(["7", "5", "6", "7"]), "{r}");
|
||||
// A named engine first made by a .js run gives a later .jsx run the XML objects too.
|
||||
s.execute("script.run", &path(&write("first.js", "#targetengine xmlkept\nlet k = 1;"))).unwrap();
|
||||
let later = s.execute("script.run", &path(&write("second.jsx", "#targetengine xmlkept\nvc.log(XML('<k>2</k>').toString());"))).unwrap();
|
||||
assert_eq!(later["log"], json!(["2"]), "{later}");
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
}
|
||||
|
||||
/// A new empty folder for test `name`.
|
||||
fn fresh_folder(name: &str) -> std::path::PathBuf {
|
||||
let dir = std::env::temp_dir().join(format!("vc-script-run-{name}-{}", std::process::id()));
|
||||
|
||||
@@ -1463,6 +1463,16 @@ impl Session {
|
||||
}
|
||||
}
|
||||
|
||||
/// The object a click of the active tool at `p` with `mods` would act on
|
||||
/// ([`vectorcraft_tools::Tool::hover_object`]), for Smart Guides › Object Highlighting. None
|
||||
/// while Cmd lends a selection tool to the press ([`Self::lent_tool_at`]).
|
||||
pub fn hover_object(&mut self, p: Point, mods: Mods, view: ViewInfo) -> Option<NodeId> {
|
||||
if mods.cmd && self.lender.is_none() && !self.tool_editing() && self.lent_tool_at(p, &mods, view).is_some() {
|
||||
return None;
|
||||
}
|
||||
self.with_tool_cx(view, |t, cx| t.hover_object(cx, p, mods))
|
||||
}
|
||||
|
||||
pub fn tool_options(&self) -> Value {
|
||||
self.tool.options()
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
//! the tables below, and each name that reaches outside the document has the `outside` id
|
||||
//! `script.check` (`vectorcraft-scriptcheck`) gives it. The names are read from a run: the own
|
||||
//! properties of the global object, of each object or function it holds and of each function's
|
||||
//! `prototype`, with a setter listed again as `name=`. The names a plain `vectorcraft_js::Realm` also
|
||||
//! has are the language's, which reach files and other apps only through the host; `eval` and
|
||||
//! `prototype`, with a setter listed again as `name=`. The names a plain `vectorcraft_js::Realm` with
|
||||
//! E4X also has are the language's, which reach files and other apps only through the host; `eval` and
|
||||
//! `Function` still have rows, since they run code the checker can't read. A name the host adds
|
||||
//! without a row fails the test.
|
||||
|
||||
@@ -11,7 +11,7 @@ use std::collections::BTreeSet;
|
||||
|
||||
use serde_json::json;
|
||||
use vectorcraft_engine::Session;
|
||||
use vectorcraft_js::{DirectiveName, JsValue, Realm};
|
||||
use vectorcraft_js::{DirectiveName, JsValue, Options, Realm};
|
||||
use vectorcraft_scriptcheck::{Limits, check};
|
||||
|
||||
/// The names that reach outside the document: each with a script that uses it and the `outside` id
|
||||
@@ -110,9 +110,9 @@ fn host_names() -> BTreeSet<String> {
|
||||
text.lines().map(str::to_string).collect()
|
||||
}
|
||||
|
||||
/// The names a plain JavaScript engine has.
|
||||
/// The names a plain JavaScript engine with E4X has.
|
||||
fn language_names() -> BTreeSet<String> {
|
||||
match Realm::new().run(LIST) {
|
||||
match Realm::with_options(Options { e4x: true, ..Options::default() }, vectorcraft_js::Limits::default()).run(LIST) {
|
||||
Ok(JsValue::String(text)) => text.lines().map(str::to_string).collect(),
|
||||
other => panic!("no list: {other:?}"),
|
||||
}
|
||||
|
||||
@@ -132,6 +132,15 @@ fn over(under: Option<Paint>, art: &[Node]) -> Document {
|
||||
/// Ink `ink`'s plate of `d` as the print plan separates it for PostScript, and as a PostScript
|
||||
/// separation at `level` read back, both drawn at 1 px a point.
|
||||
fn plate_of(d: &Document, ink: &str, level: Level) -> (Image, Image) {
|
||||
let area = Rect::new(0.0, 0.0, 200.0, 100.0);
|
||||
let (plate, out) = separation(d, ink, level);
|
||||
let back = crate::import(&out.bytes).unwrap().document;
|
||||
(render_region(&plate, area, 1.0), render_region(&back, area, 1.0))
|
||||
}
|
||||
|
||||
/// Ink `ink`'s plate of `d` as the print plan separates it for PostScript, and that plate written
|
||||
/// as a PostScript separation at `level`.
|
||||
fn separation(d: &Document, ink: &str, level: Level) -> (Document, EpsOutput) {
|
||||
let area = Rect::new(0.0, 0.0, 200.0, 100.0);
|
||||
let settings = serde_json::from_value(serde_json::json!({"output": {"mode": "separations"}})).unwrap();
|
||||
let plan = vectorcraft_pdf::plan(d, &vectorcraft_pdf::PrintOptions { settings, postscript: true, ..Default::default() }).unwrap();
|
||||
@@ -151,8 +160,7 @@ fn plate_of(d: &Document, ink: &str, level: Level) -> (Image, Image) {
|
||||
};
|
||||
let out = print(&[page], &[0], &PrintJob { level, ..PrintJob::default() }).unwrap();
|
||||
assert!(level == Level::Three || !text(&out).contains("shfill"), "Level 2 has no smooth shadings");
|
||||
let back = crate::import(&out.bytes).unwrap().document;
|
||||
(render_region(plate, area, 1.0), render_region(&back, area, 1.0))
|
||||
(plate.clone(), out)
|
||||
}
|
||||
|
||||
/// Ink `ink`'s PostScript plate of `art` over a page of 100% `ink` (`under`), checked against the
|
||||
@@ -234,6 +242,44 @@ fn an_overprinting_gradient_keeps_the_ink_below_where_it_puts_none_on_a_postscri
|
||||
assert_keeps_the_ink_below(&cases);
|
||||
}
|
||||
|
||||
/// With Discard White Overprint, a process white fill or stroke marked to overprint knocks out the
|
||||
/// cyan below it on the Cyan plate and is written without overprinting, as in composite output.
|
||||
/// Without the setting, and for a white linked to a spot swatch with a color at a tint above 0%,
|
||||
/// the cyan below it prints.
|
||||
#[test]
|
||||
fn white_overprints_knock_out_on_postscript_plates_with_discard_white_overprint() {
|
||||
let cyan = Paint::solid(Color::cmyk(1.0, 0.0, 0.0, 0.0));
|
||||
let white = Paint::solid(Color::cmyk(0.0, 0.0, 0.0, 0.0));
|
||||
let spot_white = Paint::Solid { color: Color::cmyk(0.0, 0.0, 0.0, 0.0), swatch: Some("White Ink".into()), tint: 1.0 };
|
||||
// The fill is sampled in the rectangle's middle, the stroke on its top edge.
|
||||
let (fill_at, stroke_at) = ((100, 50), (100, 10));
|
||||
let cases = [
|
||||
("process white fill", overprinting(white.clone(), Paint::None), fill_at, true, true),
|
||||
("process white stroke", overprinting(Paint::None, white.clone()), stroke_at, true, true),
|
||||
("process white fill without the setting", overprinting(white.clone(), Paint::None), fill_at, false, false),
|
||||
("process white stroke without the setting", overprinting(Paint::None, white), stroke_at, false, false),
|
||||
("spot white fill", overprinting(spot_white.clone(), Paint::None), fill_at, true, false),
|
||||
("spot white stroke", overprinting(Paint::None, spot_white), stroke_at, true, false),
|
||||
];
|
||||
let mut failed = vec![];
|
||||
for (name, art, (x, y), discard, knocks_out) in cases {
|
||||
let mut d = over(Some(cyan.clone()), &[art]);
|
||||
d.swatches.push(Swatch { name: "White Ink".into(), paint: Paint::solid(Color::cmyk(0.0, 0.0, 0.0, 0.0)), global: true, spot: true });
|
||||
d.setup.discard_white_overprint = discard;
|
||||
for level in [Level::Three, Level::Two] {
|
||||
let (_, printed) = plate_of(&d, "Cyan", level);
|
||||
let paper = printed.over_white(x, y)[0] >= 254;
|
||||
if paper != knocks_out {
|
||||
failed.push(format!("{name} at level {level:?}: knocked out {paper}, expected {knocks_out}"));
|
||||
}
|
||||
if text(&separation(&d, "Cyan", level).1).contains("true op") {
|
||||
failed.push(format!("{name} at level {level:?}: overprints on the plate"));
|
||||
}
|
||||
}
|
||||
}
|
||||
assert!(failed.is_empty(), "{failed:#?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_overprinting_gradient_with_a_hard_stop_at_an_end_keeps_the_ink_below_on_a_postscript_plate() {
|
||||
// Two stops at an end, one with cyan and one without: Level 2's bands pad with the end stop,
|
||||
|
||||
+42
-13
@@ -298,6 +298,8 @@ pub(crate) struct Scene<'a> {
|
||||
/// The gradient being painted overprints on a plate: where it is paper white it puts none of
|
||||
/// the plate's ink down, and the plate below it is left as it is ([`Self::inked_spans`]).
|
||||
keep_below: bool,
|
||||
/// Overprinting is on in the page's graphics state ([`Self::overprint_on`]).
|
||||
overprinting: bool,
|
||||
/// The print job's fonts: type in a solid fill is shown through them (`None`: drawn as
|
||||
/// outlines).
|
||||
fonts: Option<&'a RefCell<FontJob>>,
|
||||
@@ -336,6 +338,7 @@ impl<'a> Scene<'a> {
|
||||
nest: 0,
|
||||
plate: false,
|
||||
keep_below: false,
|
||||
overprinting: false,
|
||||
fonts: None,
|
||||
used: UsedGlyphs::new(),
|
||||
used_order: vec![],
|
||||
@@ -535,11 +538,30 @@ impl<'a> Scene<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Turn overprinting on for one paint (when overprints are preserved); `false` when it stays off.
|
||||
/// Whether a fill or stroke of `paint` marked to overprint (`overprint`) does: not when it is
|
||||
/// paper white with Discard White Overprint in Output (Document Setup); a spot white still
|
||||
/// overprints ([`Self::spot_ink`]). On a plate the colors are already the plate's coverage, and
|
||||
/// the plate's document has already turned overprinting off for each white the setting knocks
|
||||
/// out, so white is not checked there.
|
||||
fn overprints(&self, overprint: bool, paint: &Paint) -> bool {
|
||||
let discarded = !self.plate && self.doc.setup.discard_white_overprint && vectorcraft_doc::overprint::is_white(paint) && !self.spot_ink(paint);
|
||||
overprint && !discarded
|
||||
}
|
||||
|
||||
/// Whether `paint` is a tint above 0% of a spot swatch with a solid color, which the page writes
|
||||
/// as a Separation ink of its own ([`Self::spot_space`]); a link is judged by the first swatch of
|
||||
/// its name.
|
||||
fn spot_ink(&self, paint: &Paint) -> bool {
|
||||
matches!(paint, Paint::Solid { swatch: Some(name), tint, .. } if *tint > 0.0 && self.doc.swatch(name).is_some_and(|s| s.spot && s.paint.color().is_some()))
|
||||
}
|
||||
|
||||
/// Turn overprinting on for one paint (when overprints are preserved); `false` when it stays off
|
||||
/// or is already on (a pattern's tiles inside an overprinting pattern fill).
|
||||
fn overprint_on(&mut self, overprint: bool) -> bool {
|
||||
let on = overprint && self.o.overprint == Overprint::Preserve;
|
||||
let on = overprint && self.o.overprint == Overprint::Preserve && !self.overprinting;
|
||||
if on {
|
||||
self.line("true op");
|
||||
self.overprinting = true;
|
||||
}
|
||||
on
|
||||
}
|
||||
@@ -547,6 +569,7 @@ impl<'a> Scene<'a> {
|
||||
fn overprint_off(&mut self, on: bool) {
|
||||
if on {
|
||||
self.line("false op");
|
||||
self.overprinting = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -611,7 +634,9 @@ impl<'a> Scene<'a> {
|
||||
&& vectorcraft_doc::overprint::is_white(p)
|
||||
&& vectorcraft_doc::overprint::DiscardWhite::of(self.doc).discards(p);
|
||||
let on = self.overprint_on(n.colorize_overprints() && !discarded);
|
||||
self.colorized_image(im, blob, p, on);
|
||||
// Inside an overprinting pattern fill the image overprints with its tiles.
|
||||
let overprinting = self.overprinting;
|
||||
self.colorized_image(im, blob, p, overprinting);
|
||||
self.overprint_off(on);
|
||||
}
|
||||
_ => self.image(&im.key, blob, im.width, im.height, im.xf),
|
||||
@@ -729,7 +754,8 @@ impl<'a> Scene<'a> {
|
||||
match item {
|
||||
AppearanceItem::Fill(fl) if fl.visible && !fl.paint.is_none() => {
|
||||
self.note_item(fl.opacity, fl.blend);
|
||||
self.fill(bp, rule, &fl.paint, bounds, fl.overprint);
|
||||
let overprint = self.overprints(fl.overprint, &fl.paint);
|
||||
self.fill(bp, rule, &fl.paint, bounds, overprint);
|
||||
}
|
||||
AppearanceItem::Stroke(st) if st.visible && !st.paint.is_none() && st.width > 0.0 && st.width.is_finite() => {
|
||||
self.stroke(bp, rule, st, bounds);
|
||||
@@ -812,6 +838,7 @@ impl<'a> Scene<'a> {
|
||||
return;
|
||||
}
|
||||
self.note_item(st.opacity, st.blend);
|
||||
let overprint = self.overprints(st.overprint, &st.paint);
|
||||
let paint_bounds = st.paint_bounds(bounds);
|
||||
let area_paint = match &st.paint {
|
||||
Paint::Pattern { .. } => true,
|
||||
@@ -822,7 +849,7 @@ impl<'a> Scene<'a> {
|
||||
// The area the stroke paints, as Outline Stroke makes it, painted with the pattern's
|
||||
// tiles or the freeform's image.
|
||||
let region = stroke::outline_region(&PathData::from_bezpath(bp), rule, st).to_bezpath();
|
||||
self.fill(®ion, FillRule::NonZero, &st.paint, paint_bounds, st.overprint);
|
||||
self.fill(®ion, FillRule::NonZero, &st.paint, paint_bounds, overprint);
|
||||
return;
|
||||
}
|
||||
let w = stroke::for_writer(bp, st);
|
||||
@@ -847,7 +874,7 @@ impl<'a> Scene<'a> {
|
||||
};
|
||||
match &w.shape {
|
||||
WrittenShape::Stroke { width } => {
|
||||
let on = self.overprint_on(st.overprint);
|
||||
let on = self.overprint_on(overprint);
|
||||
self.line_style(st, *width);
|
||||
match &st.paint {
|
||||
Paint::Solid { color, swatch, tint } => {
|
||||
@@ -861,7 +888,7 @@ impl<'a> Scene<'a> {
|
||||
self.line("q");
|
||||
push_path(&mut self.body, bp);
|
||||
self.line("strokepath W");
|
||||
self.paint_overprinting(st.overprint, p, paint_bounds, w.reach(st, bounds));
|
||||
self.paint_overprinting(overprint, p, paint_bounds, w.reach(st, bounds));
|
||||
self.line("Q");
|
||||
}
|
||||
}
|
||||
@@ -874,14 +901,14 @@ impl<'a> Scene<'a> {
|
||||
push_path(&mut self.body, &ws.clip);
|
||||
self.body.push_str(clip_op(FillRule::NonZero));
|
||||
for (shape, paint) in &ws.slices {
|
||||
self.fill(shape, FillRule::NonZero, paint, shape.bounding_box(), st.overprint);
|
||||
self.fill(shape, FillRule::NonZero, paint, shape.bounding_box(), overprint);
|
||||
}
|
||||
self.line("Q");
|
||||
}
|
||||
}
|
||||
WrittenShape::Fill(outlines) => {
|
||||
for o in outlines {
|
||||
self.fill(o, FillRule::NonZero, &st.paint, paint_bounds, st.overprint);
|
||||
self.fill(o, FillRule::NonZero, &st.paint, paint_bounds, overprint);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -989,12 +1016,13 @@ impl<'a> Scene<'a> {
|
||||
if bp.elements().is_empty() {
|
||||
continue;
|
||||
}
|
||||
let overprint = self.overprints(run.style.overprint_fill, &run.style.fill);
|
||||
if fonts.is_none() {
|
||||
self.fill(&bp, FillRule::NonZero, &run.style.fill, layout.bounds, run.style.overprint_fill);
|
||||
self.fill(&bp, FillRule::NonZero, &run.style.fill, layout.bounds, overprint);
|
||||
} else {
|
||||
self.show(&shown, &run.style.fill, run.style.overprint_fill);
|
||||
self.show(&shown, &run.style.fill, overprint);
|
||||
if !art.elements().is_empty() {
|
||||
self.fill(&art, FillRule::NonZero, &run.style.fill, layout.bounds, run.style.overprint_fill);
|
||||
self.fill(&art, FillRule::NonZero, &run.style.fill, layout.bounds, overprint);
|
||||
}
|
||||
}
|
||||
if run.style.has_stroke() {
|
||||
@@ -1014,7 +1042,8 @@ impl<'a> Scene<'a> {
|
||||
match item {
|
||||
AppearanceItem::Fill(fl) if fl.visible && !fl.paint.is_none() => {
|
||||
self.note_item(fl.opacity, fl.blend);
|
||||
self.fill(bp, FillRule::NonZero, &fl.paint, tb, fl.overprint);
|
||||
let overprint = self.overprints(fl.overprint, &fl.paint);
|
||||
self.fill(bp, FillRule::NonZero, &fl.paint, tb, overprint);
|
||||
}
|
||||
AppearanceItem::Stroke(st) if st.visible && !st.paint.is_none() && st.width > 0.0 && st.width.is_finite() => {
|
||||
self.stroke(bp, FillRule::NonZero, st, tb);
|
||||
|
||||
@@ -448,6 +448,106 @@ fn spot_colours_are_separations_and_overprints_are_kept_or_dropped() {
|
||||
assert!(!page_of(&d, &EpsOptions { overprint: Overprint::Discard, ..opts(&d) }).contains("true op"));
|
||||
}
|
||||
|
||||
/// Whether overprinting is on at each fill a page paints, by its `true op` and `false op` lines.
|
||||
fn overprint_at_fills(page: &str) -> Vec<bool> {
|
||||
let mut on = false;
|
||||
let mut fills = vec![];
|
||||
for line in page.lines() {
|
||||
match line {
|
||||
"true op" => on = true,
|
||||
"false op" => on = false,
|
||||
l if l == "f" || l.ends_with(" f") || l.ends_with(" f*") || l == "f*" => fills.push(on),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
fills
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tiles_overprint_with_their_overprinting_pattern() {
|
||||
// A rectangle filled with an overprinting pattern whose tile is a white square marked to
|
||||
// overprint and then a cyan one that is not.
|
||||
let mut d = doc_with(|_| vec![]);
|
||||
let square = |d: &mut Document, paint: Paint, overprint: bool| {
|
||||
let mut n = path(d, shapes::rectangle(Rect::new(0.0, 0.0, 10.0, 10.0)), paint, Paint::None, 0.0);
|
||||
if let Some(AppearanceItem::Fill(f)) = n.appearance.items.first_mut() {
|
||||
f.overprint = overprint;
|
||||
}
|
||||
Arc::new(n)
|
||||
};
|
||||
let tile = vec![square(&mut d, Paint::solid(Color::WHITE), true), square(&mut d, Paint::solid(Color::cmyk(1.0, 0.0, 0.0, 0.0)), false)];
|
||||
d.patterns.push(vectorcraft_doc::PatternDef::new("tile", tile));
|
||||
let mut n = red_rect(&mut d);
|
||||
if let Some(AppearanceItem::Fill(f)) = n.appearance.items.first_mut() {
|
||||
f.paint = Paint::Pattern { pattern: "tile".into(), xf: Affine::IDENTITY };
|
||||
f.overprint = true;
|
||||
}
|
||||
let layer = d.layers[0].id;
|
||||
d.insert(Some(layer), 0, n).unwrap();
|
||||
// The whole pattern overprints, as in PDF export: the white square's own mark does not turn
|
||||
// overprinting off for the cyan square after it, and Discard White Overprint applies to the
|
||||
// pattern fill, not to its tiles.
|
||||
let fills = overprint_at_fills(&page_of(&d, &opts(&d)));
|
||||
assert!(!fills.is_empty() && fills.iter().all(|&on| on), "{fills:?}");
|
||||
// On a plate too.
|
||||
let plate = crate::scene::Scene::new(&d, &opts(&d)).on_plate(true).run();
|
||||
let fills = overprint_at_fills(&plate.body);
|
||||
assert!(!fills.is_empty() && fills.iter().all(|&on| on), "{fills:?}");
|
||||
}
|
||||
|
||||
/// A white character fill, and a white fill of the type object itself, marked to overprint knock
|
||||
/// out with Discard White Overprint and overprint without it.
|
||||
#[test]
|
||||
fn white_type_fills_knock_out_with_discard_white_overprint() {
|
||||
use vectorcraft_doc::{CharStyle, FillLayer, TextObject};
|
||||
let white = Paint::solid(Color::WHITE);
|
||||
let char_fill = CharStyle { size: 30.0, fill: white.clone(), overprint_fill: true, ..CharStyle::default() };
|
||||
let object_fill = CharStyle { size: 30.0, fill: Paint::None, ..CharStyle::default() };
|
||||
for (i, style) in [char_fill, object_fill].into_iter().enumerate() {
|
||||
let mut d = doc_with(|d| {
|
||||
let mut n = Node::new(d.alloc_id(), NodeKind::Text(Box::new(TextObject::point(Point::new(20.0, 100.0), "AB", style))));
|
||||
if i == 1 {
|
||||
n.appearance.items = vec![AppearanceItem::Fill(FillLayer { overprint: true, ..FillLayer::new(white.clone()) })];
|
||||
}
|
||||
vec![n]
|
||||
});
|
||||
let fills = overprint_at_fills(&page_of(&d, &opts(&d)));
|
||||
assert!(!fills.is_empty() && fills.iter().all(|&on| !on), "{i}: {fills:?}");
|
||||
d.setup.discard_white_overprint = false;
|
||||
let fills = overprint_at_fills(&page_of(&d, &opts(&d)));
|
||||
assert!(!fills.is_empty() && fills.iter().all(|&on| on), "{i}: {fills:?}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Discard White Overprint applies to paper white only: a white fill linked to a spot swatch
|
||||
/// still overprints, at 100% and 50%; one linked to a global process swatch, at a 0% tint of a
|
||||
/// spot swatch, or to a spot swatch without a color (written as process) knocks out.
|
||||
#[test]
|
||||
fn spot_white_fills_overprint_with_discard_white_overprint() {
|
||||
let white = Paint::solid(Color::WHITE);
|
||||
let cases = [
|
||||
(true, white.clone(), 1.0, true),
|
||||
(true, white.clone(), 0.5, true),
|
||||
(false, white.clone(), 1.0, false),
|
||||
(true, white.clone(), 0.0, false),
|
||||
(true, Paint::None, 1.0, false),
|
||||
];
|
||||
for (spot, swatch, tint, overprints) in cases {
|
||||
let mut d = doc_with(|_| vec![]);
|
||||
d.swatches.push(Swatch { name: "White Ink".into(), paint: swatch, global: true, spot });
|
||||
let mut n = red_rect(&mut d);
|
||||
if let Some(AppearanceItem::Fill(f)) = n.appearance.items.first_mut() {
|
||||
f.paint = Paint::Solid { color: Color::WHITE, swatch: Some("White Ink".into()), tint };
|
||||
f.overprint = true;
|
||||
}
|
||||
let layer = d.layers[0].id;
|
||||
d.insert(Some(layer), 0, n).unwrap();
|
||||
assert!(d.setup.discard_white_overprint);
|
||||
let fills = overprint_at_fills(&page_of(&d, &opts(&d)));
|
||||
assert_eq!(fills, vec![overprints], "spot: {spot}, tint: {tint}, expected to overprint: {overprints}");
|
||||
}
|
||||
}
|
||||
|
||||
const GOLD: Color = Color::Cmyk { c: 0.0, m: 0.2, y: 0.8, k: 0.1 };
|
||||
const LEAF: Color = Color::Cmyk { c: 1.0, m: 0.0, y: 1.0, k: 0.0 };
|
||||
|
||||
@@ -1253,6 +1353,27 @@ fn an_overprinting_colorized_image_writes_only_its_process_inks() {
|
||||
assert!(ps.contains("VCdn0 setcolorspace") && ps.contains("/DeviceCMYK setcolorspace"), "{ps}");
|
||||
}
|
||||
|
||||
/// An overprinting colorized image in the tile of an overprinting pattern fill is written in only
|
||||
/// the process inks it puts down, as it is outside a pattern, so the inks below it stay.
|
||||
#[test]
|
||||
fn an_overprinting_colorized_image_in_an_overprinting_pattern_writes_only_its_process_inks() {
|
||||
let mut d = overprinting_colorized_doc(vec![0, 128, 255], Color::cmyk(1.0, 0.0, 0.0, 0.0), true);
|
||||
let id = d.layers[0].children().unwrap()[0].id;
|
||||
let image = d.remove(id).unwrap();
|
||||
d.patterns.push(vectorcraft_doc::PatternDef::new("tile", vec![image]));
|
||||
let mut n = red_rect(&mut d);
|
||||
if let Some(AppearanceItem::Fill(f)) = n.appearance.items.first_mut() {
|
||||
f.paint = Paint::Pattern { pattern: "tile".into(), xf: Affine::IDENTITY };
|
||||
f.overprint = true;
|
||||
}
|
||||
let layer = d.layers[0].id;
|
||||
d.insert(Some(layer), 0, n).unwrap();
|
||||
for level in Level::ALL {
|
||||
let ps = page_of(&d, &EpsOptions { level, ..opts(&d) });
|
||||
assert!(ps.contains("true op") && ps.contains("VCdn0 setcolorspace") && !ps.contains("/DeviceCMYK setcolorspace"), "{level:?}: {ps}");
|
||||
}
|
||||
}
|
||||
|
||||
/// On a separation plate, an overprinting colorized image whose color puts none of the plate's ink
|
||||
/// down is drawn as nothing, so the ink below stays; one that knocks out, or whose overprint is
|
||||
/// discarded, is drawn as paper. (The plate's colors come from the separator, which has already
|
||||
|
||||
@@ -613,26 +613,32 @@ fn an_array_s_spread_is_checked_against_the_elements_it_reads() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn an_index_setter_without_a_getter_does_not_delay_the_spread_s_check() {
|
||||
// A setter does not run when the elements are read, so the array is still checked when
|
||||
// spread begins, on its own and on its prototype.
|
||||
fn an_index_setter_without_a_getter_does_not_run_when_the_array_is_spread() {
|
||||
// The iterator reads the element and the new array defines its own, so a setter on the array
|
||||
// or on its prototype does not run, and the long array ends at the fuel limit.
|
||||
for setter in ["a", "Array.prototype"] {
|
||||
let mut realm = Realm::with_options(es_options(), Limits { fuel: 10_000, ..Limits::default() });
|
||||
let src = format!("var a = []; a.length = 4294967295; Object.defineProperty({setter}, 0, {{ set: function () {{}} }}); [...a]");
|
||||
let src = format!(
|
||||
"var ran = false; var a = []; a.length = 4294967295; Object.defineProperty({setter}, 0, {{ set: function () {{ ran = true; }} }}); [...a]"
|
||||
);
|
||||
let long = realm.run(&src);
|
||||
assert!(is_thrown(&long, "RangeError"), "{setter}: {long:?}");
|
||||
assert!(matches!(&long, Err(e) if e.kind == RunErrorKind::Limit(LimitKind::Fuel)), "{setter}: {long:?}");
|
||||
realm.set_limits(Limits::default());
|
||||
assert_eq!(realm.run("ran"), Ok(JsValue::Bool(false)), "{setter}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_prototype_getter_behind_an_own_element_does_not_delay_the_spread_s_check() {
|
||||
// The array's own element 0 is read instead of the getter on its prototype, so no getter can
|
||||
// shrink it, and it is checked when spread begins.
|
||||
fn a_prototype_getter_behind_an_own_element_is_not_read_by_the_spread() {
|
||||
// The array's own element 0 is read instead of the getter on its prototype, so the getter does
|
||||
// not shrink it, and the long array ends at the fuel limit.
|
||||
let mut realm = Realm::with_options(es_options(), Limits { fuel: 10_000, ..Limits::default() });
|
||||
let src = "var a = [7]; Object.defineProperty(Array.prototype, 0, { get: function () { a.length = 1; return 0; } }); \
|
||||
a.length = 4294967295; [...a]";
|
||||
let long = realm.run(src);
|
||||
assert!(is_thrown(&long, "RangeError"), "{long:?}");
|
||||
assert!(matches!(&long, Err(e) if e.kind == RunErrorKind::Limit(LimitKind::Fuel)), "{long:?}");
|
||||
realm.set_limits(Limits::default());
|
||||
assert_eq!(realm.run("a.length"), Ok(JsValue::Number(4294967295.0)));
|
||||
// A getter on the prototype with no own element in front of it is read, and shrinks the array.
|
||||
let shrink = "var a = []; a.length = 4294967295; \
|
||||
Object.defineProperty(Array.prototype, 0, { get: function () { a.length = 1; return 7; } }); \
|
||||
@@ -640,20 +646,6 @@ fn a_prototype_getter_behind_an_own_element_does_not_delay_the_spread_s_check()
|
||||
truth(shrink);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn looking_for_index_getters_takes_fuel_for_each_property() {
|
||||
// Each attempt to spread the long array looks at every one of its 10,000 elements, so each
|
||||
// takes at least that much fuel.
|
||||
let fuel = 10_000_000;
|
||||
let mut realm = Realm::with_options(es_options(), Limits { fuel, ..Limits::default() });
|
||||
let setup = "var a = []; for (var i = 0; i < 10000; i++) a[i] = i; a.length = 4294967295; 0";
|
||||
assert_eq!(realm.run(setup), Ok(JsValue::Number(0.0)));
|
||||
let attempt = "var ok = false; try { [...a]; } catch (e) { ok = e instanceof RangeError; } ok";
|
||||
assert_eq!(realm.run(attempt), Ok(JsValue::Bool(true)));
|
||||
let used = fuel - realm.interp().fuel;
|
||||
assert!(used >= 10_000, "{used}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn spread_counts_each_index_name_against_the_heap() {
|
||||
// The elements' properties, with their index names and a string's characters, fit in the
|
||||
|
||||
@@ -238,8 +238,9 @@ impl<'a> Separator<'a> {
|
||||
|
||||
/// Overprinting fills and strokes of `a`'s subtree with a Normal blending mode, and
|
||||
/// overprinting character fills and strokes, that put none of ink `plate` down leave its plate
|
||||
/// as it is: they are drawn as nothing on it (paper white ones that `discard_white` knocks out
|
||||
/// aside, [`DiscardWhite::discards`]). A writer without blending modes (PostScript) then keeps the ink below them,
|
||||
/// as it is: they are drawn as nothing on it. Paper white ones that `discard_white` knocks out
|
||||
/// ([`DiscardWhite::discards`]) stop overprinting instead, and knock out the ink below them on
|
||||
/// the plate as in composite output. A writer without blending modes (PostScript) then keeps the ink below them,
|
||||
/// where it would draw their Darken as a knockout. One that puts any ink down is drawn, and on
|
||||
/// a PostScript plate its ink replaces the ink below, as a nonzero component of an overprinting
|
||||
/// color replaces the backdrop's with overprint mode 1 (ISO 32000-1, 11.7.4.2). On a
|
||||
@@ -259,6 +260,9 @@ impl<'a> Separator<'a> {
|
||||
}
|
||||
let image = whole && n.extras().colorize.as_deref().is_some_and(|p| self.no_ink(plate, p));
|
||||
for it in &mut n.appearance.items {
|
||||
if it.overprint() && discard_white.discards(it.paint()) {
|
||||
*it.overprint_mut() = false;
|
||||
}
|
||||
let normal = match it {
|
||||
AppearanceItem::Fill(l) => l.blend == BlendMode::Normal,
|
||||
AppearanceItem::Stroke(l) => l.blend == BlendMode::Normal,
|
||||
@@ -274,6 +278,8 @@ impl<'a> Separator<'a> {
|
||||
}
|
||||
if let NodeKind::Text(t) = &mut n.kind {
|
||||
for r in &mut t.runs {
|
||||
r.style.overprint_fill &= !discard_white.discards(&r.style.fill);
|
||||
r.style.overprint_stroke &= !discard_white.discards(&r.style.stroke);
|
||||
if inkless(r.style.overprint_fill, &r.style.fill) {
|
||||
r.style.fill = Paint::None;
|
||||
} else if r.style.overprint_fill {
|
||||
|
||||
@@ -164,7 +164,7 @@ features! {
|
||||
DollarEnv "dollar.env" Files,
|
||||
DollarEvalFile "dollar.evalFile" Files,
|
||||
DynamicCode "dynamicCode" Language,
|
||||
E4x "e4x" HostOnly,
|
||||
E4x "e4x" Language,
|
||||
ExternalObject "externalObject" HostOnly,
|
||||
FileDialog "file.dialog" Files,
|
||||
FileExecute "file.execute" Files,
|
||||
@@ -186,6 +186,6 @@ features! {
|
||||
SelectTool "selectTool" HostOnly,
|
||||
Socket "socket" HostOnly,
|
||||
UnitValue "unitValue" Language,
|
||||
Xml "xml" HostOnly,
|
||||
Xml "xml" Language,
|
||||
Xmp "xmp" HostOnly,
|
||||
}
|
||||
@@ -109,7 +109,8 @@ impl Kind {
|
||||
/// A kind of help a script needs from the app that runs it.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub enum Need {
|
||||
/// The script language's own objects and directives (`$`, `alert`, `UnitValue`, `#target`).
|
||||
/// The script language's own objects, syntax and directives (`$`, `alert`, `UnitValue`, E4X
|
||||
/// with the `XML` object, `#target`).
|
||||
Language,
|
||||
/// The reference app's document model (`app.activeDocument…`).
|
||||
Dom,
|
||||
@@ -120,7 +121,7 @@ pub enum Need {
|
||||
/// Dialogs and windows of its own.
|
||||
Dialogs,
|
||||
/// Features only the reference app has (palettes, messages to other apps, network
|
||||
/// connections, native code, E4X, actions).
|
||||
/// connections, native code, actions).
|
||||
HostOnly,
|
||||
}
|
||||
|
||||
|
||||
@@ -1550,6 +1550,13 @@ fn application_methods_are_features_not_members() {
|
||||
assert_eq!(r.needs, [Need::MenuCommands, Need::HostOnly]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn e4x_and_the_xml_object_need_only_the_language() {
|
||||
let r = report("var x = <a><b/></a>;\nvar y = new XML(s);\nfor each (var v in x.b) {}\n");
|
||||
assert!(feature(&r, "e4x").is_some() && feature(&r, "xml").is_some());
|
||||
assert_eq!(r.needs, [Need::Language]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn type_names_compared_or_created_are_listed() {
|
||||
let r = report(concat!(
|
||||
|
||||
@@ -195,9 +195,9 @@ fn write(doc: &Document, opts: &ExportOptions, native: Option<&[u8]>, id_prefix:
|
||||
root = root.attr("version", "1.2").attr("baseProfile", "tiny");
|
||||
}
|
||||
if !opts.responsive {
|
||||
if let Some(suffix) = doc.units.svg_suffix() {
|
||||
let w_val = physical_num(doc.units.from_pt(rect.width()));
|
||||
let h_val = physical_num(doc.units.from_pt(rect.height()));
|
||||
if let Some((unit, suffix)) = doc.units.svg_unit().and_then(|u| Some((u, u.svg_suffix()?))) {
|
||||
let w_val = physical_num(unit.from_pt(rect.width()));
|
||||
let h_val = physical_num(unit.from_pt(rect.height()));
|
||||
root = root.attr("width", format_args!("{w_val}{suffix}")).attr("height", format_args!("{h_val}{suffix}"));
|
||||
} else {
|
||||
root = root.attr("width", &ww).attr("height", &hh);
|
||||
|
||||
@@ -192,3 +192,28 @@ fn export_physical_units_writes_unit_suffixes() {
|
||||
let back = import(&s).unwrap();
|
||||
assert_eq!(back.units, Unit::Millimeters);
|
||||
}
|
||||
|
||||
/// The `width` of `svg`'s root as a length in points, read by the SVG and CSS absolute units
|
||||
/// (96 px per inch). `None` when it has no unit an SVG reader takes as physical.
|
||||
fn root_width_in_points(svg: &str) -> Option<f64> {
|
||||
let start = svg.find("<svg")?;
|
||||
let w = svg[start..].split("width=\"").nth(1)?.split('"').next()?;
|
||||
let (points_per_unit, number) = [("mm", 72.0 / 25.4), ("cm", 72.0 / 2.54), ("in", 72.0), ("pc", 12.0), ("pt", 1.0)]
|
||||
.into_iter()
|
||||
.find_map(|(suffix, pt)| w.strip_suffix(suffix).map(|v| (pt, v)))?;
|
||||
number.parse::<f64>().ok().map(|v| v * points_per_unit)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn every_physical_document_unit_exports_its_printed_size() {
|
||||
// 100 inches by 50: feet, yards, meters, Q and Ha have no SVG unit of their own.
|
||||
for unit in [Unit::Feet, Unit::FeetInches, Unit::Yards, Unit::Meters, Unit::Q, Unit::Ha, Unit::Inches, Unit::Millimeters] {
|
||||
let mut d = Document::new(7200.0, 3600.0);
|
||||
d.units = unit;
|
||||
let s = export(&d, &ExportOptions::default());
|
||||
let width = root_width_in_points(&s).unwrap_or_else(|| panic!("{unit:?}: no physical width in {s}"));
|
||||
assert!((width - 7200.0).abs() < 0.01, "{unit:?}: {width} pt in {s}");
|
||||
let back = import(&s).unwrap();
|
||||
assert!(close_rect(back.artboards[0].rect, d.artboards[0].rect), "{unit:?}: {:?}", back.artboards[0].rect);
|
||||
}
|
||||
}
|
||||
@@ -83,6 +83,7 @@ pub(super) fn make_face(bytes: FontBytes, index: u32, spec: FaceStyle, path: Opt
|
||||
unencoded: std::sync::OnceLock::new(),
|
||||
char_list: std::sync::OnceLock::new(),
|
||||
named_chars: std::sync::OnceLock::new(),
|
||||
glyph_names: std::sync::OnceLock::new(),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -210,6 +210,8 @@ pub struct FontFace {
|
||||
pub(super) char_list: std::sync::OnceLock<Arc<[(char, u32)]>>,
|
||||
/// [`Self::name_owner`]'s glyph names to characters, read once.
|
||||
pub(super) named_chars: std::sync::OnceLock<std::collections::HashMap<String, char>>,
|
||||
/// [`Self::glyph_name`]'s names by glyph id, read once.
|
||||
pub(super) glyph_names: std::sync::OnceLock<Vec<Option<Box<str>>>>,
|
||||
}
|
||||
|
||||
impl vectorcraft_doc::FileFontFace for FontFace {
|
||||
|
||||
@@ -589,11 +589,23 @@ impl FontFace {
|
||||
}
|
||||
|
||||
/// The name of glyph `gid` from the font's `post` or `CFF` table: `None` for a glyph past the
|
||||
/// face's glyphs, or when the font has no names (the ids are then `gid12`).
|
||||
/// face's glyphs, or when the font has no names (the ids are then `gid12`). The names are read
|
||||
/// once for the face, in one pass over the table.
|
||||
pub fn glyph_name(&self, gid: u32) -> Option<String> {
|
||||
let font = self.skrifa()?;
|
||||
let name = font.glyph_names().get(skrifa::GlyphId::new(gid))?;
|
||||
(!name.is_synthesized()).then(|| name.as_str().to_string())
|
||||
let names = self.glyph_names.get_or_init(|| {
|
||||
let Some(font) = self.skrifa() else { return Vec::new() };
|
||||
let names = font.glyph_names();
|
||||
let mut out = vec![None; names.num_glyphs() as usize];
|
||||
for (id, name) in names.iter() {
|
||||
if let Some(slot) = out.get_mut(id.to_u32() as usize)
|
||||
&& !name.is_synthesized()
|
||||
{
|
||||
*slot = Some(Box::from(name.as_str()));
|
||||
}
|
||||
}
|
||||
out
|
||||
});
|
||||
names.get(usize::try_from(gid).ok()?)?.as_deref().map(str::to_string)
|
||||
}
|
||||
|
||||
/// The kinds of glyph the face's `GSUB` table gives ([`GlyphCategoryKind`]), in the order of
|
||||
@@ -651,6 +663,28 @@ mod tests {
|
||||
assert!(face.glyph_categories().is_empty());
|
||||
}
|
||||
|
||||
/// The names read in one pass are the names the font gives each glyph id, for every bundled
|
||||
/// face, and a glyph past the face's glyphs has none.
|
||||
#[test]
|
||||
fn glyph_names_read_once_match_each_glyphs_own_name() {
|
||||
let db = super::super::FontDb::with_font_dirs(vec![]);
|
||||
let mut checked = 0;
|
||||
for family in db.families() {
|
||||
for style in db.styles(&family) {
|
||||
let Some(face) = db.face(&family, &style) else { continue };
|
||||
let Some(font) = face.skrifa() else { continue };
|
||||
let names = font.glyph_names();
|
||||
for gid in 0..face.glyph_count() {
|
||||
let own = names.get(skrifa::GlyphId::new(gid)).filter(|n| !n.is_synthesized()).map(|n| n.as_str().to_string());
|
||||
assert_eq!(face.glyph_name(gid), own, "{family} {style}: glyph {gid}");
|
||||
checked += 1;
|
||||
}
|
||||
assert_eq!(face.glyph_name(face.glyph_count()), None, "{family} {style}");
|
||||
}
|
||||
}
|
||||
assert!(checked > 0, "the bundled faces have glyphs");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn kinds_round_trip_through_their_ids() {
|
||||
for kind in GlyphCategoryKind::all() {
|
||||
|
||||
@@ -267,6 +267,12 @@ pub trait Tool: Send {
|
||||
fn wants_rehover(&self) -> bool {
|
||||
false
|
||||
}
|
||||
/// The object a click at `p` with `mods` would act on, which Smart Guides › Object
|
||||
/// Highlighting outlines while the pointer rests there (the Eyedropper's source). None when a
|
||||
/// click there acts on no object, or the tool does not name one.
|
||||
fn hover_object(&self, _cx: &ToolContext, _p: Point, _mods: Mods) -> Option<NodeId> {
|
||||
None
|
||||
}
|
||||
/// What the Info panel shows for the tool as it is now: the drag in progress (a move of the
|
||||
/// selection, a gradient vector, a handle the Pen pulls out, a Scale, Rotate, Reflect or Shear
|
||||
/// tool drag), or the Paintbrush's brush. None for a tool with nothing of its own to show.
|
||||
|
||||
@@ -1675,15 +1675,22 @@ fn object_behind(cx: &ToolContext, p: Point) -> Option<NodeId> {
|
||||
/// member with only some anchors or segments selected does not count: the press selects `top`.
|
||||
/// A member with every anchor selected (as `select.anchors` and `select.key` leave a path) counts.
|
||||
fn selected_under(cx: &ToolContext, h: &Hit, top: NodeId) -> Option<NodeId> {
|
||||
if cx.selection.contains(top) {
|
||||
selected_under_in(cx.doc, cx.selection, h, top)
|
||||
}
|
||||
|
||||
/// [`selected_under`] in `doc` with `selection`: the selected object a Selection tool press on
|
||||
/// `h` lands on, where `top` is the object the press would select. The canvas's hover outline
|
||||
/// outlines nothing where this finds an object.
|
||||
pub fn selected_under_in(doc: &vectorcraft_doc::Document, selection: &vectorcraft_doc::Selection, h: &Hit, top: NodeId) -> Option<NodeId> {
|
||||
if selection.contains(top) {
|
||||
return Some(top);
|
||||
}
|
||||
let every_anchor = |id: NodeId| {
|
||||
cx.selection
|
||||
selection
|
||||
.partial(id)
|
||||
.is_none_or(|picked| cx.doc.node(id).and_then(|n| n.path_data()).is_some_and(|p| p.anchors().all(|(s, i, _)| picked.contains(&(s, i)))))
|
||||
.is_none_or(|picked| doc.node(id).and_then(|n| n.path_data()).is_some_and(|p| p.anchors().all(|(s, i, _)| picked.contains(&(s, i)))))
|
||||
};
|
||||
let whole = |id: NodeId| cx.selection.contains(id) && every_anchor(id) && !cx.selection.segments.contains_key(&id);
|
||||
let whole = |id: NodeId| selection.contains(id) && every_anchor(id) && !selection.segments.contains_key(&id);
|
||||
let below = h.ancestry.iter().position(|id| *id == top).map_or(&[][..], |i| h.ancestry.get(i..).unwrap_or_default());
|
||||
below.iter().copied().chain(std::iter::once(h.leaf)).find(|id| whole(*id))
|
||||
}
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
//! Image Trace's Ignore Color eyedropper passes its bound document point to the panel, which
|
||||
//! samples the original image pixels and ends the pick only when a color is accepted. A miss
|
||||
//! stays armed; this tool changes neither paint nor selection.
|
||||
//!
|
||||
//! The object a click at the pointer would act on, with the keys held, is the tool's hover object
|
||||
//! ([`Tool::hover_object`]), which Smart Guides › Object Highlighting outlines.
|
||||
|
||||
use std::collections::HashSet;
|
||||
|
||||
@@ -165,6 +168,12 @@ pub(crate) fn sample_source(cx: &ToolContext, p: Point) -> Option<(vectorcraft_d
|
||||
/// The visible color under `p`, including image pixels, pattern tiles, mesh colors, intermediate
|
||||
/// gradient colors, the steps a blend draws and an envelope's distorted contents.
|
||||
pub(crate) fn sample_color_at(cx: &ToolContext, p: Point) -> Option<Color> {
|
||||
sample_at(cx, p).map(|(c, _)| c)
|
||||
}
|
||||
|
||||
/// [`sample_color_at`] with the object of the document that gives the color: the object hit, the
|
||||
/// blend or envelope whose art is sampled, or an object below them that was passed over to.
|
||||
fn sample_at(cx: &ToolContext, p: Point) -> Option<(Color, NodeId)> {
|
||||
let (doc, opts, raster_sample) = (cx.doc, sample_options(cx), cx.raster_sample);
|
||||
vectorcraft_doc::depth::with_deep_stack(|| {
|
||||
let symbol_nodes = doc.symbols.iter().map(|s| s.art.count()).sum();
|
||||
@@ -175,13 +184,13 @@ pub(crate) fn sample_color_at(cx: &ToolContext, p: Point) -> Option<Color> {
|
||||
})
|
||||
}
|
||||
|
||||
/// The color the front-most object of `doc` hit at `p` with `opts` shows there. Where a stroke
|
||||
/// The color the front-most object of `doc` hit at `p` with `opts` shows there, and that object. Where a stroke
|
||||
/// gives no color at `p` (a gap between its pattern's tiles), the object's own fill there does;
|
||||
/// an object that gives none at all is passed over for the ones below it. A hit on a blend or an
|
||||
/// envelope, or on an object it holds, samples the art it draws ([`live_color_at`]), and where
|
||||
/// that art leaves `p` empty the whole blend or envelope is passed over. `levels` holds the
|
||||
/// scratch documents for art inside art, one for each level deeper.
|
||||
fn color_under(s: &mut Sampler, doc: &Document, levels: &mut [Option<Document>], p: Point, opts: HitOptions) -> Option<Color> {
|
||||
fn color_under(s: &mut Sampler, doc: &Document, levels: &mut [Option<Document>], p: Point, opts: HitOptions) -> Option<(Color, NodeId)> {
|
||||
let mut passed: HashSet<NodeId> = HashSet::new();
|
||||
let mut size = None;
|
||||
loop {
|
||||
@@ -197,7 +206,7 @@ fn color_under(s: &mut Sampler, doc: &Document, levels: &mut [Option<Document>],
|
||||
let h = hit_test_visible_skipping(doc, p, opts, &|id| passed.contains(&id))?;
|
||||
if let Some(live) = drawn_live(doc, &h.ancestry) {
|
||||
if let Some(c) = live_color_at(s, levels, live, p) {
|
||||
return Some(c);
|
||||
return Some((c, live.id));
|
||||
}
|
||||
if !passed.insert(live.id) {
|
||||
return None;
|
||||
@@ -208,13 +217,13 @@ fn color_under(s: &mut Sampler, doc: &Document, levels: &mut [Option<Document>],
|
||||
let n = doc.node(id)?;
|
||||
let on_stroke = h.kind == HitKind::Stroke;
|
||||
if let Some(c) = node_color_at(s, levels, n, on_stroke, p) {
|
||||
return Some(c);
|
||||
return Some((c, id));
|
||||
}
|
||||
if on_stroke
|
||||
&& fill_covers(n, p)
|
||||
&& let Some(c) = node_color_at(s, levels, n, false, p)
|
||||
{
|
||||
return Some(c);
|
||||
return Some((c, id));
|
||||
}
|
||||
if !passed.insert(id) {
|
||||
return None;
|
||||
@@ -240,14 +249,28 @@ fn drawn_live<'d>(doc: &'d Document, ancestry: &[NodeId]) -> Option<&'d Node> {
|
||||
/// The color the art blend or envelope `n` draws shows at `p`, sampled as [`art_color_at`] samples
|
||||
/// art: a blend's keys and steps, an envelope's distorted contents, symbol instances in them by
|
||||
/// their symbols' art. Evaluating it counts the objects it holds, and the art made counts its
|
||||
/// objects.
|
||||
/// objects. When less work is left than the steps of its blends make in all, the steps that copy
|
||||
/// a nested blend included ([`vectorcraft_doc::blend::blend_steps_made`]), it is not evaluated.
|
||||
fn live_color_at(s: &mut Sampler, levels: &mut [Option<Document>], n: &Node, p: Point) -> Option<Color> {
|
||||
let steps = vectorcraft_doc::blend::blend_steps_made(n);
|
||||
if s.work < steps {
|
||||
// Too little work is left for the steps the blends make.
|
||||
s.spend(steps)?;
|
||||
}
|
||||
s.spend(n.count())?;
|
||||
#[cfg(test)]
|
||||
EXPANSIONS.with(|e| e.set(e.get() + 1));
|
||||
let art = vectorcraft_effects::expand_live_deep(Some(s.doc), n);
|
||||
s.spend(art.count())?;
|
||||
art_color_at(s, levels, [art], p)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
thread_local! {
|
||||
/// The blends and envelopes [`live_color_at`] has evaluated on this thread.
|
||||
static EXPANSIONS: std::cell::Cell<usize> = const { std::cell::Cell::new(0) };
|
||||
}
|
||||
|
||||
/// The color `n` shows at `p`: an image's pixels, a mesh's interpolated patch color, a symbol
|
||||
/// instance's art, or the color of its fill (or its stroke, when the stroke was hit or there is no
|
||||
/// fill) there. Images, symbols and patterns are looked up in the sampled document.
|
||||
@@ -464,7 +487,7 @@ fn art_color_at(s: &mut Sampler, levels: &mut [Option<Document>], art: impl Into
|
||||
scratch.insert(Some(layer), usize::MAX, n).ok()?;
|
||||
}
|
||||
let opts = HitOptions { scope: None, tol: 0.0, outline: false, ..s.opts };
|
||||
color_under(s, scratch, deeper, p, opts)
|
||||
color_under(s, scratch, deeper, p, opts).map(|(c, _)| c)
|
||||
}
|
||||
|
||||
/// Gives `n` and everything in it new ids from `doc` (pattern instances all have id 0).
|
||||
@@ -524,72 +547,50 @@ impl Tool for EyedropperTool {
|
||||
if ev.kind != PointerKind::Down {
|
||||
return vec![];
|
||||
}
|
||||
if let Some(binding) = &self.image_trace_ignore_color {
|
||||
// The panel knows whether this hits an opaque source pixel. It clears the binding
|
||||
// and restores the previous tool only after accepting a color, not on a miss.
|
||||
return vec![Action::Dialog("imageTraceIgnoreColor".into(), json!({ "binding": binding, "point": [ev.pos.x, ev.pos.y] }))];
|
||||
let Some(click) = self.click(cx, ev.pos, ev.mods) else { return vec![] };
|
||||
match click {
|
||||
Click::ImageTrace(binding) => {
|
||||
// The panel knows whether this hits an opaque source pixel. It clears the binding
|
||||
// and restores the previous tool only after accepting a color, not on a miss.
|
||||
vec![Action::Dialog("imageTraceIgnoreColor".into(), json!({ "binding": binding, "point": [ev.pos.x, ev.pos.y] }))]
|
||||
}
|
||||
Click::BrushKeyColor(c, _) => {
|
||||
let back = self.stop.take().unwrap_or_else(|| "selection".to_string());
|
||||
self.brush_key_color = false;
|
||||
vec![Action::Dialog("brushKeyColor".into(), json!({ "color": color_json(&c) })), Action::SwitchTool(back)]
|
||||
}
|
||||
Click::BackToBucket => {
|
||||
self.stop = None;
|
||||
vec![Action::SwitchTool("livePaintBucket".into())]
|
||||
}
|
||||
Click::MeshPoints(id, points, color) => {
|
||||
let params = json!({ "id": id.0, "points": points, "color": color_json(&color), "keepModel": true });
|
||||
vec![Action::Exec("object.mesh.setPointColor".into(), params)]
|
||||
}
|
||||
Click::CopyFrom(src, how) => {
|
||||
let params = match how {
|
||||
Some(how) => json!({ "source": src.0, how: true }),
|
||||
None => json!({ "source": src.0 }),
|
||||
};
|
||||
vec![Action::Exec("appearance.copyFrom".into(), params)]
|
||||
}
|
||||
Click::Sample { color, meshes, stop, .. } => {
|
||||
let color = color_json(&color);
|
||||
if !meshes.is_empty() {
|
||||
let ids: Vec<u64> = meshes.iter().map(|id| id.0).collect();
|
||||
return vec![Action::Exec("paint.sampleColor".into(), json!({ "color": color, "stroke": false, "ids": ids }))];
|
||||
}
|
||||
let Some((back, i)) = stop else { return vec![Action::Exec("paint.sampleColor".into(), json!({ "color": color }))] };
|
||||
self.stop = None;
|
||||
vec![Action::Exec("paint.sampleColor".into(), json!({ "color": color, "stop": i })), Action::SwitchTool(back)]
|
||||
}
|
||||
}
|
||||
let opts = sample_options(cx);
|
||||
if self.brush_key_color {
|
||||
let Some(c) = sample_color_at(cx, ev.pos) else { return vec![] };
|
||||
let back = self.stop.clone().unwrap_or_else(|| "selection".to_string());
|
||||
self.brush_key_color = false;
|
||||
self.stop = None;
|
||||
return vec![Action::Dialog("brushKeyColor".into(), json!({ "color": color_json(&c) })), Action::SwitchTool(back)];
|
||||
}
|
||||
// A pick for a stop of the Live Paint Bucket's gradient (the default paint's) ends without
|
||||
// sampling once that stop is no longer selected (a Cmd-click selected another object) or no
|
||||
// longer there (another paint was chosen): the click switches back.
|
||||
let bucket_paint = if cx.fill_active { &cx.paint.fill } else { &cx.paint.stroke };
|
||||
let bucket_stop = cx.gradient_stop.filter(|i| matches!(bucket_paint, Paint::Gradient(g) if *i < g.gradient.stops.len()));
|
||||
if self.stop.as_deref() == Some("livePaintBucket") && bucket_stop.is_none() {
|
||||
self.stop = None;
|
||||
return vec![Action::SwitchTool("livePaintBucket".into())];
|
||||
}
|
||||
let stop = self.stop.as_ref().zip(cx.gradient_stop);
|
||||
// A plain click on a selected gradient mesh gives the fill color to the point there, else
|
||||
// to the four points of the patch there.
|
||||
if stop.is_none()
|
||||
&& !ev.mods.alt
|
||||
&& !ev.mods.shift
|
||||
&& let Paint::Solid { color, .. } = &cx.paint.fill
|
||||
&& let Some((id, points)) = selected_mesh_points(cx, ev.pos)
|
||||
{
|
||||
let params = json!({ "id": id.0, "points": points, "color": color_json(color), "keepModel": true });
|
||||
return vec![Action::Exec("object.mesh.setPointColor".into(), params)];
|
||||
}
|
||||
// Reading a source is independent of its editability. Only Alt's reverse operation
|
||||
// writes to the clicked object; Shift+Alt appends its appearance to the selection.
|
||||
let source = if ev.mods.alt && !ev.mods.shift && stop.is_none() {
|
||||
hit_test(cx.doc, ev.pos, opts).map(|h| (paint_owner(cx.doc, h.leaf), h.kind))
|
||||
} else {
|
||||
sample_source(cx, ev.pos)
|
||||
};
|
||||
let Some((src, _)) = source else { return vec![] };
|
||||
let Some(n) = cx.doc.node(src) else { return vec![] };
|
||||
if ev.mods.alt && stop.is_none() {
|
||||
let how = if ev.mods.shift { "append" } else { "reverse" };
|
||||
return vec![Action::Exec("appearance.copyFrom".into(), json!({ "source": src.0, how: true }))];
|
||||
}
|
||||
let image = matches!(n.kind, NodeKind::Image(_));
|
||||
// Picked mesh points take only a color sampled from other art or an image: the sample goes
|
||||
// to them as a fill, and to nothing else that is selected. A click on a mesh with picked
|
||||
// points is handled as before.
|
||||
let meshes = if stop.is_none() { picked_meshes(cx, &self.mesh_points) } else { vec![] };
|
||||
let meshes = if meshes.contains(&src) { vec![] } else { meshes };
|
||||
if !(ev.mods.shift || stop.is_some() || image || !meshes.is_empty()) {
|
||||
return vec![Action::Exec("appearance.copyFrom".into(), json!({ "source": src.0 }))];
|
||||
}
|
||||
let Some(c) = sample_color_at(cx, ev.pos) else { return vec![] };
|
||||
let color = color_json(&c);
|
||||
if !meshes.is_empty() {
|
||||
let ids: Vec<u64> = meshes.iter().map(|id| id.0).collect();
|
||||
return vec![Action::Exec("paint.sampleColor".into(), json!({ "color": color, "stroke": false, "ids": ids }))];
|
||||
}
|
||||
let Some((back, i)) = stop else { return vec![Action::Exec("paint.sampleColor".into(), json!({ "color": color }))] };
|
||||
let out = vec![Action::Exec("paint.sampleColor".into(), json!({ "color": color, "stop": i })), Action::SwitchTool(back.clone())];
|
||||
self.stop = None;
|
||||
out
|
||||
}
|
||||
|
||||
/// The object a click there samples, recolors or copies attributes to, as [`Self::click`]
|
||||
/// finds it.
|
||||
fn hover_object(&self, cx: &ToolContext, p: Point, mods: Mods) -> Option<NodeId> {
|
||||
self.click(cx, p, mods)?.object()
|
||||
}
|
||||
|
||||
/// Expose a transient text range alongside gradient-stop and brush-key sampling state.
|
||||
@@ -684,11 +685,92 @@ impl Tool for EyedropperTool {
|
||||
}
|
||||
}
|
||||
|
||||
/// What a click with the Eyedropper does, which [`EyedropperTool::pointer`] carries out.
|
||||
enum Click {
|
||||
/// Image Trace's Ignore Color pick: the panel samples the image with this binding.
|
||||
ImageTrace(Value),
|
||||
/// Brush Options › Key Color: this color, sampled from this object.
|
||||
BrushKeyColor(Color, NodeId),
|
||||
/// A pick for a Live Paint Bucket stop that is no longer selected switches back unsampled.
|
||||
BackToBucket,
|
||||
/// The fill color goes to these points of this selected gradient mesh.
|
||||
MeshPoints(NodeId, Vec<usize>, Color),
|
||||
/// `appearance.copyFrom` this source, with `reverse` or `append` or neither.
|
||||
CopyFrom(NodeId, Option<&'static str>),
|
||||
/// This color, sampled from `source`, goes to the picked points of `meshes`, else to the
|
||||
/// gradient stop of `stop` (the tool to switch back to and the stop), else to the active fill
|
||||
/// or stroke.
|
||||
Sample { color: Color, source: NodeId, meshes: Vec<NodeId>, stop: Option<(String, usize)> },
|
||||
}
|
||||
|
||||
impl Click {
|
||||
/// The object of the document the click reads from or writes to.
|
||||
fn object(&self) -> Option<NodeId> {
|
||||
match self {
|
||||
Click::ImageTrace(_) | Click::BackToBucket => None,
|
||||
Click::BrushKeyColor(_, id) | Click::MeshPoints(id, ..) | Click::CopyFrom(id, _) | Click::Sample { source: id, .. } => Some(*id),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl EyedropperTool {
|
||||
/// Is a gradient stop, Brush Key Color or Image Trace Ignore Color pick armed?
|
||||
fn picking(&self) -> bool {
|
||||
self.stop.is_some() || self.brush_key_color || self.image_trace_ignore_color.is_some()
|
||||
}
|
||||
|
||||
/// What a click at `p` with `mods` does, or None when it does nothing.
|
||||
fn click(&self, cx: &ToolContext, p: Point, mods: Mods) -> Option<Click> {
|
||||
if let Some(binding) = &self.image_trace_ignore_color {
|
||||
return Some(Click::ImageTrace(binding.clone()));
|
||||
}
|
||||
if self.brush_key_color {
|
||||
let (c, source) = sample_at(cx, p)?;
|
||||
return Some(Click::BrushKeyColor(c, source));
|
||||
}
|
||||
// A pick for a stop of the Live Paint Bucket's gradient (the default paint's) ends without
|
||||
// sampling once that stop is no longer selected (a Cmd-click selected another object) or no
|
||||
// longer there (another paint was chosen): the click switches back.
|
||||
let bucket_paint = if cx.fill_active { &cx.paint.fill } else { &cx.paint.stroke };
|
||||
let bucket_stop = cx.gradient_stop.filter(|i| matches!(bucket_paint, Paint::Gradient(g) if *i < g.gradient.stops.len()));
|
||||
if self.stop.as_deref() == Some("livePaintBucket") && bucket_stop.is_none() {
|
||||
return Some(Click::BackToBucket);
|
||||
}
|
||||
let stop = self.stop.clone().zip(cx.gradient_stop);
|
||||
// A plain click on a selected gradient mesh gives the fill color to the point there, else
|
||||
// to the four points of the patch there.
|
||||
if stop.is_none()
|
||||
&& !mods.alt
|
||||
&& !mods.shift
|
||||
&& let Paint::Solid { color, .. } = &cx.paint.fill
|
||||
&& let Some((id, points)) = selected_mesh_points(cx, p)
|
||||
{
|
||||
return Some(Click::MeshPoints(id, points, *color));
|
||||
}
|
||||
// Reading a source is independent of its editability. Only Alt's reverse operation
|
||||
// writes to the clicked object; Shift+Alt appends its appearance to the selection.
|
||||
let source = if mods.alt && !mods.shift && stop.is_none() {
|
||||
hit_test(cx.doc, p, sample_options(cx)).map(|h| (paint_owner(cx.doc, h.leaf), h.kind))
|
||||
} else {
|
||||
sample_source(cx, p)
|
||||
};
|
||||
let (src, _) = source?;
|
||||
let n = cx.doc.node(src)?;
|
||||
if mods.alt && stop.is_none() {
|
||||
return Some(Click::CopyFrom(src, Some(if mods.shift { "append" } else { "reverse" })));
|
||||
}
|
||||
let image = matches!(n.kind, NodeKind::Image(_));
|
||||
// Picked mesh points take only a color sampled from other art or an image: the sample goes
|
||||
// to them as a fill, and to nothing else that is selected. A click on a mesh with picked
|
||||
// points is handled as before.
|
||||
let meshes = if stop.is_none() { picked_meshes(cx, &self.mesh_points) } else { vec![] };
|
||||
let meshes = if meshes.contains(&src) { vec![] } else { meshes };
|
||||
if !(mods.shift || stop.is_some() || image || !meshes.is_empty()) {
|
||||
return Some(Click::CopyFrom(src, None));
|
||||
}
|
||||
let (color, source) = sample_at(cx, p)?;
|
||||
Some(Click::Sample { color, source, meshes, stop })
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -1824,7 +1906,7 @@ mod tests {
|
||||
let opts = sample_options(&cx);
|
||||
let mut s = Sampler { doc: &d, opts, raster_sample: cx.raster_sample, symbol_nodes: 0, work: 1_000, exhausted: false, patterns: 0 };
|
||||
let mut levels: Vec<Option<Document>> = (0..MAX_NESTING).map(|_| None).collect();
|
||||
assert_eq!(color_under(&mut s, &d, &mut levels, Point::new(150.0, 150.0), opts).map(|c| c.to_hex()), None);
|
||||
assert_eq!(color_under(&mut s, &d, &mut levels, Point::new(150.0, 150.0), opts).map(|(c, _)| c.to_hex()), None);
|
||||
assert!(s.exhausted);
|
||||
}
|
||||
|
||||
@@ -1917,6 +1999,157 @@ mod tests {
|
||||
assert_eq!(sampled_hex(&below), "#00ff00");
|
||||
}
|
||||
|
||||
/// The object the hover names for a Shift-click is the one whose color the click samples: the
|
||||
/// blend where a step is drawn, and the rectangle below it in a gap between the steps. Away
|
||||
/// from all art it names none.
|
||||
#[test]
|
||||
fn shift_hover_names_the_object_the_sample_comes_from() {
|
||||
use vectorcraft_doc::live::{BlendSpacing, BlendSpec};
|
||||
use vectorcraft_geom::Rect;
|
||||
let d = doc_with_live_over_green(|d| {
|
||||
let red = solid_rect(d, Rect::new(300.0, 300.0, 320.0, 320.0), Color::rgb(1.0, 0.0, 0.0));
|
||||
let blue = solid_rect(d, Rect::new(400.0, 300.0, 420.0, 320.0), Color::rgb(0.0, 0.0, 1.0));
|
||||
let spec = BlendSpec { spacing: BlendSpacing::Steps(1), ..Default::default() };
|
||||
Node::new(d.alloc_id(), NodeKind::Blend { children: vec![std::sync::Arc::new(red), std::sync::Arc::new(blue)], spec: Box::new(spec) })
|
||||
});
|
||||
let ids: Vec<NodeId> = d.layers[0].children().unwrap().iter().map(|n| n.id).collect();
|
||||
let [.., green, blend] = ids[..] else { panic!("two objects over the rectangle expected") };
|
||||
let (s, p) = (Selection::default(), paint());
|
||||
let shift = Mods { shift: true, ..Default::default() };
|
||||
let t = EyedropperTool::default();
|
||||
let names = |x: f64, y: f64| t.hover_object(&cx(&d, &s, &p), Point::new(x, y), shift);
|
||||
assert_eq!(names(360.0, 310.0), Some(blend), "a blend step");
|
||||
assert_eq!(names(335.0, 310.0), Some(green), "a gap between the steps");
|
||||
assert_eq!(names(480.0, 480.0), None, "no art");
|
||||
}
|
||||
|
||||
/// A blend's steps count as work before it is evaluated: the steps of every blend it holds
|
||||
/// are counted, and with less work left than that the sample gives no color and the blend is
|
||||
/// not evaluated.
|
||||
#[test]
|
||||
fn blend_steps_count_before_the_blend_is_evaluated() {
|
||||
use vectorcraft_doc::Document;
|
||||
use vectorcraft_doc::blend::blend_steps_made;
|
||||
use vectorcraft_doc::live::{BlendSpacing, BlendSpec};
|
||||
use vectorcraft_geom::Rect;
|
||||
let blend = |d: &mut Document, steps: u32| {
|
||||
let red = solid_rect(d, Rect::new(300.0, 300.0, 320.0, 320.0), Color::rgb(1.0, 0.0, 0.0));
|
||||
let blue = solid_rect(d, Rect::new(400.0, 300.0, 420.0, 320.0), Color::rgb(0.0, 0.0, 1.0));
|
||||
let spec = BlendSpec { spacing: BlendSpacing::Steps(steps), ..Default::default() };
|
||||
Node::new(d.alloc_id(), NodeKind::Blend { children: vec![std::sync::Arc::new(red), std::sync::Arc::new(blue)], spec: Box::new(spec) })
|
||||
};
|
||||
let mut scratch = Document::new(500.0, 500.0);
|
||||
let (big, small) = (blend(&mut scratch, 1000), blend(&mut scratch, 3));
|
||||
let rect = solid_rect(&mut scratch, Rect::new(0.0, 0.0, 10.0, 10.0), Color::rgb(0.0, 1.0, 0.0));
|
||||
assert_eq!(blend_steps_made(&big), 1000);
|
||||
assert_eq!(blend_steps_made(&rect), 0);
|
||||
let group =
|
||||
Node::new(scratch.alloc_id(), NodeKind::Group { children: vec![std::sync::Arc::new(big), std::sync::Arc::new(small)], clip: false });
|
||||
assert_eq!(blend_steps_made(&group), 1003, "every blend in the group");
|
||||
|
||||
let d = doc_with_live_over_green(|d| blend(d, 1000));
|
||||
let (sel, p) = (Selection::default(), paint());
|
||||
let cx = cx(&d, &sel, &p);
|
||||
let opts = sample_options(&cx);
|
||||
let mut levels: Vec<Option<Document>> = (0..MAX_NESTING).map(|_| None).collect();
|
||||
let at = Point::new(360.0, 310.0);
|
||||
let evaluated = || EXPANSIONS.with(std::cell::Cell::get);
|
||||
let before = evaluated();
|
||||
let mut s = Sampler { doc: &d, opts, raster_sample: cx.raster_sample, symbol_nodes: 0, work: 900, exhausted: false, patterns: 0 };
|
||||
assert_eq!(color_under(&mut s, &d, &mut levels, at, opts).map(|(c, _)| c.to_hex()), None);
|
||||
assert!(s.exhausted, "less work left than the blend's 1,000 steps");
|
||||
assert_eq!(evaluated(), before, "the blend is not evaluated");
|
||||
let mut s = Sampler { doc: &d, opts, raster_sample: cx.raster_sample, symbol_nodes: 0, work: MAX_WORK, exhausted: false, patterns: 0 };
|
||||
assert!(color_under(&mut s, &d, &mut levels, at, opts).is_some(), "a step is drawn at the point");
|
||||
assert!(evaluated() > before, "with enough work the blend is evaluated");
|
||||
}
|
||||
|
||||
/// Each step of a blend whose keys are blends is a copy of one of them, so the steps it makes
|
||||
/// in all count before it is evaluated: an outer blend of 20 steps between two blends of 100
|
||||
/// steps makes more than 2,000, though its blends have 220 steps between their own keys.
|
||||
#[test]
|
||||
fn steps_that_copy_a_nested_blend_count_before_it_is_evaluated() {
|
||||
use vectorcraft_doc::Document;
|
||||
use vectorcraft_doc::live::{BlendSpacing, BlendSpec};
|
||||
use vectorcraft_geom::Rect;
|
||||
let blend = |d: &mut Document, keys: Vec<Node>, steps: u32| {
|
||||
let spec = BlendSpec { spacing: BlendSpacing::Steps(steps), ..Default::default() };
|
||||
Node::new(d.alloc_id(), NodeKind::Blend { children: keys.into_iter().map(std::sync::Arc::new).collect(), spec: Box::new(spec) })
|
||||
};
|
||||
let inner = |d: &mut Document, y: f64| {
|
||||
let red = solid_rect(d, Rect::new(300.0, y, 320.0, y + 10.0), Color::rgb(1.0, 0.0, 0.0));
|
||||
let blue = solid_rect(d, Rect::new(400.0, y, 420.0, y + 10.0), Color::rgb(0.0, 0.0, 1.0));
|
||||
blend(d, vec![red, blue], 100)
|
||||
};
|
||||
let d = doc_with_live_over_green(|d| {
|
||||
let (a, b) = (inner(d, 300.0), inner(d, 330.0));
|
||||
blend(d, vec![a, b], 20)
|
||||
});
|
||||
let outer = d.layers[0].children().unwrap().last().unwrap();
|
||||
assert!(vectorcraft_doc::blend::blend_steps_made(outer) > 2_000, "the copies' steps count");
|
||||
let (sel, p) = (Selection::default(), paint());
|
||||
let cx = cx(&d, &sel, &p);
|
||||
let opts = sample_options(&cx);
|
||||
let mut levels: Vec<Option<Document>> = (0..MAX_NESTING).map(|_| None).collect();
|
||||
let at = Point::new(310.0, 305.0);
|
||||
let evaluated = || EXPANSIONS.with(std::cell::Cell::get);
|
||||
let before = evaluated();
|
||||
let mut s = Sampler { doc: &d, opts, raster_sample: cx.raster_sample, symbol_nodes: 0, work: 1_000, exhausted: false, patterns: 0 };
|
||||
assert_eq!(color_under(&mut s, &d, &mut levels, at, opts).map(|(c, _)| c.to_hex()), None);
|
||||
assert!(s.exhausted, "less work left than the steps the outer blend makes");
|
||||
assert_eq!(evaluated(), before, "the outer blend is not evaluated");
|
||||
let mut s = Sampler { doc: &d, opts, raster_sample: cx.raster_sample, symbol_nodes: 0, work: MAX_WORK, exhausted: false, patterns: 0 };
|
||||
assert!(color_under(&mut s, &d, &mut levels, at, opts).is_some(), "a key is drawn at the point");
|
||||
assert!(evaluated() > before, "with enough work the outer blend is evaluated");
|
||||
}
|
||||
|
||||
/// For a Shift-click on an envelope, the hover names the envelope where its distorted contents
|
||||
/// are drawn, and the rectangle below where they leave the point empty.
|
||||
#[test]
|
||||
fn shift_hover_names_the_envelope_where_its_art_is_drawn() {
|
||||
use vectorcraft_geom::{Affine, Rect};
|
||||
let d = doc_with_live_over_green(|d| {
|
||||
let red = solid_rect(d, Rect::new(300.0, 300.0, 420.0, 320.0), Color::rgb(1.0, 0.0, 0.0));
|
||||
let kind = vectorcraft_doc::EnvelopeKind::Warp { style: "arc".into(), bend: 50.0, h: 0.0, v: 0.0, horizontal: true, version: 0 };
|
||||
let content = vec![std::sync::Arc::new(red)];
|
||||
let options = Default::default();
|
||||
Node::new(
|
||||
d.alloc_id(),
|
||||
NodeKind::Envelope { content, kind: Box::new(kind), fidelity: 50.0, editing: false, options, frame: Box::new(Affine::IDENTITY) },
|
||||
)
|
||||
});
|
||||
let ids: Vec<NodeId> = d.layers[0].children().unwrap().iter().map(|n| n.id).collect();
|
||||
let [.., green, envelope] = ids[..] else { panic!("two objects over the rectangle expected") };
|
||||
let (s, p) = (Selection::default(), paint());
|
||||
let shift = Mods { shift: true, ..Default::default() };
|
||||
let t = EyedropperTool::default();
|
||||
let names = |x: f64, y: f64| t.hover_object(&cx(&d, &s, &p), Point::new(x, y), shift);
|
||||
assert_eq!(names(360.0, 310.0), Some(envelope), "the distorted contents");
|
||||
assert_eq!(names(360.0, 332.0), Some(green), "a point the contents leave empty");
|
||||
}
|
||||
|
||||
/// A plain click on a selected gradient mesh recolors its points, and the hover names that
|
||||
/// mesh; Image Trace's Ignore Color pick, which the panel samples, names nothing.
|
||||
#[test]
|
||||
fn hover_names_the_selected_mesh_a_click_recolors() {
|
||||
use vectorcraft_doc::{Document, GradientMesh};
|
||||
let mut d = Document::new(500.0, 500.0);
|
||||
let l = d.layers[0].id;
|
||||
let mesh = d.alloc_id();
|
||||
let grid = GradientMesh::from_surface(1, 1, &|u, v| Point::new(100.0 + 100.0 * u, 100.0 + 100.0 * v), &|_, _| Color::WHITE);
|
||||
d.insert(Some(l), 0, Node::new(mesh, NodeKind::Mesh(grid))).unwrap();
|
||||
let p = paint();
|
||||
let mut s = Selection::default();
|
||||
s.set([mesh]);
|
||||
let mut t = EyedropperTool::default();
|
||||
let at = Point::new(150.0, 150.0);
|
||||
let a = t.pointer(&cx(&d, &s, &p), &PointerEvent::new(PointerKind::Down, at.x, at.y));
|
||||
assert!(matches!(a.first(), Some(Action::Exec(id, _)) if id == "object.mesh.setPointColor"), "{a:?}");
|
||||
assert_eq!(t.hover_object(&cx(&d, &s, &p), at, Mods::default()), Some(mesh));
|
||||
t.set_option("imageTraceIgnoreColor", &json!({"binding": 1}));
|
||||
assert_eq!(t.hover_object(&cx(&d, &s, &p), at, Mods::default()), None);
|
||||
}
|
||||
|
||||
/// A blend of two instances of one symbol draws its steps as instances too: Shift-click on a
|
||||
/// step samples the symbol's art there, and where that art leaves the point empty, what lies
|
||||
/// below.
|
||||
|
||||
@@ -52,7 +52,7 @@ pub fn control_bar(app: &mut VectorcraftApp, ui: &mut Ui) -> bool {
|
||||
if tool == "box3d" {
|
||||
let shapes: [Choice; 6] =
|
||||
[("box3d", "3D Box"), ("rectangle", "Rectangle"), ("ellipse", "Ellipse"), ("polygon", "Polygon"), ("star", "Star"), ("spiral", "Spiral")]
|
||||
.map(|(id, label)| (id, label, shape_icon(id)));
|
||||
.map(|(id, label)| (id, label, icon_for_shape(id)));
|
||||
if let Some(shape) = choice(ui, "Shape", &active_shape, &shapes) {
|
||||
app.run("tool.setOption", json!({ "key": "shape", "value": shape })).ok();
|
||||
}
|
||||
@@ -309,7 +309,7 @@ fn draw_polygon_controls(app: &mut VectorcraftApp, ui: &mut Ui, opts: &Value, ac
|
||||
end_deg = a1;
|
||||
mode = mode_str(arc_mode);
|
||||
}
|
||||
let kinds: [Choice; 2] = [("polygon", "Polygon", shape_icon("polygon")), ("star", "Star", shape_icon("star"))];
|
||||
let kinds: [Choice; 2] = [("polygon", "Polygon", icon_for_shape("polygon")), ("star", "Star", icon_for_shape("star"))];
|
||||
match choice(ui, "Shape", if is_star { "star" } else { "polygon" }, &kinds) {
|
||||
Some("star") => apply_shape(app, &[("polyIsStar", json!(true))], json!({ "isStar": true, "spokeRatio": spoke })),
|
||||
Some(_) => apply_shape(app, &[("polyIsStar", json!(false))], json!({ "isStar": false })),
|
||||
@@ -410,7 +410,7 @@ fn draw_box3d_controls(app: &mut VectorcraftApp, ui: &mut Ui, opts: &Value, sele
|
||||
}
|
||||
|
||||
/// The toolbar icon of the shape tool `id`, so the Control bar's shape buttons show the same icon.
|
||||
fn shape_icon(id: &str) -> &'static str {
|
||||
fn icon_for_shape(id: &str) -> &'static str {
|
||||
vectorcraft_tools::tool_info(id).map_or("square-dashed", |t| crate::icons::tool_icon(t.icon))
|
||||
}
|
||||
|
||||
@@ -428,7 +428,7 @@ mod tests {
|
||||
use craft::behavior::IconId;
|
||||
use craft::ui::primitives::{has_icon, register_app_icons};
|
||||
|
||||
use super::shape_icon;
|
||||
use super::icon_for_shape;
|
||||
|
||||
/// The Control bar's shape buttons look their icons up by tool id; an id that names no tool
|
||||
/// would show the placeholder instead of the toolbar's icon.
|
||||
@@ -437,9 +437,9 @@ mod tests {
|
||||
register_app_icons(&crate::icons::APP_ICONS);
|
||||
for id in ["box3d", "rectangle", "ellipse", "polygon", "star", "spiral"] {
|
||||
let tool = vectorcraft_tools::tool_info(id).unwrap_or_else(|| panic!("{id} is a tool"));
|
||||
assert_eq!(shape_icon(id), crate::icons::tool_icon(tool.icon), "{id}");
|
||||
assert!(has_icon(&IconId::new(shape_icon(id))), "{id}'s icon {} isn't an icon", shape_icon(id));
|
||||
assert_eq!(icon_for_shape(id), crate::icons::tool_icon(tool.icon), "{id}");
|
||||
assert!(has_icon(&IconId::new(icon_for_shape(id))), "{id}'s icon {} isn't an icon", icon_for_shape(id));
|
||||
}
|
||||
assert_eq!(shape_icon("no-such-tool"), "square-dashed");
|
||||
assert_eq!(icon_for_shape("no-such-tool"), "square-dashed");
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,10 @@ use craft::platform::clock::monotonic_ms;
|
||||
use craft::theme::variant::Tone;
|
||||
use craft::ui::buttons::{ActiveLook, PushButtonLook};
|
||||
use craft::ui::choice::ChoiceLook;
|
||||
use craft::ui::contract::{Bind, CaptionInk, GlyphColon, LinkLabelInk, LinkLabelUnderline, QuietHeader, SectionRhythm};
|
||||
use craft::ui::contract::{Bind, CaptionInk, GlyphColon, LinkLabelInk, LinkLabelUnderline, MoveBandCursor, QuietHeader, SectionRhythm};
|
||||
use craft::ui::docking::IconGroupSeparator;
|
||||
use craft::ui::list::{CommandHighlight, ThumbRows};
|
||||
use craft::ui::menu::MenuTitlePad;
|
||||
use craft::ui::menu::MenuTitleLook;
|
||||
use craft::ui::patterns::form_dialogs::PresetCardLook;
|
||||
use craft::ui::runtime::env::{RootEnv, Scale, ScrubDrags, WindowKey};
|
||||
use craft::ui::runtime::frame::{FrameInput, FrameOutput};
|
||||
@@ -19,7 +19,7 @@ use craft::ui::sections::{DialogButtonLook, QuietTitleRow};
|
||||
use craft::ui::shell::embed::CloseDecision;
|
||||
use craft::ui::shell::{AppShell, CanvasPanel, Slot};
|
||||
use craft::ui::style::TrackFill;
|
||||
use craft::ui::tabs::DocumentTabLook;
|
||||
use craft::ui::tabs::{DocumentTabLook, TabCloseLook};
|
||||
use craft::ui::text::{NumberLook, NumberPrecision};
|
||||
use vectorcraft_engine::cmd::clipboard::PASTE_ORDER;
|
||||
use vectorcraft_engine::cmd::toast::Level;
|
||||
@@ -133,6 +133,7 @@ impl VectorcraftApp {
|
||||
find_font: None,
|
||||
hidden_chars: Default::default(),
|
||||
spelling: Default::default(),
|
||||
text_nodes: Default::default(),
|
||||
momentary: None,
|
||||
selection_box: None,
|
||||
selection_bounds: None,
|
||||
@@ -144,6 +145,7 @@ impl VectorcraftApp {
|
||||
plugin_keys: Default::default(),
|
||||
placed_keys: Default::default(),
|
||||
view_moved: None,
|
||||
hover_object: None,
|
||||
grab: None,
|
||||
carry_target: None,
|
||||
last_drag: None,
|
||||
@@ -739,10 +741,14 @@ pub(crate) fn root_env(prefs: &vectorcraft_engine::Prefs, native_ppp: f32) -> Ro
|
||||
root.values.set(ThumbRows::Tight);
|
||||
// The Layers Objects search field fills the filter bar up to its Filter button, as production's did.
|
||||
root.values.set(ObjectsSearch::Fill);
|
||||
// The menu bar's titles stand as close as production's, which share the line with the bar's other controls.
|
||||
root.values.set(MenuTitlePad::Control);
|
||||
// The menu bar's titles are production's egui buttons: a push button high, 2 points beside the text, rounded.
|
||||
root.values.set(MenuTitleLook::Button);
|
||||
// The title bar and the panel headers keep the arrow, over the menu titles too, as production's did.
|
||||
root.values.set(MoveBandCursor::Arrow);
|
||||
// Document tabs show their title and its `*` in the label's semibold face, as production drew them.
|
||||
root.values.set(DocumentTabLook::Semibold);
|
||||
// A document tab's × is a small glyph that brightens under the pointer, with no fill, as production drew it.
|
||||
root.values.set(TabCloseLook::Glyph);
|
||||
// A collapsed panel column's icon groups stand apart by a hairline, as production drew them.
|
||||
root.values.set(IconGroupSeparator::Rule);
|
||||
// New Document's preset cards show blank paper on a flat card, as production drew them.
|
||||
|
||||
@@ -60,6 +60,10 @@ pub struct CanvasCache {
|
||||
/// The words Edit › Spelling › Auto Spell Check underlined on each text object in the last
|
||||
/// frame; dropped while it is off.
|
||||
pub spelling: canvas::marks::SpellingMarks,
|
||||
/// The active document's visible text objects for (document uid, revision), which Show Hidden
|
||||
/// Characters and Auto Spell Check draw over. A pass that draws neither drops them
|
||||
/// ([`canvas::marks::marks_of`]).
|
||||
pub text_nodes: canvas::marks::TextNodes,
|
||||
/// The Hand, Zoom and Rotate View tools the Space key and its chords lend the canvas, between
|
||||
/// passes; the tool adapter takes it out for its call and puts it back.
|
||||
pub momentary: Option<craft::ui::canvas::Momentary>,
|
||||
@@ -87,6 +91,10 @@ pub struct CanvasCache {
|
||||
/// The view the canvas last drew and when it last changed (egui's input time): while it moves,
|
||||
/// the canvas doesn't hit-test the art under the pointer ([`canvas::hover_wait`], #2452).
|
||||
pub view_moved: Option<(canvas::ViewKey, f64)>,
|
||||
/// The object the Eyedropper's click at the pointer would act on, which Object Highlighting
|
||||
/// outlines, with what it was found for: finding it again, which can sample a color, waits
|
||||
/// until one of those changes.
|
||||
pub hover_object: Option<(canvas::HoverObjectKey, Option<vectorcraft_doc::NodeId>)>,
|
||||
/// Where the press of the gesture running on the canvas landed, in document points: a move carried out of the
|
||||
/// canvas drops its art there relative to the pointer (`canvas::drops`).
|
||||
pub grab: Option<Point>,
|
||||
@@ -343,6 +351,14 @@ pub struct CacheKey {
|
||||
/// The paper under the art that translucent art is blended with before the conversion
|
||||
/// ([`crate::display_profile::convert_over`]). None without a display profile, and in Outline.
|
||||
pub backdrop: Option<std::sync::Arc<crate::display_profile::Backdrop>>,
|
||||
/// The active color settings ([`vectorcraft_color::cms::active_settings`]), the working color
|
||||
/// settings ([`vectorcraft_color::cms::working_settings`]) and the loaded profiles' generation
|
||||
/// ([`vectorcraft_color::cms::profiles_generation`]) the frame's colors were converted with:
|
||||
/// Edit › Color Settings, a profile loaded again under its name or removed, and the front
|
||||
/// document's assigned profiles change them without changing the document. A proof of the
|
||||
/// working CMYK space converts through the working settings, which can change while the active
|
||||
/// settings stay the same.
|
||||
pub color: (vectorcraft_color::cms::ColorSettings, vectorcraft_color::cms::ColorSettings, u64),
|
||||
}
|
||||
|
||||
impl CacheKey {
|
||||
|
||||
@@ -50,6 +50,7 @@ pub use panes::{Layout as TileLayout, Panes};
|
||||
pub(crate) use panes::{consolidate, pane, tile, tiled_area};
|
||||
pub(crate) use raster::{KeptFrame, color_image, color_image_owned, render_job};
|
||||
pub(crate) use rulers::{general_lengths, stroke_lengths};
|
||||
pub use selection::HoverObjectKey;
|
||||
pub(crate) use task_bar::{TASK_BAR_ACTIONS, TASK_BAR_CHIPS, has_colors, is_task_bar_action, read_hidden_task_bar_actions};
|
||||
pub use tool_adapter::{apply_requests, dispatch, mods};
|
||||
pub(crate) use tool_adapter::{busy_tool, in_gesture, pose_on_page, tool_enter};
|
||||
|
||||
@@ -76,17 +76,19 @@ pub struct CanvasDropsStyle {
|
||||
}
|
||||
|
||||
/// A drop target for one payload type `P`: `make` turns the payload into the canvas's own, or refuses it. `seen` is
|
||||
/// the operation of the last payload it accepted at the pointer.
|
||||
/// the operation of the last payload it accepted at the pointer. Where `covered` (another window lies over the canvas),
|
||||
/// it takes nothing: that window's targets take the drop.
|
||||
struct Target<'a, F> {
|
||||
rect: Rect,
|
||||
view: &'a CanvasView,
|
||||
covered: &'a dyn Fn(Pos2) -> bool,
|
||||
make: F,
|
||||
seen: Cell<Option<DropOperation>>,
|
||||
}
|
||||
|
||||
impl<'a, F> Target<'a, F> {
|
||||
fn new(rect: Rect, view: &'a CanvasView, make: F) -> Self {
|
||||
Target { rect, view, make, seen: Cell::new(None) }
|
||||
fn new(rect: Rect, view: &'a CanvasView, covered: &'a dyn Fn(Pos2) -> bool, make: F) -> Self {
|
||||
Target { rect, view, covered, make, seen: Cell::new(None) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,6 +96,9 @@ impl<P: ?Sized, F: Fn(&P) -> Option<Payload>> DropTarget<P> for Target<'_, F> {
|
||||
type Drop = Dropped;
|
||||
|
||||
fn accept(&self, payload: &P, at: Pos2, op: DropOperation) -> Option<Dropped> {
|
||||
if (self.covered)(at) {
|
||||
return None;
|
||||
}
|
||||
let payload = (self.make)(payload)?;
|
||||
self.seen.set(Some(op));
|
||||
Some(Dropped { payload, at: self.view.to_doc(at), zoom: self.view.zoom, op })
|
||||
@@ -121,6 +126,8 @@ pub(crate) struct CanvasDrops<'a> {
|
||||
/// has the content the move started from ([`CarriedArt::before`]), and the document a tab rest showed is still the
|
||||
/// current one.
|
||||
given_up: bool,
|
||||
/// Whether another window lies over the canvas at a point of it: a floating panel's OS window.
|
||||
covered: &'a dyn Fn(Pos2) -> bool,
|
||||
out: &'a RefCell<Option<Dropped>>,
|
||||
/// The files from the OS the canvas places, and where their drop goes.
|
||||
files: (CanvasFiles<'a>, &'a RefCell<Option<CanvasDrop>>),
|
||||
@@ -150,9 +157,9 @@ impl Component for CanvasDrops<'_> {
|
||||
|
||||
fn update(&mut self, cx: &mut Cx<'_, Self>) {
|
||||
let rect = cx.rect;
|
||||
let (sources, given_up, view) = (&self.sources, self.given_up, &self.view);
|
||||
let (sources, given_up, view, covered) = (&self.sources, self.given_up, &self.view, self.covered);
|
||||
let unchanged = |a: &CarriedArt| given_up || sources.contains(&(a.document, a.revision));
|
||||
let art = Target::new(rect, view, |a: &CarriedArt| unchanged(a).then(|| Payload::Art(a.clone())));
|
||||
let art = Target::new(rect, view, covered, |a: &CarriedArt| unchanged(a).then(|| Payload::Art(a.clone())));
|
||||
let mut dropped = cx.drop_target::<CarriedArt, _>(&art);
|
||||
if self.kind == BodyKind::Pane
|
||||
&& let (Some(op), Some((carried, _))) = (art.seen.get(), cx.dragging::<CarriedArt>())
|
||||
@@ -163,11 +170,11 @@ impl Component for CanvasDrops<'_> {
|
||||
}
|
||||
if self.kind == BodyKind::Live {
|
||||
// The art of this canvas's own document is not accepted as a panel payload: its move resumes.
|
||||
let panel = Target::new(rect, view, |p: &PanelDrag| (!matches!(p, PanelDrag::Art { .. })).then(|| Payload::Panel(p.clone())));
|
||||
let style = Target::new(rect, view, |d: &ListDrag<StyleKey>| Some(Payload::Style(d.grabbed.clone())));
|
||||
let symbol = Target::new(rect, view, |d: &ListDrag<SymbolKey>| Some(Payload::Symbol(d.grabbed.clone())));
|
||||
let brush = Target::new(rect, view, |d: &ListDrag<BrushKey>| Some(Payload::Brush(d.grabbed.clone())));
|
||||
let library = Target::new(rect, view, |d: &ListDrag<LibraryKey>| Some(Payload::Library(d.grabbed.clone())));
|
||||
let panel = Target::new(rect, view, covered, |p: &PanelDrag| (!matches!(p, PanelDrag::Art { .. })).then(|| Payload::Panel(p.clone())));
|
||||
let style = Target::new(rect, view, covered, |d: &ListDrag<StyleKey>| Some(Payload::Style(d.grabbed.clone())));
|
||||
let symbol = Target::new(rect, view, covered, |d: &ListDrag<SymbolKey>| Some(Payload::Symbol(d.grabbed.clone())));
|
||||
let brush = Target::new(rect, view, covered, |d: &ListDrag<BrushKey>| Some(Payload::Brush(d.grabbed.clone())));
|
||||
let library = Target::new(rect, view, covered, |d: &ListDrag<LibraryKey>| Some(Payload::Library(d.grabbed.clone())));
|
||||
let panel = cx.drop_target::<PanelDrag, _>(&panel);
|
||||
let style = cx.drop_target::<ListDrag<StyleKey>, _>(&style);
|
||||
let symbol = cx.drop_target::<ListDrag<SymbolKey>, _>(&symbol);
|
||||
@@ -215,8 +222,10 @@ pub(crate) fn show(app: &mut VectorcraftApp, ui: &mut Ui, win: Win, kind: BodyKi
|
||||
&& app.session.documents().iter().any(|d| d.uid == a.document && d.same_content(&a.before))
|
||||
});
|
||||
let (out, files_out) = (RefCell::new(None), RefCell::new(None));
|
||||
let ctx = ui.ctx().clone();
|
||||
let covered = |at: Pos2| crate::panel_docking::os_window_at(app, &ctx, at);
|
||||
let files = (CanvasFiles::new(app, rect, &view), &files_out);
|
||||
let drops = CanvasDrops { common: Common::new(), view, kind, document, sources, given_up, out: &out, files };
|
||||
let drops = CanvasDrops { common: Common::new(), view, kind, document, sources, given_up, covered: &covered, out: &out, files };
|
||||
drops.id_salt(("canvas-drops", win)).show_at(ui, rect);
|
||||
if let Some(files) = files_out.take() {
|
||||
crate::place::canvas_drop(app, ui.ctx(), files);
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
use craft::behavior::IconId;
|
||||
use craft::ui::buttons::Button;
|
||||
use craft::ui::contract::{Bind, Props as _, Show as _, ShowContainer as _};
|
||||
use craft::behavior::{ColumnWidth, IconId};
|
||||
use craft::ui::buttons::{Link, LinkLook};
|
||||
use craft::ui::contract::{Bind, Gap, Pad, Props as _, Show as _, ShowContainer as _, clicked};
|
||||
use craft::ui::display::Text;
|
||||
use craft::ui::layout_components::Row;
|
||||
use craft::ui::shell::{RecentFile, StartAction, StartLayout, StartLink, StartScreen, Template};
|
||||
use craft::ui::layout::CellAlign;
|
||||
use craft::ui::layout_components::{Grid, Stack};
|
||||
use craft::ui::runtime::env::{Env, Overrides, with_env};
|
||||
use craft::ui::sections::Section;
|
||||
use craft::ui::shell::{RecentFile, StartAction, StartLayout, StartLink, StartPlace, StartScreen, Template};
|
||||
use craft::ui::style::{SurfaceKind, TypeRole};
|
||||
|
||||
use super::{Ui, VectorcraftApp, json};
|
||||
|
||||
@@ -13,6 +17,10 @@ const TEMPLATES: [&str; 6] = ["Letter", "A4", "Web 1920×1080", "Phone 390×844"
|
||||
/// The icons of the three `community::link_urls` links, in their order.
|
||||
const LINK_ICONS: [&str; 3] = ["globe", "external-link", "git-branch"];
|
||||
|
||||
/// The Learn cards across a full-width column, and across a narrower one.
|
||||
const FOUR: &[ColumnWidth] = &[ColumnWidth::fill(1.0); 4];
|
||||
const TWO: &[ColumnWidth] = &[ColumnWidth::fill(1.0); 2];
|
||||
|
||||
/// The Home screen (`app.home`; with no document open, unless its preference is off).
|
||||
pub(super) fn home(app: &mut VectorcraftApp, ui: &mut Ui, rect: egui::Rect) {
|
||||
let recent: Vec<RecentFile> = crate::io::recent_files(app)
|
||||
@@ -35,12 +43,14 @@ pub(super) fn home(app: &mut VectorcraftApp, ui: &mut Ui, rect: egui::Rect) {
|
||||
for ((label, url), icon) in crate::community::link_urls(app).into_iter().zip(LINK_ICONS) {
|
||||
links.push(StartLink::url(tl!(label), Some(IconId::new(icon)), url));
|
||||
}
|
||||
// The column shows no view switch or sort; the bindings hold copies so the Learn section can borrow the app.
|
||||
let (mut view, mut sort) = (app.ui.home_view, app.ui.home_sort);
|
||||
let mut pressed = None;
|
||||
let mut learn = |ui: &mut Ui| learn(app, ui, &mut pressed);
|
||||
let mut child = ui.new_child(egui::UiBuilder::new().max_rect(rect).layout(egui::Layout::top_down(egui::Align::Min)));
|
||||
let out = StartScreen::new(Bind::bound(&mut view), Bind::bound(&mut sort), &recent)
|
||||
// Production's community links read in the accent alone, with no underline.
|
||||
let plain_links = |overrides: &mut Overrides| {
|
||||
overrides.values.set(LinkLook::Plain);
|
||||
};
|
||||
// Learn follows the presets, which stand right under New and Open as in production 0.24.1.
|
||||
let start = StartScreen::new(Bind::bound(&mut app.ui.home_view), Bind::bound(&mut app.ui.home_sort), &recent)
|
||||
.layout(StartLayout::Column)
|
||||
.title(tl!("Welcome to VectorCraft"))
|
||||
.subtitle(tl!("Vector illustration — fast, open, scriptable."))
|
||||
@@ -51,15 +61,13 @@ pub(super) fn home(app: &mut VectorcraftApp, ui: &mut Ui, rect: egui::Rect) {
|
||||
.templates_title(tl!("Quickly start a new file"))
|
||||
.links(&links)
|
||||
.links_title(tl!("Community"))
|
||||
.app_section(tl!("Learn"), &mut learn)
|
||||
.show(&mut child);
|
||||
app.ui.home_view = view;
|
||||
app.ui.home_sort = sort;
|
||||
.section(StartPlace::AfterSections, |ui, _| learn(ui, &mut pressed));
|
||||
let out = with_env(&mut child, plain_links, |ui| start.show(ui));
|
||||
for action in out.actions {
|
||||
run_action(app, action);
|
||||
}
|
||||
if let Some(id) = pressed
|
||||
&& let Err(e) = app.run("learn.show", json!({ "tutorial": id }))
|
||||
if let Some((command, args)) = pressed
|
||||
&& let Err(e) = app.run(command, args)
|
||||
{
|
||||
app.status(e);
|
||||
}
|
||||
@@ -86,21 +94,36 @@ fn run_action(app: &mut VectorcraftApp, action: StartAction) {
|
||||
}
|
||||
}
|
||||
|
||||
/// The Home screen's Learn section: the Quick skill guide card, which shows the Learn panel's list
|
||||
/// of skills, and the Learn panel's tutorials under their skills, each a button that shows the
|
||||
/// panel at its steps (`learn.show`). The start screen may run this twice in a pass, so it only
|
||||
/// draws and records the tutorial pressed in `pressed`.
|
||||
fn learn(app: &mut VectorcraftApp, ui: &mut Ui, pressed: &mut Option<&'static str>) {
|
||||
use crate::panels::learn::{catalog, guide_card};
|
||||
guide_card(app, ui); // PLAN: assumed `guide_card(app, ui)` as document-panels-w18 leaves it, on `Button::detail`.
|
||||
for skill in catalog::SKILLS {
|
||||
let _ = Text::new(skill.title).show(ui);
|
||||
let _ = Row::new().show(ui, |ui, _| {
|
||||
for tutorial in skill.tutorials {
|
||||
if Button::new(tutorial.title).id_salt(tutorial.id).show(ui).clicked() {
|
||||
*pressed = Some(tutorial.id);
|
||||
}
|
||||
/// The Home screen's Learn section, after the new-file presets: a Column page section whose heading row ends in the
|
||||
/// Quick skill guide link, which shows the Learn panel's list of skills (`learn.skills`), over a card per skill: its
|
||||
/// title over its tutorials as links, each showing the panel at its steps (`learn.show`). The four cards stand in one
|
||||
/// row in a column at its full `size.page.column` width, and two by two in a narrower one. The start screen may run
|
||||
/// this twice in a pass, so it only draws and records the command chosen in `pressed`.
|
||||
fn learn(ui: &mut Ui, pressed: &mut Option<(&'static str, serde_json::Value)>) {
|
||||
use crate::panels::learn::catalog::SKILLS;
|
||||
let (mut guide, mut tutorial) = (false, None);
|
||||
let across = if ui.available_width() + 0.5 >= Env::of(ui).tokens.size.page.column { FOUR } else { TWO };
|
||||
let section = Section::fixed(tl!("Learn")).quiet_header().header_gap(Gap::PageHeading);
|
||||
let _ = section.controls(|ui, _| guide |= clicked(&Link::new(tl!("Quick skill guide")).show(ui))).show(ui, |ui, _| {
|
||||
let _ = Grid::new(across).gap(Gap::Section).cells(CellAlign::Top).fill_width().show(ui, |ui, _| {
|
||||
for skill in SKILLS {
|
||||
let card = Stack::new().surface(SurfaceKind::Raised).pad(Pad::Regular).gap(Gap::Stack).fill_width();
|
||||
let _ = card.show(ui, |ui, _| {
|
||||
let _ = Text::new(skill.title).role(TypeRole::BodyStrong).show(ui);
|
||||
let _ = Stack::new().gap(Gap::PageLink).show(ui, |ui, _| {
|
||||
for t in skill.tutorials {
|
||||
if clicked(&Link::new(t.title).id_salt(t.id).show(ui)) {
|
||||
tutorial = Some(t.id);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
if guide {
|
||||
*pressed = Some(("learn.skills", json!({})));
|
||||
} else if let Some(id) = tutorial {
|
||||
*pressed = Some(("learn.show", json!({ "tutorial": id })));
|
||||
}
|
||||
}
|
||||
@@ -108,6 +108,17 @@ pub struct SpellingMarks {
|
||||
pub(super) lines: HashMap<NodeId, (Arc<Node>, Underlines)>,
|
||||
}
|
||||
|
||||
/// The visible text objects of a document, depth first in paint order ([`TextNodes`]).
|
||||
pub(super) type TextList = Arc<Vec<Arc<Node>>>;
|
||||
|
||||
/// The visible text objects of the active document, for (document uid, revision): Show Hidden
|
||||
/// Characters and Auto Spell Check draw over them every pass ([`crate::CanvasCache::text_nodes`]).
|
||||
/// A pass that draws neither drops them ([`marks_of`]).
|
||||
#[derive(Default)]
|
||||
pub struct TextNodes {
|
||||
pub(super) list: Option<((u64, u64), TextList)>,
|
||||
}
|
||||
|
||||
/// One print tile on the screen: its paper edge and its number.
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub(crate) struct Tile {
|
||||
@@ -166,11 +177,15 @@ pub(crate) fn marks_of(app: &mut VectorcraftApp, view: &CanvasView) -> Marks {
|
||||
if !spelling_gate {
|
||||
app.canvas.spelling = SpellingMarks::default();
|
||||
}
|
||||
if !hidden_gate && !spelling_gate {
|
||||
app.canvas.text_nodes = TextNodes::default();
|
||||
}
|
||||
let fades = artboards::fades_outside_artboards(app);
|
||||
let shows_artboards = artboards::shows_artboards(app);
|
||||
let Some(st) = app.session.active() else {
|
||||
app.canvas.hidden_chars.marks.clear();
|
||||
app.canvas.spelling = SpellingMarks::default();
|
||||
app.canvas.text_nodes = TextNodes::default();
|
||||
return m;
|
||||
};
|
||||
let key = (st.uid, st.revision);
|
||||
@@ -181,11 +196,16 @@ pub(crate) fn marks_of(app: &mut VectorcraftApp, view: &CanvasView) -> Marks {
|
||||
m.bleed = artboards::bleed_paths(st);
|
||||
m.artboard_marks = artboards::mark_paths(st, view.zoom);
|
||||
}
|
||||
if hidden_gate {
|
||||
collect_hidden(st, view, &mut app.canvas.hidden_chars, &mut m.hidden);
|
||||
}
|
||||
if spelling_gate {
|
||||
collect_spelling(st, view, &mut app.canvas.spelling, &mut m.spelling);
|
||||
if hidden_gate || spelling_gate {
|
||||
// Both draw over the same text objects, found among the document's other objects once
|
||||
// for each revision.
|
||||
let texts = cached(&mut app.canvas.text_nodes.list, key, || text_nodes(&st.doc.layers));
|
||||
if hidden_gate {
|
||||
collect_hidden(&texts, view, &mut app.canvas.hidden_chars, &mut m.hidden);
|
||||
}
|
||||
if spelling_gate {
|
||||
collect_spelling(st, &texts, view, &mut app.canvas.spelling, &mut m.spelling);
|
||||
}
|
||||
}
|
||||
if inside_gate
|
||||
&& let Some(id) = app.session.draw_inside
|
||||
@@ -267,14 +287,22 @@ fn cached<T>(slot: &mut Option<((u64, u64), Arc<T>)>, key: (u64, u64), make: imp
|
||||
v
|
||||
}
|
||||
|
||||
/// Depth first in paint order, leaving out hidden objects and what is inside them.
|
||||
fn walk(nodes: &[Arc<Node>], f: &mut impl FnMut(&Arc<Node>)) {
|
||||
for n in nodes.iter().filter(|n| n.visible) {
|
||||
f(n);
|
||||
if let Some(children) = n.children() {
|
||||
walk(children, f);
|
||||
/// The text objects in `layers`, depth first in paint order, leaving out hidden objects and what
|
||||
/// is inside them.
|
||||
fn text_nodes(layers: &[Arc<Node>]) -> Vec<Arc<Node>> {
|
||||
fn walk(nodes: &[Arc<Node>], out: &mut Vec<Arc<Node>>) {
|
||||
for n in nodes.iter().filter(|n| n.visible) {
|
||||
if matches!(n.kind, NodeKind::Text(_)) {
|
||||
out.push(n.clone());
|
||||
}
|
||||
if let Some(children) = n.children() {
|
||||
walk(children, out);
|
||||
}
|
||||
}
|
||||
}
|
||||
let mut out = Vec::new();
|
||||
walk(layers, &mut out);
|
||||
out
|
||||
}
|
||||
|
||||
/// Whether `n`'s box meets the part of the document the view shows (the box round the view's
|
||||
@@ -286,7 +314,7 @@ fn in_view(n: &Node, view: &CanvasView) -> bool {
|
||||
|
||||
/// The marks of the visible text objects in view, laid out again only for the objects the memo
|
||||
/// doesn't hold as they are now. The objects not shown this pass are dropped from the memo.
|
||||
fn collect_hidden(st: &DocState, view: &CanvasView, kept: &mut HiddenChars, out: &mut Vec<PlacedMark>) {
|
||||
fn collect_hidden(texts: &[Arc<Node>], view: &CanvasView, kept: &mut HiddenChars, out: &mut Vec<PlacedMark>) {
|
||||
let mut last = std::mem::take(&mut kept.marks);
|
||||
// The inputs are read before any layout: when fonts load during this pass, the next pass lays
|
||||
// all type out again.
|
||||
@@ -295,10 +323,10 @@ fn collect_hidden(st: &DocState, view: &CanvasView, kept: &mut HiddenChars, out:
|
||||
last.clear();
|
||||
kept.inputs = inputs;
|
||||
}
|
||||
walk(&st.doc.layers, &mut |n| {
|
||||
let NodeKind::Text(tx) = &n.kind else { return };
|
||||
for n in texts {
|
||||
let NodeKind::Text(tx) = &n.kind else { continue };
|
||||
if !in_view(n, view) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
let marks = match last.remove(&n.id) {
|
||||
Some((was, marks)) if Arc::ptr_eq(&was, n) => marks,
|
||||
@@ -306,12 +334,12 @@ fn collect_hidden(st: &DocState, view: &CanvasView, kept: &mut HiddenChars, out:
|
||||
};
|
||||
out.extend_from_slice(&marks);
|
||||
kept.marks.insert(n.id, (n.clone(), marks));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// The Auto Spell Check segments of the visible text objects in view, checked again only for the
|
||||
/// objects the memo doesn't hold as they are now.
|
||||
fn collect_spelling(st: &DocState, view: &CanvasView, kept: &mut SpellingMarks, out: &mut Vec<(Point, Point)>) {
|
||||
fn collect_spelling(st: &DocState, texts: &[Arc<Node>], view: &CanvasView, kept: &mut SpellingMarks, out: &mut Vec<(Point, Point)>) {
|
||||
let mut last = std::mem::take(&mut kept.lines);
|
||||
let inputs = SpellingInputs {
|
||||
fonts: vectorcraft_text::FontDb::global().generation(),
|
||||
@@ -325,10 +353,10 @@ fn collect_spelling(st: &DocState, view: &CanvasView, kept: &mut SpellingMarks,
|
||||
last.clear();
|
||||
kept.inputs = Some(inputs);
|
||||
}
|
||||
walk(&st.doc.layers, &mut |n| {
|
||||
let NodeKind::Text(tx) = &n.kind else { return };
|
||||
for n in texts {
|
||||
let NodeKind::Text(tx) = &n.kind else { continue };
|
||||
if !auto_spell_checks(n) || !in_view(n, view) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
let lines = match last.remove(&n.id) {
|
||||
Some((was, lines)) if Arc::ptr_eq(&was, n) => lines,
|
||||
@@ -336,7 +364,7 @@ fn collect_spelling(st: &DocState, view: &CanvasView, kept: &mut SpellingMarks,
|
||||
};
|
||||
out.extend_from_slice(&lines);
|
||||
kept.lines.insert(n.id, (n.clone(), lines));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// Draw Inside's arms on the screen: round the corners of `bounds` (a few pixels outside the
|
||||
|
||||
@@ -40,20 +40,31 @@ fn settled(app: &mut VectorcraftApp, view: &CanvasView, ids: &[NodeId]) -> Vec<A
|
||||
|
||||
/// An unchanged type object keeps its memo entry; an edit lays out only the object edited; a zoom
|
||||
/// reuses the entries (the marks are in document points); a new font generation lays everything out.
|
||||
/// Other tests change the fonts while this one runs, so the edit and the zoom are tried again on a
|
||||
/// new document until the fonts stay the same from the settled pass through the edited one to the
|
||||
/// zoomed one.
|
||||
#[test]
|
||||
fn hidden_characters_lay_out_only_type_that_changed() {
|
||||
let mut app = app();
|
||||
let ids = [text(&mut app, 20, 40, "a b\nc d"), text(&mut app, 20, 160, "e f")];
|
||||
app.ui.view.hidden_chars = true;
|
||||
let before = settled(&mut app, &view(), &ids);
|
||||
app.session.execute("text.setText", &json!({"id": ids[1].0, "text": "e f g"})).unwrap();
|
||||
marks_of(&mut app, &view());
|
||||
let after = kept_hidden(&app, &ids);
|
||||
let zoomed = CanvasView::new(view().rect, Point::new(100.0, 100.0), 2.0);
|
||||
let (mut app, ids, before, after, zoom) = (0..100)
|
||||
.find_map(|_| {
|
||||
let mut app = app();
|
||||
let ids = [text(&mut app, 20, 40, "a b\nc d"), text(&mut app, 20, 160, "e f")];
|
||||
app.ui.view.hidden_chars = true;
|
||||
let before = settled(&mut app, &view(), &ids);
|
||||
let inputs = app.canvas.hidden_chars.inputs.clone();
|
||||
app.session.execute("text.setText", &json!({"id": ids[1].0, "text": "e f g"})).unwrap();
|
||||
marks_of(&mut app, &view());
|
||||
let edited = app.canvas.hidden_chars.inputs == inputs;
|
||||
let after = kept_hidden(&app, &ids);
|
||||
marks_of(&mut app, &zoomed);
|
||||
let zoom = kept_hidden(&app, &ids);
|
||||
(edited && app.canvas.hidden_chars.inputs == inputs).then_some((app, ids, before, after, zoom))
|
||||
})
|
||||
.expect("the fonts settle");
|
||||
assert!(Arc::ptr_eq(&before[0], &after[0]), "the object not edited is not laid out again");
|
||||
assert!(!Arc::ptr_eq(&before[1], &after[1]), "the edited object is");
|
||||
let zoomed = CanvasView::new(view().rect, Point::new(100.0, 100.0), 2.0);
|
||||
marks_of(&mut app, &zoomed);
|
||||
assert!(kept_hidden(&app, &ids).iter().zip(&after).all(|(a, b)| Arc::ptr_eq(a, b)), "a zoom lays out no type");
|
||||
assert!(zoom.iter().zip(&after).all(|(a, b)| Arc::ptr_eq(a, b)), "a zoom lays out no type");
|
||||
app.canvas.hidden_chars.inputs = (u64::MAX, String::new());
|
||||
marks_of(&mut app, &view());
|
||||
assert!(kept_hidden(&app, &ids).iter().zip(&after).all(|(a, b)| !Arc::ptr_eq(a, b)), "other fonts lay all type out again");
|
||||
@@ -97,15 +108,204 @@ fn hidden_characters_off_and_a_closed_document_release_the_text_nodes() {
|
||||
};
|
||||
marks_of(&mut app, &view());
|
||||
let held = count(&app);
|
||||
assert!(app.canvas.text_nodes.list.is_some(), "the list of the text objects is kept");
|
||||
app.ui.view.hidden_chars = false;
|
||||
marks_of(&mut app, &view());
|
||||
assert!(app.canvas.hidden_chars.marks.is_empty() && count(&app) < held, "off: no node is kept");
|
||||
assert!(app.canvas.text_nodes.list.is_none(), "off: no list of the text objects is kept");
|
||||
app.ui.view.hidden_chars = true;
|
||||
marks_of(&mut app, &view());
|
||||
assert_eq!(app.canvas.hidden_chars.marks.len(), 1);
|
||||
app.session.execute("file.close", &json!({})).unwrap();
|
||||
marks_of(&mut app, &view());
|
||||
assert!(app.canvas.hidden_chars.marks.is_empty(), "no node of the closed document is kept");
|
||||
assert!(app.canvas.text_nodes.list.is_none(), "no list of the closed document's text objects is kept");
|
||||
}
|
||||
|
||||
/// `paths` small rectangles and three point type objects with hidden characters and words no
|
||||
/// dictionary knows: the first on the first layer, the second in a group on that layer and the
|
||||
/// third on a second layer. Show Hidden Characters and Auto Spell Check are on. Returns the type
|
||||
/// objects, the group and the second layer.
|
||||
fn type_among_paths(paths: usize) -> (VectorcraftApp, [NodeId; 3], NodeId, NodeId) {
|
||||
let mut app = app();
|
||||
let id = |v: serde_json::Value| NodeId(v["id"].as_u64().unwrap());
|
||||
let path = id(app.session.execute("shape.rectangle", &json!({"x": 300, "y": 250, "width": 5, "height": 5})).unwrap());
|
||||
{
|
||||
let st = app.session.active_mut().unwrap();
|
||||
let doc = Arc::make_mut(&mut st.doc);
|
||||
let template = doc.node(path).unwrap().clone();
|
||||
let more: Vec<_> = (1..paths)
|
||||
.map(|_| {
|
||||
let mut p = template.clone();
|
||||
p.id = doc.alloc_id();
|
||||
Arc::new(p)
|
||||
})
|
||||
.collect();
|
||||
Arc::make_mut(&mut doc.layers[0]).children_mut().unwrap().extend(more);
|
||||
doc.drop_lookup_cache();
|
||||
}
|
||||
let a = text(&mut app, 20, 40, "one\ttwo\u{00A0}the\nthree\u{2028}four");
|
||||
let b = text(&mut app, 20, 110, "Qzvbtrw the\u{2003}cat");
|
||||
app.session.execute("select.set", &json!({"ids": [b.0]})).unwrap();
|
||||
let group = id(app.session.execute("object.group", &json!({})).unwrap());
|
||||
let layer = id(app.session.execute("layer.new", &json!({})).unwrap());
|
||||
let c = text(&mut app, 20, 180, "Zvqtrbx the\u{202F}cat\n");
|
||||
assert_eq!(app.session.active().unwrap().doc.layers.iter().find(|l| l.id == layer).and_then(|l| l.children()).map(|c| c.len()), Some(1));
|
||||
app.ui.view.hidden_chars = true;
|
||||
app.ui.view.auto_spell_check = true;
|
||||
(app, [a, b, c], group, layer)
|
||||
}
|
||||
|
||||
/// The list of text objects Show Hidden Characters and Auto Spell Check last drew over.
|
||||
fn listed_type(app: &VectorcraftApp) -> TextList {
|
||||
app.canvas.text_nodes.list.as_ref().map(|(_, l)| l.clone()).unwrap()
|
||||
}
|
||||
|
||||
/// Show Hidden Characters and Auto Spell Check find the type among the document's other objects
|
||||
/// once for each revision, in one list both draw from: passes that change nothing draw from the
|
||||
/// same list, and draw the marks and lines a pass drawing from a new list draws. The list holds the
|
||||
/// visible type in `Document::walk` order.
|
||||
#[test]
|
||||
fn hidden_characters_and_auto_spell_check_share_one_list_of_the_type() {
|
||||
let (mut app, ids, _, _) = type_among_paths(2_000);
|
||||
let mut walked = vec![];
|
||||
app.session.active().unwrap().doc.walk(|n| {
|
||||
if matches!(n.kind, NodeKind::Text(_)) && n.visible {
|
||||
walked.push(n.id);
|
||||
}
|
||||
});
|
||||
assert_eq!(walked.len(), 3);
|
||||
let first = marks_of(&mut app, &view());
|
||||
let list = listed_type(&app);
|
||||
assert_eq!(list.iter().map(|n| n.id).collect::<Vec<_>>(), walked);
|
||||
assert!(list.iter().all(|n| ids.contains(&n.id)), "only type");
|
||||
assert_eq!(first.spelling.len(), 2, "{:?}", first.spelling);
|
||||
for _ in 0..3 {
|
||||
let m = marks_of(&mut app, &view());
|
||||
assert_eq!((m.hidden, m.spelling), (first.hidden.clone(), first.spelling.clone()));
|
||||
assert!(Arc::ptr_eq(&list, &listed_type(&app)), "a pass that changes nothing lists no type");
|
||||
}
|
||||
app.canvas.text_nodes = TextNodes::default();
|
||||
app.canvas.hidden_chars = HiddenChars::default();
|
||||
app.canvas.spelling = SpellingMarks::default();
|
||||
let again = marks_of(&mut app, &view());
|
||||
assert_eq!((again.hidden, again.spelling), (first.hidden, first.spelling), "the marks and lines drawn from a new list");
|
||||
assert!(!Arc::ptr_eq(&list, &listed_type(&app)));
|
||||
}
|
||||
|
||||
/// Auto Spell Check alone keeps the list too, and turning it off drops it.
|
||||
#[test]
|
||||
fn auto_spell_check_alone_keeps_the_list_of_the_type() {
|
||||
let (mut app, _, _, _) = type_among_paths(10);
|
||||
app.ui.view.hidden_chars = false;
|
||||
assert_eq!(marks_of(&mut app, &view()).spelling.len(), 2);
|
||||
let list = listed_type(&app);
|
||||
marks_of(&mut app, &view());
|
||||
assert!(Arc::ptr_eq(&list, &listed_type(&app)), "kept while Auto Spell Check draws");
|
||||
app.ui.view.auto_spell_check = false;
|
||||
marks_of(&mut app, &view());
|
||||
assert!(app.canvas.text_nodes.list.is_none(), "dropped with both off");
|
||||
}
|
||||
|
||||
/// The list follows the document: a new text object, an edit, Undo, Redo and a switch to another
|
||||
/// document each list the type again, and the marks are those of the type the document holds.
|
||||
#[test]
|
||||
fn the_list_of_type_follows_edits_undo_redo_and_the_active_document() {
|
||||
let (mut app, ids, _, _) = type_among_paths(50);
|
||||
// Each listed object's id and node.
|
||||
let nodes = |app: &VectorcraftApp| listed_type(app).iter().map(|n| (n.id, Arc::as_ptr(n))).collect::<Vec<_>>();
|
||||
// The nonbreaking spaces marked in `id`.
|
||||
let no_breaks =
|
||||
|app: &VectorcraftApp, id: NodeId| app.canvas.hidden_chars.marks[&id].1.iter().filter(|p| p.mark == HiddenMark::NoBreakSpace).count();
|
||||
marks_of(&mut app, &view());
|
||||
let first = nodes(&app);
|
||||
assert_eq!(first.len(), 3);
|
||||
let added = text(&mut app, 200, 40, "g h");
|
||||
marks_of(&mut app, &view());
|
||||
let with_new = nodes(&app);
|
||||
assert_eq!(with_new.len(), 4);
|
||||
assert!(with_new.iter().any(|(id, _)| *id == added), "the new object");
|
||||
assert!(app.canvas.hidden_chars.marks.contains_key(&added), "has marks");
|
||||
app.session.execute("text.setText", &json!({"id": ids[0].0, "text": "x\ty"})).unwrap();
|
||||
marks_of(&mut app, &view());
|
||||
let edited = nodes(&app);
|
||||
let node_of = |list: &[(NodeId, *const Node)], id| list.iter().find(|(i, _)| *i == id).map(|(_, n)| *n);
|
||||
assert_ne!(node_of(&edited, ids[0]), node_of(&with_new, ids[0]), "the edited object's new node");
|
||||
assert_eq!(node_of(&edited, ids[1]), node_of(&with_new, ids[1]), "the others' nodes");
|
||||
assert_eq!(no_breaks(&app, ids[0]), 0, "the marks of the edited text");
|
||||
app.session.execute("edit.undo", &json!({})).unwrap();
|
||||
marks_of(&mut app, &view());
|
||||
assert_eq!(nodes(&app), with_new, "Undo");
|
||||
assert_eq!(no_breaks(&app, ids[0]), 1, "the marks of the text before");
|
||||
app.session.execute("edit.redo", &json!({})).unwrap();
|
||||
marks_of(&mut app, &view());
|
||||
assert_eq!(nodes(&app), edited, "Redo");
|
||||
app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap();
|
||||
assert!(marks_of(&mut app, &view()).hidden.is_empty(), "another document: none of the first one's marks");
|
||||
assert!(nodes(&app).is_empty() && app.canvas.hidden_chars.marks.is_empty());
|
||||
app.session.execute("document.activate", &json!({"index": 0})).unwrap();
|
||||
marks_of(&mut app, &view());
|
||||
assert_eq!(nodes(&app), edited, "back to the first document");
|
||||
}
|
||||
|
||||
/// Neither overlay draws over type that the canvas does not draw: a hidden text object, or one in
|
||||
/// a hidden group or layer. Shown again, its marks and lines come back.
|
||||
#[test]
|
||||
fn hidden_characters_and_auto_spell_check_leave_out_type_in_hidden_groups_and_layers() {
|
||||
let (mut app, [a, b, c], group, layer) = type_among_paths(10);
|
||||
let drawn = |app: &mut VectorcraftApp| {
|
||||
let m = marks_of(app, &view());
|
||||
let mut ids: Vec<_> = app.canvas.hidden_chars.marks.keys().copied().collect();
|
||||
ids.sort();
|
||||
let mut spelled: Vec<_> = app.canvas.spelling.lines.keys().copied().collect();
|
||||
spelled.sort();
|
||||
(ids, spelled, m.hidden.len(), m.spelling.len())
|
||||
};
|
||||
let all = drawn(&mut app);
|
||||
assert_eq!((all.0.clone(), all.1.clone(), all.3), (vec![a, b, c], vec![a, b, c], 2));
|
||||
app.session.execute("object.setProps", &json!({"ids": [group.0], "visible": false})).unwrap();
|
||||
let (ids, spelled, marks, lines) = drawn(&mut app);
|
||||
assert_eq!((ids, spelled, lines), (vec![a, c], vec![a, c], 1), "a hidden group");
|
||||
assert!(marks < all.2, "fewer marks: {marks} of {}", all.2);
|
||||
assert!(listed_type(&app).iter().all(|n| n.id != b), "not listed");
|
||||
app.session.execute("object.setProps", &json!({"ids": [group.0], "visible": true})).unwrap();
|
||||
assert_eq!(drawn(&mut app), all, "the group shown again");
|
||||
app.session.execute("layer.setProps", &json!({"id": layer.0, "visible": false})).unwrap();
|
||||
let (ids, spelled, _, lines) = drawn(&mut app);
|
||||
assert_eq!((ids, spelled, lines), (vec![a, b], vec![a, b], 1), "a hidden layer");
|
||||
app.session.execute("layer.setProps", &json!({"id": layer.0, "visible": true})).unwrap();
|
||||
assert_eq!(drawn(&mut app), all, "the layer shown again");
|
||||
app.session.execute("object.setProps", &json!({"ids": [a.0], "visible": false})).unwrap();
|
||||
let (ids, spelled, _, _) = drawn(&mut app);
|
||||
assert_eq!((ids, spelled), (vec![b, c], vec![b, c]), "a hidden text object");
|
||||
app.session.execute("object.setProps", &json!({"ids": [a.0], "visible": true})).unwrap();
|
||||
assert_eq!(drawn(&mut app), all, "the text object shown again");
|
||||
}
|
||||
|
||||
/// An ignored diagnostic for the marks' cost on a document of many paths and a little type: passes
|
||||
/// drawing from the kept list, and passes that list the type again each time. There is no timing
|
||||
/// threshold; run on an idle machine and compare the printed cases.
|
||||
#[test]
|
||||
#[ignore = "manual performance diagnostic; no stable timing threshold"]
|
||||
fn type_marks_on_many_paths_diagnostic() {
|
||||
use std::time::Instant;
|
||||
const PASSES: usize = 50;
|
||||
for paths in [10_000, 100_000] {
|
||||
let (mut app, _, _, _) = type_among_paths(paths);
|
||||
marks_of(&mut app, &view());
|
||||
let t = Instant::now();
|
||||
for _ in 0..PASSES {
|
||||
marks_of(&mut app, &view());
|
||||
}
|
||||
let kept = t.elapsed();
|
||||
let t = Instant::now();
|
||||
for _ in 0..PASSES {
|
||||
app.canvas.text_nodes = TextNodes::default();
|
||||
marks_of(&mut app, &view());
|
||||
}
|
||||
let listed = t.elapsed();
|
||||
eprintln!("{paths} paths: {:?} a pass from the kept list, {:?} a pass listing the type again", kept / PASSES as u32, listed / PASSES as u32);
|
||||
}
|
||||
}
|
||||
|
||||
/// The selected groups' gaps are in their Gap Preview Color, and the list is kept per revision.
|
||||
|
||||
@@ -421,9 +421,16 @@ pub(super) fn cache_key(
|
||||
// Preferences › Performance › Use Monitor Profile for Canvas.
|
||||
display: app.display_profile.key(app.session.prefs.monitor_profile_display),
|
||||
backdrop: backdrop(app, st, app.outline_view()),
|
||||
color: color_key(),
|
||||
}
|
||||
}
|
||||
|
||||
/// [`CacheKey::color`] now: the active color settings, the working color settings and the loaded
|
||||
/// profiles' generation.
|
||||
fn color_key() -> (vectorcraft_color::cms::ColorSettings, vectorcraft_color::cms::ColorSettings, u64) {
|
||||
(vectorcraft_color::cms::active_settings(), vectorcraft_color::cms::working_settings(), vectorcraft_color::cms::profiles_generation())
|
||||
}
|
||||
|
||||
/// [`CacheKey::plugins`] of document `st`, one of the documents open in `session`. `keys` holds each
|
||||
/// document's value and the plug-in revision it was checked at, so a document is looked through only
|
||||
/// once after each change of the plug-in revision.
|
||||
@@ -550,10 +557,13 @@ pub(super) fn poll_worker(app: &mut VectorcraftApp, ui: &Ui, key_doc: usize) {
|
||||
|
||||
/// Upload frame `done` from the render worker when it is of document `key_doc` and not older than
|
||||
/// the frame shown. This prevents canvas freezes during continuous edits (drags, arrow nudges, MCP
|
||||
/// command bursts) while ensuring obsolete out-of-order frames are dropped.
|
||||
/// command bursts) while ensuring obsolete out-of-order frames are dropped. A frame whose color key
|
||||
/// ([`CacheKey::color`]) is not the current one is dropped too: the worker converted its colors
|
||||
/// with the settings in force while it rendered, which may not be the ones in its key, and the next
|
||||
/// frame renders again with the current ones.
|
||||
fn show_worker_frame(app: &mut VectorcraftApp, ctx: &egui::Context, done: crate::render_worker::Done, key_doc: usize) {
|
||||
let not_older = app.canvas.key.as_ref().filter(|k| k.doc == done.key.doc).is_none_or(|k| done.key.revision >= k.revision);
|
||||
if done.key.doc != key_doc || !not_older {
|
||||
if done.key.doc != key_doc || !not_older || done.key.color != color_key() {
|
||||
return;
|
||||
}
|
||||
upload(app, ctx, done.img, done.key.pixel.is_some());
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
//! centre point, point type's origin, the key anchor). Each rule is a function of the app that returns what to draw;
|
||||
//! `show` hands the results to the framework's controls, which keep what they stroke between passes.
|
||||
|
||||
use std::collections::hash_map::DefaultHasher;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::hash_map::{DefaultHasher, Entry};
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
||||
use craft::behavior::Input;
|
||||
@@ -18,8 +19,9 @@ use craft::ui::contract::{Access, Bind, Common, Component, Cx, MeasureCx, PaintU
|
||||
use craft::ui::style::{ComponentStyle, DataColor, StyleCx};
|
||||
use egui::{Color32, Rect, Response, Shape, Stroke, StrokeKind, vec2};
|
||||
use vectorcraft_doc::{NodeId, NodeKind};
|
||||
use vectorcraft_engine::{DocState, Prefs};
|
||||
use vectorcraft_engine::{DocState, Prefs, ViewInfo};
|
||||
use vectorcraft_geom::{AnchorKind, BezPath, PathData, PathEl, Point};
|
||||
use vectorcraft_tools::Mods;
|
||||
|
||||
use super::cursor::ViewKey;
|
||||
use super::outline::{c32, node_outline, selection_hit_at, too_many_anchors, walk_drawn};
|
||||
@@ -315,15 +317,35 @@ pub(super) fn anchors(app: &VectorcraftApp, st: &DocState, tool: &str, tool_poin
|
||||
primary.and_then(|key| chosen.iter().find(|(k, _)| *k == key)).map(|(_, knots)| knots.clone()).unwrap_or_default(),
|
||||
segment.map(|(_, at)| at),
|
||||
);
|
||||
for (key, knots) in chosen.into_iter().filter(|(key, _)| Some(*key) != primary) {
|
||||
selection = selection.also(key, knots);
|
||||
}
|
||||
selection.others = by_key(chosen.into_iter().filter(|(key, _)| Some(*key) != primary));
|
||||
out.selection = selection;
|
||||
out
|
||||
}
|
||||
|
||||
/// `listed` with the lists of a repeated key joined, each key where it first appears: what
|
||||
/// [`PathSelection::also`] makes of the entries added one at a time, found with one lookup per entry.
|
||||
fn by_key<K: Copy + Eq + Hash, V>(listed: impl IntoIterator<Item = (K, Vec<V>)>) -> Vec<(K, Vec<V>)> {
|
||||
let mut at: HashMap<K, usize> = HashMap::new();
|
||||
let mut out: Vec<(K, Vec<V>)> = Vec::new();
|
||||
for (key, items) in listed {
|
||||
match at.entry(key) {
|
||||
Entry::Occupied(seen) => {
|
||||
if let Some((_, held)) = out.get_mut(*seen.get()) {
|
||||
held.extend(items);
|
||||
}
|
||||
}
|
||||
Entry::Vacant(new) => {
|
||||
new.insert(out.len());
|
||||
out.push((key, items));
|
||||
}
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// The outline of the object under the pointer at document point `at`, at view `zoom`, for Smart Guides › Object
|
||||
/// Highlighting: the object a click of the selection tools would pick, unless it is selected or has too many points.
|
||||
/// Highlighting: the object a click of the selection tools would pick, unless the click keeps the selection (the
|
||||
/// object, or with the Selection tool selected art inside it, is selected) or the object has too many points.
|
||||
/// None while the view moves (`still` false), under Snap to Grid or Pixel Preview, with a tool that is busy or is not
|
||||
/// a selection tool, and with the preference off. `tool` is the tool whose marks show ([`super::shown_tool`]): while
|
||||
/// Cmd is held, the selection tool a press borrows.
|
||||
@@ -337,13 +359,139 @@ pub(super) fn hover(app: &VectorcraftApp, st: &DocState, tool: &str, at: Point,
|
||||
}
|
||||
let hit = selection_hit_at(app, at, zoom)?;
|
||||
let id = if tool == "selection" { hit.top_object(st.isolation) } else { hit.leaf };
|
||||
if st.selection.contains(id) {
|
||||
// A Selection tool press on selected art inside `id`, such as a group member picked with Group Selection, keeps
|
||||
// the selection and selects nothing new.
|
||||
let kept = if tool == "selection" {
|
||||
vectorcraft_tools::select::selected_under_in(&st.doc, &st.selection, &hit, id).is_some()
|
||||
} else {
|
||||
st.selection.contains(id)
|
||||
};
|
||||
if kept {
|
||||
return None;
|
||||
}
|
||||
outline_of(st, id)
|
||||
}
|
||||
|
||||
/// The hover outline of `id` in its layer colour, unless it has too many points.
|
||||
fn outline_of(st: &DocState, id: NodeId) -> Option<Hovered> {
|
||||
let node = st.doc.node(id).filter(|n| !too_many_anchors([*n]))?;
|
||||
Some(Hovered { path: node_outline(node, &st.doc.symbol_boxes()), color: c32(st.doc.layer_color(id)) })
|
||||
}
|
||||
|
||||
/// The hover outline the canvas shows at document point `at` with the keys `held`: none while Space lends the view
|
||||
/// tools, since a press then pans the view; with the Eyedropper, the object its click there acts on
|
||||
/// ([`eyedropper_hover`]); else the selection tools' outline ([`hover`]). `tool`, `zoom` and `still` are as [`hover`]
|
||||
/// takes them.
|
||||
pub(super) fn hover_target(app: &mut VectorcraftApp, tool: &str, at: Point, held: Mods, zoom: f64, still: bool) -> Option<Hovered> {
|
||||
if held.space && (held.cmd || !app.session.tool_wants_text()) {
|
||||
return None;
|
||||
}
|
||||
if tool == "eyedropper" {
|
||||
return eyedropper_hover(app, at, held, still);
|
||||
}
|
||||
let st = app.session.active()?;
|
||||
hover(app, st, tool, at, zoom, still)
|
||||
}
|
||||
|
||||
/// The outline of the object the Eyedropper's click at `at` with `mods` would act on
|
||||
/// ([`vectorcraft_engine::Session::hover_object`]), for Smart Guides › Object Highlighting: the source of a plain
|
||||
/// click (locked and template art included), the selected mesh it recolors, with Alt the object that gets the
|
||||
/// selection's attributes, and with Shift the object the color comes from. A selected object is outlined too, since a
|
||||
/// click on it still acts on it. None under the conditions [`hover`] names.
|
||||
pub(super) fn eyedropper_hover(app: &mut VectorcraftApp, at: Point, mods: Mods, still: bool) -> Option<Hovered> {
|
||||
let (view, prefs) = (&app.ui.view, &app.session.prefs);
|
||||
if !still || !view.smart_guides || !prefs.object_highlighting || view.snap_to_grid || view.pixel_preview || app.session.tool_busy() {
|
||||
return None;
|
||||
}
|
||||
let info = app.view_info();
|
||||
let id = eyedropper_hover_object(app, at, mods, info)?;
|
||||
outline_of(app.session.active()?, id)
|
||||
}
|
||||
|
||||
/// What the Eyedropper's hover object depends on: the point, the keys held, the document as it is, the selection and
|
||||
/// isolation, the tool's options (an armed pick), the paint defaults and the selected gradient stop, the selection
|
||||
/// tolerance, Eyedropper Options (the raster sample size), whether guides show and are locked, and the view's zoom and
|
||||
/// Outline mode: everything the tool's context gives a click that can change what it acts on.
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct HoverObjectKey {
|
||||
at: Point,
|
||||
mods: Mods,
|
||||
doc: (u64, u64),
|
||||
selection: vectorcraft_doc::Selection,
|
||||
isolation: Option<NodeId>,
|
||||
options: serde_json::Value,
|
||||
paint: vectorcraft_tools::PaintDefaults,
|
||||
fill_active: bool,
|
||||
stop: Option<usize>,
|
||||
tolerance: f64,
|
||||
eyedropper: vectorcraft_engine::EyedropperOptions,
|
||||
guides: (bool, bool),
|
||||
zoom: f64,
|
||||
outline: bool,
|
||||
}
|
||||
|
||||
/// [`vectorcraft_engine::Session::hover_object`] at `at`, found again only when its [`HoverObjectKey`] changes: over
|
||||
/// an image, or with Shift held, finding it samples a color. The cached key is compared field by field, the cheap
|
||||
/// fields first, and the key is copied only when it changed.
|
||||
fn eyedropper_hover_object(app: &mut VectorcraftApp, at: Point, mods: Mods, view: ViewInfo) -> Option<NodeId> {
|
||||
let st = app.session.active()?;
|
||||
let s = &app.session;
|
||||
let cached = app.canvas.hover_object.as_ref().filter(|(k, _)| {
|
||||
let HoverObjectKey {
|
||||
at: k_at,
|
||||
mods: k_mods,
|
||||
doc,
|
||||
selection,
|
||||
isolation,
|
||||
options,
|
||||
paint,
|
||||
fill_active,
|
||||
stop,
|
||||
tolerance,
|
||||
eyedropper,
|
||||
guides,
|
||||
zoom,
|
||||
outline,
|
||||
} = k;
|
||||
*k_at == at
|
||||
&& *k_mods == mods
|
||||
&& *doc == (st.uid, st.revision)
|
||||
&& *isolation == st.isolation
|
||||
&& *fill_active == s.fill_active
|
||||
&& *stop == s.selected_stop()
|
||||
&& *tolerance == s.prefs.selection_tolerance
|
||||
&& *eyedropper == s.prefs.eyedropper
|
||||
&& *guides == (view.guides, s.guides_locked())
|
||||
&& *zoom == view.zoom
|
||||
&& *outline == view.outline
|
||||
&& *selection == st.selection
|
||||
&& *paint == s.paint
|
||||
&& *options == s.tool_options()
|
||||
});
|
||||
if let Some((_, id)) = cached {
|
||||
return *id;
|
||||
}
|
||||
let key = HoverObjectKey {
|
||||
at,
|
||||
mods,
|
||||
doc: (st.uid, st.revision),
|
||||
selection: st.selection.clone(),
|
||||
isolation: st.isolation,
|
||||
options: app.session.tool_options(),
|
||||
paint: app.session.paint.clone(),
|
||||
fill_active: app.session.fill_active,
|
||||
stop: app.session.selected_stop(),
|
||||
tolerance: app.session.prefs.selection_tolerance,
|
||||
eyedropper: app.session.prefs.eyedropper,
|
||||
guides: (view.guides, app.session.guides_locked()),
|
||||
zoom: view.zoom,
|
||||
outline: view.outline,
|
||||
};
|
||||
let id = app.session.hover_object(at, mods, view);
|
||||
app.canvas.hover_object = Some((key, id));
|
||||
id
|
||||
}
|
||||
|
||||
/// The dots of the selection: point type's origin, the centre of each object that shows it, and the key anchor.
|
||||
pub(super) fn dots(app: &VectorcraftApp, st: &DocState) -> Dots {
|
||||
let mut out = Dots { grow: grow(&app.session.prefs), ..Dots::default() };
|
||||
@@ -468,11 +616,11 @@ pub(super) fn show(app: &mut VectorcraftApp, ui: &mut egui::Ui, space: &CanvasSp
|
||||
};
|
||||
// While Cmd is held, the marks of the selection tool a press borrows.
|
||||
let tool = super::shown_tool(app, ui.ctx());
|
||||
let Some(st) = app.session.active() else { return };
|
||||
let hovered = match (kind, app.hover_doc) {
|
||||
(BodyKind::Pane, _) | (_, None) => None,
|
||||
(_, Some(at)) => hover(app, st, tool, at, space.view.zoom, still),
|
||||
(_, Some(at)) => hover_target(app, tool, at, super::held_mods(ui.ctx()), space.view.zoom, still),
|
||||
};
|
||||
let Some(st) = app.session.active() else { return };
|
||||
if let Some(h) = hovered {
|
||||
HoverOutline::new("Object highlight", Some(HoverShape::Path(h.path))).color(DataColor::new(h.color)).show_at(ui, rect);
|
||||
}
|
||||
|
||||
@@ -331,6 +331,163 @@ fn hover_outlines_the_object_under_the_pointer_unless_something_hides_it() {
|
||||
assert!(!hovered(&app, true), "a tool that is not a selection tool");
|
||||
}
|
||||
|
||||
fn held(shift: bool, alt: bool, cmd: bool, space: bool) -> Mods {
|
||||
Mods { shift, alt, cmd, space, ..Mods::default() }
|
||||
}
|
||||
|
||||
const NO_KEYS: Mods = Mods { shift: false, alt: false, cmd: false, ctrl: false, space: false };
|
||||
|
||||
/// The box of the hover outline at `at` with `held` keys down, as the canvas finds it: the tool whose marks show
|
||||
/// (with Cmd, the selection tool a press there borrows), then that tool's outline.
|
||||
fn outline_box(app: &mut VectorcraftApp, at: Point, held: Mods) -> Option<vectorcraft_geom::Rect> {
|
||||
let view = app.view_info();
|
||||
let tool = app.session.hover_tool_at(Some(at), &held, view);
|
||||
hover_target(app, tool, at, held, 1.0, true).map(|h| h.path.bounding_box())
|
||||
}
|
||||
|
||||
/// Whether two boxes agree to within a point.
|
||||
fn same_box(a: Option<vectorcraft_geom::Rect>, b: vectorcraft_geom::Rect) -> bool {
|
||||
a.is_some_and(|a| (a.x0 - b.x0).abs() < 1.0 && (a.y0 - b.y0).abs() < 1.0 && (a.x1 - b.x1).abs() < 1.0 && (a.y1 - b.y1).abs() < 1.0)
|
||||
}
|
||||
|
||||
fn rect(x0: f64, y0: f64, x1: f64, y1: f64) -> vectorcraft_geom::Rect {
|
||||
vectorcraft_geom::Rect::new(x0, y0, x1, y1)
|
||||
}
|
||||
|
||||
/// A rectangle filled with `color`, its id.
|
||||
fn filled(app: &mut VectorcraftApp, x: f64, y: f64, w: f64, h: f64, color: &str) -> NodeId {
|
||||
let id = id_of(&app.run("shape.rectangle", json!({"x": x, "y": y, "width": w, "height": h})).unwrap());
|
||||
app.run("paint.setFill", json!({"ids": [id.0], "color": color})).unwrap();
|
||||
id
|
||||
}
|
||||
|
||||
/// With the Eyedropper, Smart Guides › Object Highlighting outlines the object under the pointer as the selection
|
||||
/// tools do, and nothing over empty canvas. While Space is held a press pans the view, so no tool outlines anything.
|
||||
#[test]
|
||||
fn eyedropper_hover_outlines_the_object_under_the_pointer() {
|
||||
let mut app = hover_scene();
|
||||
app.select_tool("eyedropper");
|
||||
let over = Point::new(150.0, 150.0);
|
||||
assert!(same_box(outline_box(&mut app, over, NO_KEYS), rect(100.0, 100.0, 200.0, 200.0)), "the rectangle under the pointer");
|
||||
assert!(outline_box(&mut app, Point::new(300.0, 50.0), NO_KEYS).is_none(), "nothing over empty canvas");
|
||||
for tool in ["eyedropper", "selection"] {
|
||||
app.select_tool(tool);
|
||||
assert!(outline_box(&mut app, over, NO_KEYS).is_some(), "{tool}: outlined");
|
||||
assert!(outline_box(&mut app, over, held(false, false, false, true)).is_none(), "{tool}: Space held");
|
||||
assert!(outline_box(&mut app, over, NO_KEYS).is_some(), "{tool}: Space let go");
|
||||
}
|
||||
}
|
||||
|
||||
/// The Eyedropper outlines a selected object too, since its click still acts on it. With Cmd held, a click selects
|
||||
/// with the selection tool lent to it, so the outline is that tool's: none on a selected object, and the object under
|
||||
/// the pointer otherwise. Hiding the object under the pointer, or arming Image Trace's Ignore Color pick (which acts on
|
||||
/// no object), removes the outline without the pointer moving.
|
||||
#[test]
|
||||
fn eyedropper_hover_outline_follows_the_selection_cmd_and_the_document() {
|
||||
let mut app = blank();
|
||||
let id = id_of(&app.run("shape.rectangle", json!({"x": 100, "y": 100, "width": 100, "height": 100})).unwrap());
|
||||
app.select_tool("eyedropper");
|
||||
let (over, square) = (Point::new(150.0, 150.0), rect(100.0, 100.0, 200.0, 200.0));
|
||||
assert!(app.session.active().unwrap().selection.contains(id));
|
||||
assert!(same_box(outline_box(&mut app, over, NO_KEYS), square), "a selected object");
|
||||
let cmd = held(false, false, true, false);
|
||||
assert!(outline_box(&mut app, over, cmd).is_none(), "Cmd over a selected object");
|
||||
app.run("select.none", json!({})).unwrap();
|
||||
assert!(same_box(outline_box(&mut app, over, cmd), square), "Cmd over an unselected object");
|
||||
assert!(outline_box(&mut app, over, NO_KEYS).is_some(), "Cmd let go");
|
||||
app.session.set_tool_option("imageTraceIgnoreColor", &json!({"binding": 1}));
|
||||
assert!(outline_box(&mut app, over, NO_KEYS).is_none(), "an armed Ignore Color pick");
|
||||
app.session.set_tool_option("imageTraceIgnoreColor", &serde_json::Value::Null);
|
||||
assert!(outline_box(&mut app, over, NO_KEYS).is_some(), "the pick disarmed");
|
||||
app.run("object.hide", json!({"ids": [id.0]})).unwrap();
|
||||
assert!(outline_box(&mut app, over, NO_KEYS).is_none(), "hidden art");
|
||||
}
|
||||
|
||||
/// With a group member selected (as Group Selection leaves it), the Selection tool outlines nothing over that member,
|
||||
/// where a press keeps the selection, and the group over its other member, where a press selects the group.
|
||||
#[test]
|
||||
fn selection_hover_outline_skips_a_selected_group_member() {
|
||||
let mut app = blank();
|
||||
let a = id_of(&app.run("shape.rectangle", json!({"x": 100, "y": 100, "width": 50, "height": 50})).unwrap());
|
||||
let b = id_of(&app.run("shape.rectangle", json!({"x": 200, "y": 100, "width": 50, "height": 50})).unwrap());
|
||||
app.run("select.set", json!({"ids": [a.0, b.0]})).unwrap();
|
||||
app.run("object.group", json!({})).unwrap();
|
||||
app.run("select.set", json!({"ids": [a.0]})).unwrap();
|
||||
app.select_tool("selection");
|
||||
assert!(outline_box(&mut app, Point::new(125.0, 125.0), NO_KEYS).is_none(), "the selected member");
|
||||
let other = outline_box(&mut app, Point::new(225.0, 125.0), NO_KEYS);
|
||||
assert!(same_box(other, rect(100.0, 100.0, 250.0, 150.0)), "the other member: {other:?}");
|
||||
}
|
||||
|
||||
/// For a Shift-click the Eyedropper outlines the object whose color the click samples: the blend where one of its
|
||||
/// steps is drawn, and the rectangle below it in a gap between the steps.
|
||||
#[test]
|
||||
fn eyedropper_shift_hover_outlines_the_object_sampled() {
|
||||
let mut app = blank();
|
||||
filled(&mut app, 20.0, 50.0, 360.0, 150.0, "#00ff00");
|
||||
let a = filled(&mut app, 100.0, 100.0, 20.0, 20.0, "#ff0000");
|
||||
let b = filled(&mut app, 200.0, 100.0, 20.0, 20.0, "#0000ff");
|
||||
app.run("object.blend.make", json!({"ids": [a.0, b.0], "steps": 1})).unwrap();
|
||||
app.run("select.none", json!({})).unwrap();
|
||||
app.select_tool("eyedropper");
|
||||
let shift = held(true, false, false, false);
|
||||
// One step, halfway: (150, 100) to (170, 120).
|
||||
let step = outline_box(&mut app, Point::new(160.0, 110.0), shift);
|
||||
assert!(same_box(step, rect(100.0, 100.0, 220.0, 120.0)), "a blend step: {step:?}");
|
||||
let gap = outline_box(&mut app, Point::new(135.0, 110.0), shift);
|
||||
assert!(same_box(gap, rect(20.0, 50.0, 380.0, 200.0)), "a gap between the steps: {gap:?}");
|
||||
}
|
||||
|
||||
/// The Eyedropper's hover outline follows Smart Guides › Object Highlighting.
|
||||
#[test]
|
||||
fn eyedropper_hover_outline_follows_object_highlighting() {
|
||||
let mut app = hover_scene();
|
||||
app.select_tool("eyedropper");
|
||||
let over = Point::new(150.0, 150.0);
|
||||
app.run("prefs.set", json!({"key": "objectHighlighting", "value": false})).unwrap();
|
||||
assert!(outline_box(&mut app, over, NO_KEYS).is_none(), "the option off");
|
||||
app.run("prefs.set", json!({"key": "objectHighlighting", "value": true})).unwrap();
|
||||
assert!(outline_box(&mut app, over, NO_KEYS).is_some(), "the option on");
|
||||
}
|
||||
|
||||
/// The Eyedropper outlines the object its click there then acts on: the front object a plain click copies attributes
|
||||
/// from, a locked one included (the Eyedropper reads locked art), and with Alt the unlocked object below it that an
|
||||
/// Alt-click gives the selection's attributes to.
|
||||
#[test]
|
||||
fn eyedropper_hover_outline_is_the_object_the_click_acts_on() {
|
||||
let mut app = blank();
|
||||
let back = filled(&mut app, 100.0, 100.0, 100.0, 100.0, "#0000ff");
|
||||
let front = filled(&mut app, 150.0, 150.0, 100.0, 100.0, "#ff0000");
|
||||
let target = filled(&mut app, 20.0, 20.0, 40.0, 40.0, "#00ff00");
|
||||
app.run("select.set", json!({"ids": [target.0]})).unwrap();
|
||||
app.select_tool("eyedropper");
|
||||
let fill = |app: &VectorcraftApp, id: NodeId| app.session.active().unwrap().doc.node(id).unwrap().appearance.fill_paint();
|
||||
let click = |app: &mut VectorcraftApp, at: Point, mods: Mods| {
|
||||
let view = app.view_info();
|
||||
for kind in [vectorcraft_tools::PointerKind::Down, vectorcraft_tools::PointerKind::Up] {
|
||||
let ev = vectorcraft_tools::PointerEvent { mods, ..vectorcraft_tools::PointerEvent::new(kind, at.x, at.y) };
|
||||
crate::canvas::dispatch(app, &ev, view);
|
||||
}
|
||||
};
|
||||
let over = Point::new(175.0, 175.0);
|
||||
let alt = held(false, true, false, false);
|
||||
let shown = outline_box(&mut app, over, NO_KEYS);
|
||||
assert!(same_box(shown, rect(150.0, 150.0, 250.0, 250.0)), "the front rectangle: {shown:?}");
|
||||
click(&mut app, over, NO_KEYS);
|
||||
assert_eq!(fill(&app, target), fill(&app, front), "the click copied the outlined rectangle's fill");
|
||||
|
||||
app.run("object.lock", json!({"ids": [front.0]})).unwrap();
|
||||
app.run("select.set", json!({"ids": [target.0]})).unwrap();
|
||||
app.run("paint.setFill", json!({"ids": [target.0], "color": "#00ff00"})).unwrap();
|
||||
let shown = outline_box(&mut app, over, NO_KEYS);
|
||||
assert!(same_box(shown, rect(150.0, 150.0, 250.0, 250.0)), "the locked front rectangle is still the source: {shown:?}");
|
||||
let shown = outline_box(&mut app, over, alt);
|
||||
assert!(same_box(shown, rect(100.0, 100.0, 200.0, 200.0)), "with Alt, the unlocked rectangle below: {shown:?}");
|
||||
click(&mut app, over, alt);
|
||||
assert_eq!(fill(&app, back), fill(&app, target), "the Alt-click gave the outlined rectangle the selection's fill");
|
||||
assert_ne!(fill(&app, front), fill(&app, target));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_group_of_too_many_paths_has_no_hover_outline_and_a_key_outline_of_its_bounds() {
|
||||
let mut app = blank();
|
||||
@@ -401,3 +558,34 @@ fn an_empty_selection_has_no_marks() {
|
||||
let st = app.session.active().unwrap();
|
||||
assert_eq!(dots(&app, st).centers.len() + dots(&app, st).origins.len(), 0);
|
||||
}
|
||||
|
||||
/// A path key that counts the comparisons made with it.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
struct Counted<'a>(u64, &'a std::cell::Cell<usize>);
|
||||
|
||||
impl PartialEq for Counted<'_> {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.1.set(self.1.get() + 1);
|
||||
self.0 == other.0
|
||||
}
|
||||
}
|
||||
|
||||
impl Eq for Counted<'_> {}
|
||||
|
||||
impl Hash for Counted<'_> {
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
self.0.hash(state);
|
||||
}
|
||||
}
|
||||
|
||||
// Grouping the selected anchors of 2,000 paths compares each key a bounded number of times, not once per path listed
|
||||
// before it, and joins a repeated path's anchors where the path first appears, as `PathSelection::also` does.
|
||||
#[test]
|
||||
fn grouping_selected_anchors_by_path_compares_each_path_a_bounded_number_of_times() {
|
||||
let compared = std::cell::Cell::new(0);
|
||||
let listed = (0..2000u64).map(|key| (Counted(key, &compared), vec![key])).chain([(Counted(5, &compared), vec![9])]);
|
||||
let grouped = by_key(listed);
|
||||
assert_eq!(grouped.iter().map(|(key, _)| key.0).collect::<Vec<_>>(), (0..2000).collect::<Vec<_>>());
|
||||
assert_eq!(grouped[5].1, vec![5, 9]);
|
||||
assert!(compared.get() < 2 * 2001, "{} comparisons for 2,001 entries", compared.get());
|
||||
}
|
||||
@@ -2357,6 +2357,157 @@ fn appearance_of_black_on_screen_shows_pure_black_as_rgb_black() {
|
||||
assert!(near(middle(&mut app).expect("re-rendered"), accurate), "accurate again");
|
||||
}
|
||||
|
||||
/// A change of the color settings, and a profile in use loaded again under its name, re-render the
|
||||
/// canvas through the new conversion. They raise the documents' revisions but leave the art as it
|
||||
/// is, so [`super::raster::changed_pixels`] finds no part of the frame shown that changed: the
|
||||
/// frame's key holds the color settings and the loaded profiles' generation. A frame with nothing
|
||||
/// changed renders nothing.
|
||||
#[test]
|
||||
fn color_settings_and_a_reloaded_profile_render_the_canvas_again() {
|
||||
const CHILD: &str = "VECTORCRAFT_TEST_CANVAS_COLOR_SETTINGS";
|
||||
if std::env::var_os(CHILD).is_none() {
|
||||
// Color settings and loaded profiles are process-wide: change them in a separate test process.
|
||||
let output = std::process::Command::new(std::env::current_exe().unwrap())
|
||||
.args(["--exact", "canvas::tests::color_settings_and_a_reloaded_profile_render_the_canvas_again", "--nocapture"])
|
||||
.env(CHILD, "1")
|
||||
.output()
|
||||
.unwrap();
|
||||
let stdout = String::from_utf8_lossy(&output.stdout);
|
||||
assert!(
|
||||
output.status.success() && stdout.contains("test result: ok. 1 passed; 0 failed;"),
|
||||
"isolated canvas color test failed:\n{stdout}\n{}",
|
||||
String::from_utf8_lossy(&output.stderr),
|
||||
);
|
||||
return;
|
||||
}
|
||||
use vectorcraft_color::cms;
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
app.session.execute("file.new", &json!({"width": 400, "height": 300, "colorMode": "cmyk"})).unwrap();
|
||||
app.canvas.worker_started = true; // render on this thread
|
||||
// Larger than the view: the middle of the art's raster is its fill.
|
||||
let id = app.run("shape.rectangle", json!({"x": -5000, "y": -5000, "width": 10000, "height": 10000})).unwrap()["id"].clone();
|
||||
app.run("paint.setFill", json!({"ids": [id], "color": {"c": 60, "m": 10, "y": 80, "k": 0}})).unwrap();
|
||||
let ctx = crate::testing::ui_context();
|
||||
// The middle pixel of the art's raster uploaded by one frame, None when it was not re-rendered.
|
||||
let middle = |app: &mut VectorcraftApp| -> Option<[u8; 4]> {
|
||||
let (_, mut delta) = frame_output(app, &ctx);
|
||||
let art = app.canvas.texture.as_ref().unwrap().id();
|
||||
let px = delta.set.iter().find(|e| e.0.eq(&art)).and_then(|e| e.1.last()).map(|d| {
|
||||
let egui::ImageData::Color(img) = &d.image;
|
||||
let [w, h] = img.size;
|
||||
img.pixels[h / 2 * w + w / 2].to_array()
|
||||
});
|
||||
delta.clear();
|
||||
px
|
||||
};
|
||||
let ink = vectorcraft_color::Color::cmyk(0.6, 0.1, 0.8, 0.0);
|
||||
let through = |cmyk: &str| {
|
||||
let c = cms::Cms::new(&cms::ColorSettings { cmyk: cmyk.into(), ..cms::working_settings() }).unwrap().display_rgb(&ink);
|
||||
c.map(|v| (v.clamp(0.0, 1.0) * 255.0).round() as u8)
|
||||
};
|
||||
let near = |a: [u8; 4], b: [u8; 3]| a[..3].iter().zip(b).all(|(x, y)| x.abs_diff(y) <= 3);
|
||||
let (generic, device) = (through(cms::GENERIC_CMYK), through(cms::DEVICE_CMYK));
|
||||
assert!(!near([generic[0], generic[1], generic[2], 255], device), "the two CMYK spaces draw the ink differently: {generic:?}, {device:?}");
|
||||
|
||||
let first = middle(&mut app).expect("the first frame renders the art");
|
||||
assert!(near(first, generic), "through the working CMYK space: {first:?}, not {generic:?}");
|
||||
assert_eq!(middle(&mut app), None, "nothing changed: no re-render");
|
||||
app.run("edit.colorSettings", json!({"cmyk": cms::DEVICE_CMYK})).unwrap();
|
||||
let shown = middle(&mut app).expect("Color Settings re-render the canvas");
|
||||
assert!(near(shown, device), "through the new working CMYK space: {shown:?}, not {device:?}");
|
||||
assert_eq!(middle(&mut app), None, "nothing changed since: no re-render");
|
||||
app.run("edit.colorSettings", json!({"cmyk": cms::GENERIC_CMYK})).unwrap();
|
||||
assert!(near(middle(&mut app).expect("re-rendered"), generic), "back to the first working space");
|
||||
|
||||
// A built-in CMYK profile's file renamed `name`: padded with spaces, which names drop.
|
||||
let renamed = |builtin: &str, name: &str| {
|
||||
let utf16 = |s: &str| s.encode_utf16().flat_map(u16::to_be_bytes).collect::<Vec<u8>>();
|
||||
let mut bytes = cms::icc_bytes(builtin).unwrap().to_vec();
|
||||
let (from, to) = (utf16(builtin), utf16(&format!("{name:<width$}", width = builtin.len())));
|
||||
let at = bytes.windows(from.len()).position(|w| w == from).unwrap();
|
||||
bytes[at..at + to.len()].copy_from_slice(&to);
|
||||
bytes
|
||||
};
|
||||
let name = "Canvas Reload CMYK";
|
||||
let dir = vectorcraft_testkit::temp_dir("canvas-reload-cmyk");
|
||||
let load = |app: &mut VectorcraftApp, builtin: &str| {
|
||||
let path = dir.join(format!("{}.icc", builtin.len()));
|
||||
std::fs::write(&path, renamed(builtin, name)).unwrap();
|
||||
let r = app.run("color.loadProfile", json!({"path": path.to_str().unwrap()})).unwrap();
|
||||
assert_eq!(r["name"], name);
|
||||
};
|
||||
load(&mut app, cms::GENERIC_CMYK);
|
||||
app.run("edit.assignProfile", json!({"cmyk": name})).unwrap();
|
||||
let assigned = middle(&mut app).expect("assigning a profile re-renders the canvas");
|
||||
assert!(near(assigned, generic), "through the assigned copy of the working space: {assigned:?}, not {generic:?}");
|
||||
assert_eq!(middle(&mut app), None, "nothing changed: no re-render");
|
||||
// The same name, the settings as they were: only the profile's file is new.
|
||||
load(&mut app, cms::DEVICE_CMYK);
|
||||
let reloaded = middle(&mut app).expect("the profile loaded again re-renders the canvas");
|
||||
assert!(near(reloaded, device), "through the profile's new file: {reloaded:?}, not {device:?}");
|
||||
assert_eq!(middle(&mut app), None, "nothing changed since: no re-render");
|
||||
|
||||
// A proof of the working CMYK space converts through the working settings. With the document's
|
||||
// assigned profile in place of the working CMYK space, a new working CMYK space leaves the
|
||||
// active settings as they were and changes only the proof.
|
||||
app.run("view.proofSetup", json!({"target": "workingCmyk"})).unwrap();
|
||||
app.run("view.proofColors", json!({"on": true})).unwrap();
|
||||
let proofed = middle(&mut app).expect("Proof Colors re-renders the canvas");
|
||||
assert_eq!(middle(&mut app), None, "nothing changed: no re-render");
|
||||
let active = cms::active_settings();
|
||||
app.run("edit.colorSettings", json!({"cmyk": cms::DEVICE_CMYK})).unwrap();
|
||||
let reproofed = middle(&mut app).expect("a new working CMYK space re-renders the proof");
|
||||
assert_eq!(cms::active_settings(), active, "the assigned profile keeps the active settings");
|
||||
assert!(!near(reproofed, [proofed[0], proofed[1], proofed[2]]), "the proof through the new working CMYK space: {reproofed:?}, not {proofed:?}");
|
||||
assert_eq!(middle(&mut app), None, "nothing changed since: no re-render");
|
||||
}
|
||||
|
||||
/// A frame from the render worker whose color key is not the current one is not shown, and the
|
||||
/// canvas asks for the frame again. The worker converts colors with the settings in force while it
|
||||
/// renders, so a frame asked for before a change of the color settings may hold colors of the new
|
||||
/// settings under the old key, and a return to the old settings would keep it.
|
||||
#[test]
|
||||
fn a_worker_frame_of_other_color_settings_is_not_shown() {
|
||||
keeping_color_settings(a_worker_frame_of_other_color_settings);
|
||||
}
|
||||
|
||||
fn a_worker_frame_of_other_color_settings() {
|
||||
use vectorcraft_color::cms;
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
app.session.execute("file.new", &json!({"width": 400, "height": 300})).unwrap();
|
||||
app.canvas.worker_started = true;
|
||||
let (worker, jobs, done_tx) = crate::render_worker::Worker::test_channel();
|
||||
app.canvas.worker = Some(worker);
|
||||
let ctx = crate::testing::ui_context();
|
||||
let frame = |app: &mut VectorcraftApp| {
|
||||
let raw =
|
||||
egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0))), time: Some(1.0), ..Default::default() };
|
||||
ctx.run_ui(raw, |ui| show(app, ui)).textures_delta.clear();
|
||||
};
|
||||
frame(&mut app);
|
||||
done_tx.send(finished(&jobs.try_recv().expect("the first frame"))).unwrap();
|
||||
frame(&mut app);
|
||||
let first = app.canvas.key.clone().expect("the first frame is shown");
|
||||
|
||||
// A pan's frame goes to the worker, and the color settings change before it is finished.
|
||||
app.view_mut().unwrap().center.x += 5.0;
|
||||
frame(&mut app);
|
||||
let pan = jobs.try_recv().expect("the pan's frame goes to the worker");
|
||||
let settings = cms::ColorSettings { cmyk: cms::DEVICE_CMYK.into(), ..cms::active_settings() };
|
||||
assert_ne!(settings, cms::active_settings(), "other color settings");
|
||||
cms::with_active(std::sync::Arc::new(cms::Cms::new(&settings).unwrap()), || {
|
||||
done_tx.send(finished(&pan)).unwrap();
|
||||
frame(&mut app);
|
||||
assert_eq!(app.canvas.key.as_ref(), Some(&first), "the pan's frame, of other color settings, is not shown");
|
||||
let again = jobs.try_recv().expect("the pan's frame is asked for with the current color settings");
|
||||
assert_ne!(again.key.color, pan.key.color);
|
||||
});
|
||||
// Back to the settings in the pan's key: the pan's frame is asked for again.
|
||||
frame(&mut app);
|
||||
let back = jobs.try_recv().expect("the pan's frame is asked for again");
|
||||
assert_eq!(back.key, pan.key);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn top_bounding_box_handle_scales_a_default_mirror_repeat() {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
|
||||
@@ -437,16 +437,17 @@ fn case_from_attrs(attrs: &Map<String, Value>) -> Option<&'static str> {
|
||||
/// and a final `%` in the percent fields or `°` in Character Rotation.
|
||||
fn typed_number(key: &str, text: &str) -> Option<f64> {
|
||||
let text = text.trim().replace('\u{2212}', "-");
|
||||
let text = vectorcraft_doc::decimal_point(&text);
|
||||
let mark = match key {
|
||||
"size" | "leading" | "baseline_shift" | "tcyUpDown" | "tcyLeftRight" | "stroke_width" => {
|
||||
return vectorcraft_doc::Unit::Points.parse(&text);
|
||||
return vectorcraft_doc::Unit::Points.parse(&vectorcraft_doc::decimal_point(&text));
|
||||
}
|
||||
"h_scale" | "v_scale" | "tsume" | "fill_tint" | "stroke_tint" => Some('%'),
|
||||
"rotation" => Some('°'),
|
||||
_ => None,
|
||||
};
|
||||
vectorcraft_doc::parse_number(mark.and_then(|m| text.strip_suffix(m)).unwrap_or(&text))
|
||||
// The suffix comes off before the comma is read, so `1,000%` is refused as `1,000` is.
|
||||
let number = mark.and_then(|m| text.strip_suffix(m)).unwrap_or(&text);
|
||||
vectorcraft_doc::parse_number(&vectorcraft_doc::decimal_point(number))
|
||||
}
|
||||
|
||||
fn optional_number(d: &Values, key: &str) -> Result<Option<Value>, String> {
|
||||
|
||||
@@ -529,13 +529,25 @@ fn number_fields_take_field_arithmetic() {
|
||||
("leading", "1 in", 72.0),
|
||||
("baseline_shift", "\u{2212}2", -2.0),
|
||||
("kerning", "12,5", 12.5),
|
||||
("h_scale", "12,5%", 12.5),
|
||||
("rotation", "12,5°", 12.5),
|
||||
];
|
||||
for (key, text, want) in typed {
|
||||
let (mut d, _) = dialog_for(json!({}));
|
||||
put(&mut d, key, json!(text));
|
||||
assert_eq!(optional_number(&Values::new(&d), key), Ok(Some(json!(want))), "{key} {text}");
|
||||
}
|
||||
for (key, text) in [("size", "12°"), ("leading", "50%"), ("tracking", "10%"), ("rotation", "45%"), ("h_scale", "1%2"), ("size", "1e3")] {
|
||||
for (key, text) in [
|
||||
("size", "12°"),
|
||||
("leading", "50%"),
|
||||
("tracking", "10%"),
|
||||
("rotation", "45%"),
|
||||
("h_scale", "1%2"),
|
||||
("size", "1e3"),
|
||||
("h_scale", "1,000"),
|
||||
("h_scale", "1,000%"),
|
||||
("rotation", "1,000°"),
|
||||
] {
|
||||
let (mut d, _) = dialog_for(json!({}));
|
||||
put(&mut d, key, json!(text));
|
||||
assert!(optional_number(&Values::new(&d), key).is_err(), "{key} {text}");
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
//! dialogs live on the dialog host; [`pump`] reads their answers.
|
||||
|
||||
use craft::ui::contract::Bind;
|
||||
use craft::ui::dialog::{DialogResult, PromptChoice, StandardPrompt, StartupStage, dialog_id};
|
||||
use craft::ui::dialog::{DialogResult, PromptChoice, StandardPrompt, dialog_id};
|
||||
use craft::ui::patterns::form_dialogs::{DialogFields, FieldValue, HostedParamDialog, Param, ParamDialog, ParamKind};
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_plugins::safe_mode::{self, Item};
|
||||
@@ -239,9 +239,10 @@ fn pump_stopped(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
let Some(dialogs) = app.dialogs() else { return };
|
||||
let answered = dialogs.with(|h| {
|
||||
let answered = h.take::<StandardPrompt>();
|
||||
// An empty host has neither an open dialog nor a queued one: otherwise the choice waits.
|
||||
// An empty host has neither an open dialog nor a queued one: otherwise the choice waits. It opens now rather
|
||||
// than through the startup queue, which the host drains only in its next pass: a frame may have no other.
|
||||
if answered.is_none() && h.is_empty() {
|
||||
h.enqueue(StartupStage::Warning, stopped_prompt(&fields));
|
||||
h.open(stopped_prompt(&fields));
|
||||
ctx.request_repaint();
|
||||
}
|
||||
answered
|
||||
|
||||
@@ -27,6 +27,8 @@ struct Window {
|
||||
frames: usize,
|
||||
/// The texts its last frame drew, with their rects in the window.
|
||||
texts: Vec<(String, Rect)>,
|
||||
/// The named nodes of its last frame's access tree, with their rects in the window.
|
||||
nodes: Vec<(String, Rect)>,
|
||||
}
|
||||
|
||||
struct Host {
|
||||
@@ -77,6 +79,7 @@ impl Host {
|
||||
dropped: Vec::new(),
|
||||
frames: 0,
|
||||
texts: Vec::new(),
|
||||
nodes: Vec::new(),
|
||||
});
|
||||
let viewports = host.infos();
|
||||
let (time, focused) = (host.time, host.focus == id);
|
||||
@@ -105,9 +108,16 @@ impl Host {
|
||||
}
|
||||
let mut shown = Vec::new();
|
||||
full.shapes.iter().for_each(|c| texts(&c.shape, &mut shown));
|
||||
let nodes = full.platform_output.accesskit_update.as_ref().map_or_else(Vec::new, |update| {
|
||||
let rect = |b: egui::accesskit::Rect| Rect::from_min_max(pos2(b.x0 as f32, b.y0 as f32), pos2(b.x1 as f32, b.y1 as f32));
|
||||
update.nodes.iter().filter_map(|(_, node)| Some((node.label()?.to_string(), rect(node.bounds()?)))).collect()
|
||||
});
|
||||
let mut host = host.borrow_mut();
|
||||
if let Some(window) = host.windows.get_mut(&id) {
|
||||
window.texts = shown;
|
||||
if !nodes.is_empty() {
|
||||
window.nodes = nodes;
|
||||
}
|
||||
}
|
||||
host.apply(&full);
|
||||
}
|
||||
@@ -317,6 +327,7 @@ fn button(pos: Pos2, pressed: bool) -> Event {
|
||||
#[test]
|
||||
fn art_dragged_from_the_canvas_onto_a_native_panel_window_drops_there() {
|
||||
let mut h = Harness::new();
|
||||
h.ctx.enable_accesskit();
|
||||
let id = h.app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 50, "height": 40})).unwrap()["id"].as_u64().unwrap();
|
||||
let id = vectorcraft_doc::NodeId(id);
|
||||
let viewport = h.float("graphicStyles");
|
||||
@@ -327,8 +338,14 @@ fn art_dragged_from_the_canvas_onto_a_native_panel_window_drops_there() {
|
||||
let before = art(&h);
|
||||
let view = h.app.canvas_view().expect("the canvas was drawn");
|
||||
let from = view.to_screen(vectorcraft_geom::Point::new(35.0, 30.0));
|
||||
let window = h.host.borrow().windows.get(&viewport).map(|w| w.rect).unwrap();
|
||||
let to = window.min + vec2(60.0, 120.0) - ORIGIN.to_vec2();
|
||||
// The first style's tile, found by its name: the panel takes art dropped onto a style or between styles.
|
||||
let first = h.app.session.active().unwrap().doc.graphic_styles[0].name.clone();
|
||||
let to = {
|
||||
let host = h.host.borrow();
|
||||
let window = &host.windows[&viewport];
|
||||
let tile = window.nodes.iter().find(|(name, _)| *name == first).map(|(_, r)| *r).expect("the first style's tile");
|
||||
window.rect.min + tile.center().to_vec2() - ORIGIN.to_vec2()
|
||||
};
|
||||
assert!(view.rect.contains(to), "the window lies over the canvas");
|
||||
h.frame(vec![Event::PointerMoved(from), button(from, true)]);
|
||||
for k in 1..=8 {
|
||||
|
||||
@@ -62,6 +62,15 @@ impl Harness {
|
||||
.map(|b| Rect::from_min_max(pos2(b.x0 as f32, b.y0 as f32), pos2(b.x1 as f32, b.y1 as f32)))
|
||||
}
|
||||
|
||||
/// The centre of the text field named `label` in the last frame.
|
||||
fn text_field(&self, label: &str) -> Option<Pos2> {
|
||||
self.nodes
|
||||
.iter()
|
||||
.filter(|(_, n)| n.role() == egui::accesskit::Role::TextInput && n.label() == Some(label))
|
||||
.find_map(|(_, n)| n.bounds())
|
||||
.map(|b| pos2(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32))
|
||||
}
|
||||
|
||||
fn tab(&self, panel: &str) -> Option<Rect> {
|
||||
self.named(panel, egui::accesskit::Role::Tab)
|
||||
}
|
||||
@@ -679,6 +688,9 @@ fn ui_docking_reports_the_layout_and_the_dock_state() {
|
||||
h.frame(vec![]);
|
||||
let tab = h.tab("layers").unwrap();
|
||||
h.click(tab.center());
|
||||
// A press on a tab leaves the keys where they were (the dock's TabStrip::keeps_focus); a click in the panel's
|
||||
// search field gives the panel the keys.
|
||||
h.click(h.text_field("Search layers").expect("the Layers panel's search field"));
|
||||
let report = inspect(&h.app, &h.ctx);
|
||||
assert_eq!(report["layout"], serde_json::to_value(h.layout()).unwrap());
|
||||
assert_eq!(report["focused"], json!("layers"));
|
||||
@@ -838,13 +850,7 @@ fn other_function_keys_and_keyboard_guards_keep_their_routes() {
|
||||
// The Layers panel's search field, clicked once the dialog has gone: it has the keys until a click on the canvas
|
||||
// takes them.
|
||||
h.frames(2);
|
||||
let field = h
|
||||
.nodes
|
||||
.iter()
|
||||
.filter(|(_, n)| n.role() == egui::accesskit::Role::TextInput && n.label() == Some("Search layers"))
|
||||
.find_map(|(_, n)| n.bounds())
|
||||
.map(|b| pos2(((b.x0 + b.x1) / 2.0) as f32, ((b.y0 + b.y1) / 2.0) as f32))
|
||||
.expect("the Layers panel's search field");
|
||||
let field = h.text_field("Search layers").expect("the Layers panel's search field");
|
||||
h.click(field);
|
||||
h.f7();
|
||||
assert!(showing(&h.app.ui, "layers"), "F7 does nothing while a text field has focus");
|
||||
|
||||
@@ -7,7 +7,7 @@ use craft::behavior::IconId;
|
||||
use craft::keymap::CommandRef;
|
||||
use craft::ui::bars::{BarItem, BarItems};
|
||||
use craft::ui::buttons::{IconButton, PopupMark, ToggleButton};
|
||||
use craft::ui::contract::{Bind, PopupKind, Props as _, Show as _, ShowContainer as _, Trigger};
|
||||
use craft::ui::contract::{Bind, Gap, PopupKind, Props as _, Show as _, ShowContainer as _, Trigger};
|
||||
use craft::ui::display::Divider;
|
||||
use craft::ui::layout_components::Row;
|
||||
use craft::ui::menu::{Menu, MenuItem, PanelRow};
|
||||
@@ -306,7 +306,7 @@ fn bar_items(buttons: impl Iterator<Item = Button>) -> BarItems {
|
||||
/// Align panel's Align To says (the key object while there is one), as its own buttons do (#789),
|
||||
/// and the selected artboards with the Artboard tool chosen.
|
||||
pub(crate) fn align_buttons(_app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
Row::new().show(ui, |ui, _| {
|
||||
Row::new().wrap(true).show(ui, |ui, _| {
|
||||
for (icon, b) in align_icons() {
|
||||
command_button(ui, bar_glyph(b).unwrap_or(icon), b);
|
||||
}
|
||||
@@ -498,20 +498,13 @@ pub(crate) fn run_align_to(app: &mut VectorcraftApp, v: AlignTo) -> Result<Value
|
||||
/// Spacing with its value and Align To. The buttons are commands, so their state and clicks come
|
||||
/// from the command layer ([`button_enabled`], [`run_button`]).
|
||||
pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
crate::panels::subheading(tl!("Align Objects:")).show(ui, |ui, _| {
|
||||
Row::new().show(ui, |ui, _| {
|
||||
for (icon, b) in align_icons() {
|
||||
command_button(ui, icon, b);
|
||||
}
|
||||
});
|
||||
});
|
||||
crate::panels::subheading(tl!("Distribute Objects:")).show(ui, |ui, _| {
|
||||
Row::new().show(ui, |ui, _| {
|
||||
for (icon, b) in distribute_icons() {
|
||||
command_button(ui, icon, b);
|
||||
}
|
||||
});
|
||||
});
|
||||
// The reference app set the buttons apart in groups: left / centre / right of Align Objects
|
||||
// around the both-axes button, and the vertical and horizontal halves of Distribute Objects.
|
||||
let align: Vec<_> = align_icons().collect();
|
||||
crate::panels::subheading(tl!("Align Objects:")).show(ui, |ui, _| button_groups(ui, &[&align[..3], &align[3..4], &align[4..]]));
|
||||
Divider::horizontal().show(ui);
|
||||
let distribute: Vec<_> = distribute_icons().collect();
|
||||
crate::panels::subheading(tl!("Distribute Objects:")).show(ui, |ui, _| button_groups(ui, &[&distribute[..3], &distribute[3..]]));
|
||||
if part_hidden(app, HIDE_OPTIONS) {
|
||||
return;
|
||||
}
|
||||
@@ -524,30 +517,47 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
let lengths = crate::canvas::general_lengths(app);
|
||||
let min_spacing = spacing_min(app);
|
||||
let mut edited = None;
|
||||
crate::panels::subheading(tl!("Distribute Spacing:")).show(ui, |ui, _| {
|
||||
Row::new().show(ui, |ui, _| {
|
||||
command_button(ui, "dc-dist-vspace", Button::Spacing("vertical"));
|
||||
command_button(ui, "dc-dist-hspace", Button::Spacing("horizontal"));
|
||||
// The value is UI state, not a document edit: a landed value is assigned.
|
||||
let field = NumberField::length(tl!("Distribute Spacing"), Bind::given(Some(spacing)), lengths)
|
||||
.step(1.0)
|
||||
.range(min_spacing..=f64::INFINITY)
|
||||
.enabled(sent);
|
||||
edited = field.show(ui).edit.events.landed().cloned().flatten();
|
||||
// With one object selected the buttons align it to the artboard, and Align To shows Artboard.
|
||||
let anchor = key_is_anchor(app);
|
||||
// Distribute Spacing and Align To share a line, a rule between them, as the reference app had them.
|
||||
Row::new().gap(Gap::Section).show(ui, |ui, _| {
|
||||
crate::panels::subheading(tl!("Distribute Spacing:")).show(ui, |ui, _| {
|
||||
Row::new().show(ui, |ui, _| {
|
||||
command_button(ui, "dc-dist-vspace", Button::Spacing("vertical"));
|
||||
command_button(ui, "dc-dist-hspace", Button::Spacing("horizontal"));
|
||||
// The value is UI state, not a document edit: a landed value is assigned.
|
||||
let field = NumberField::length(tl!("Distribute Spacing"), Bind::given(Some(spacing)), lengths)
|
||||
.step(1.0)
|
||||
.range(min_spacing..=f64::INFINITY)
|
||||
.enabled(sent);
|
||||
edited = field.show(ui).edit.events.landed().cloned().flatten();
|
||||
});
|
||||
});
|
||||
Divider::vertical().show(ui);
|
||||
crate::panels::subheading(tl!("Align To:")).show(ui, |ui, _| {
|
||||
Row::new().show(ui, |ui, _| {
|
||||
for (id, v) in ALIGN_TO_COMMANDS {
|
||||
let (icon, _) = align_to_icon_name(v, anchor);
|
||||
ToggleButton::command(CommandRef::new(id)).icon(IconId::new(icon)).icon_only().show(ui);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
if let Some(v) = edited {
|
||||
app.ui.align_spacing = v;
|
||||
}
|
||||
crate::panels::subheading(tl!("Align To:")).show(ui, |ui, _| {
|
||||
// With one object selected the buttons align it to the artboard, and Align To shows Artboard.
|
||||
let anchor = key_is_anchor(app);
|
||||
Row::new().show(ui, |ui, _| {
|
||||
for (id, v) in ALIGN_TO_COMMANDS {
|
||||
let (icon, _) = align_to_icon_name(v, anchor);
|
||||
ToggleButton::command(CommandRef::new(id)).icon(IconId::new(icon)).icon_only().show(ui);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// The command buttons of `groups` on one line, a section gap between the groups.
|
||||
fn button_groups(ui: &mut Ui, groups: &[&[(&'static str, Button)]]) {
|
||||
Row::new().gap(Gap::Section).show(ui, |ui, _| {
|
||||
for group in groups {
|
||||
Row::new().show(ui, |ui, _| {
|
||||
for (icon, b) in *group {
|
||||
command_button(ui, icon, *b);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
});
|
||||
if !part_hidden(app, OPTIONS_KEY) {
|
||||
Divider::horizontal().show(ui);
|
||||
Row::new().show(ui, |ui, _| {
|
||||
Row::new().wrap(true).show(ui, |ui, _| {
|
||||
let center = [("dc-center-hide", tl!("Don't Show Center"), false), ("dc-center-show", tl!("Show Center"), true)];
|
||||
acts.extend(pair(ui, tl!("Show Center"), has, info.show_center, center).map(|v| ("attributes.set", json!({ "showCenter": v }))));
|
||||
let dir = [("dc-dir-off", tl!("Reverse Path Direction Off"), false), ("dc-dir-on", tl!("Reverse Path Direction On"), true)];
|
||||
@@ -170,7 +170,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
let maps = ImageMap::ALL.map(|m| Entry::new(m, m.label()));
|
||||
let name = side_name(tl!("Image Map:"));
|
||||
Field::new(name.clone()).show(ui, |ui, _| {
|
||||
Row::new().show(ui, |ui, _| {
|
||||
Row::new().wrap(true).show(ui, |ui, _| {
|
||||
let pick = Select::new(name.clone(), Bind::given(or_mixed(info.image_map)), &maps).enabled(has).show(ui);
|
||||
acts.extend(pick.events.committed().map(|m| ("attributes.set", json!({ "imageMap": m }))));
|
||||
let browser = Button::new(tl!("Browser")).enabled(url.is_some()).tooltip(tl!("Open the URL in the web browser")).show(ui);
|
||||
|
||||
@@ -664,11 +664,12 @@ fn set_base(app: &mut VectorcraftApp) {
|
||||
}
|
||||
}
|
||||
|
||||
// The footer's actions, in order.
|
||||
// The footer's actions, in order: the limit at the start edge, the rest from the end edge, so they read Edit or
|
||||
// Apply, Save Selected, Save Group from left to right.
|
||||
const LIMIT: usize = 0;
|
||||
const EDIT: usize = 1;
|
||||
const SAVE_GROUP: usize = 1;
|
||||
const SAVE_SELECTED: usize = 2;
|
||||
const SAVE_GROUP: usize = 3;
|
||||
const EDIT: usize = 3;
|
||||
|
||||
/// The Limit to Library popup's rows: None, Document Swatches, then the colour libraries. → the
|
||||
/// key of the row that ran.
|
||||
@@ -722,11 +723,11 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
.footer(|ui, _| {
|
||||
let actions = [
|
||||
FooterAction::new(icon("library"), tip.clone()).pressed(limited).popup(PopupKind::Menu),
|
||||
FooterAction::new(icon("palette"), tl!("Edit or Apply Colors").to_string()).enabled(doc),
|
||||
FooterAction::new(icon("dc-new-item"), tl!("Save selected colors as swatches").to_string()).enabled(has_cells),
|
||||
FooterAction::new(icon("dc-folder"), tl!("Save color group to Swatch panel").to_string()),
|
||||
FooterAction::new(icon("dc-new-item"), tl!("Save selected colors as swatches").to_string()).enabled(has_cells),
|
||||
FooterAction::new(icon("palette"), tl!("Edit or Apply Colors").to_string()).enabled(doc),
|
||||
];
|
||||
let out = FooterBar::actions(actions).show_footer(ui);
|
||||
let out = FooterBar::actions(actions).at_start(LIMIT + 1).show_footer(ui);
|
||||
footer_picked = out.picked;
|
||||
limit_picked = None;
|
||||
if let Some(button) = out.responses.get(LIMIT) {
|
||||
|
||||
@@ -33,7 +33,7 @@ pub struct DocInfoView {
|
||||
/// A `label: value` row. `label` is shown as given: translate an interface label first, a name
|
||||
/// stays as it is.
|
||||
pub(crate) fn row(ui: &mut Ui, label: &str, value: String) {
|
||||
Row::new().fill_width().align(RowAlign::SpaceBetween).show(ui, |ui, _| {
|
||||
Row::new().fill_width().align(RowAlign::SpaceBetween).wrap(true).show(ui, |ui, _| {
|
||||
Text::new(label.to_string()).shade(Shade::Muted).show(ui);
|
||||
// The value can be selected and copied (#8432).
|
||||
SelectableText::new(label.to_string(), &value).show(ui);
|
||||
|
||||
@@ -78,12 +78,13 @@ impl View {
|
||||
}
|
||||
}
|
||||
|
||||
/// The thumbnail zoom that makes the browser's list rows small or large; `None` keeps the grid's own.
|
||||
fn list_zoom(self) -> Option<f64> {
|
||||
/// The thumbnail zoom of this view: the grid's tiles about 40 points, as production's, and the list rows small or
|
||||
/// large.
|
||||
fn zoom(self) -> f64 {
|
||||
match self {
|
||||
View::Thumbnail => None,
|
||||
View::SmallList => Some(0.5),
|
||||
View::LargeList => Some(2.0),
|
||||
View::Thumbnail => 5.0 / 6.0,
|
||||
View::SmallList => 0.5,
|
||||
View::LargeList => 2.0,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -468,9 +469,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
let mut panel = std::mem::take(&mut app.ui.graphic_styles_panel);
|
||||
let looks = look_hashes(&mut panel, app);
|
||||
let view = app.ui.graphic_styles_view;
|
||||
if let Some(zoom) = view.list_zoom() {
|
||||
panel.state.zoom = zoom;
|
||||
}
|
||||
panel.state.zoom = view.zoom();
|
||||
let before = panel.selection.clone();
|
||||
let (alt, linked) = (alt_held(ui), app.session.selection_graphic_style().is_some());
|
||||
let thumbs = style_thumbs(app, &doc, &looks, panel.preview);
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
//! drag, the Zoom tool's magnification, the Paintbrush's brush) and the selection's fill and
|
||||
//! stroke colour values.
|
||||
|
||||
use craft::behavior::ColumnWidth;
|
||||
use craft::keymap::CommandRef;
|
||||
use craft::ui::contract::{Show as _, ShowContainer as _};
|
||||
use craft::ui::display::{Divider, Picture, Shade, Text};
|
||||
use craft::ui::layout_components::{Row, Stack};
|
||||
use craft::ui::layout_components::{Grid, Row, Stack};
|
||||
use craft::ui::list::ThumbAspect;
|
||||
use craft::ui::menu::PanelRow;
|
||||
use craft::ui::runtime::commands::{CommandState, CommandStates};
|
||||
@@ -231,9 +232,13 @@ pub(crate) fn lines(app: &mut VectorcraftApp, ctx: &egui::Context) -> InfoLines
|
||||
}
|
||||
}
|
||||
|
||||
/// The panel's two columns of numbers: two equal halves of its width.
|
||||
const HALVES: &[ColumnWidth] = &[ColumnWidth::fill(1.0); 2];
|
||||
|
||||
pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
let l = lines(app, ui.ctx());
|
||||
Row::new().show(ui, |ui, _| {
|
||||
// Two equal halves of the panel, as the reference app's columns were.
|
||||
let _ = Grid::new(HALVES).show(ui, |ui, _| {
|
||||
for column in [&l.left, &l.right] {
|
||||
Stack::new().show(ui, |ui, _| {
|
||||
for s in column {
|
||||
|
||||
@@ -2,7 +2,8 @@ use craft::behavior::IconId;
|
||||
use craft::keymap::Mods;
|
||||
use craft::layers::ui::panel::MenuTarget; // PLAN: assumed path of craft-layers' panel types
|
||||
use craft::layers::ui::tree::LayerRowKey;
|
||||
use craft::ui::contract::{Entry, ListDrag};
|
||||
use craft::ui::contract::{Entry, ListDrag, Show as _};
|
||||
use craft::ui::display::{Elide, Text};
|
||||
use craft::ui::menu::{MenuRow, PanelRow};
|
||||
use craft::ui::primitives::IconSpec;
|
||||
use craft::ui::runtime::commands::{CommandRef, CommandState, CommandStates};
|
||||
@@ -450,8 +451,9 @@ pub(crate) fn footer(tree: &DocLayers, ui: &mut Ui, out: &mut Vec<(String, Value
|
||||
.enabled(locate_ok),
|
||||
];
|
||||
let count = crate::i18n::tn(tree.doc().layers.len() as u64, "{n} Layer", "{n} Layers").to_string();
|
||||
// The count is a unit of the footer's row, centred on its buttons' line in the text ink.
|
||||
let (output, _) = FooterBar::actions(actions).at_start(0).show_footer_leading(ui, |ui, _| {
|
||||
ui.weak(&count);
|
||||
Text::new(count.clone()).elide(Elide::End).show(ui);
|
||||
});
|
||||
// The footer runs twice per pass: the sizing pass measures it and must report nothing.
|
||||
if ui.is_sizing_pass() {
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
//! one tutorial, `learn.back` goes up one level, `learn.locateTool` shows where a tool is,
|
||||
//! `learn.openSample`, `learn.markStep`, `learn.finish` and `learn.next` run the practice controls,
|
||||
//! `learn.resetProgress` clears the progress, and `window.learn` shows or hides the panel. The Home
|
||||
//! screen's Learn section shows the same card ([`guide_card`]) and the tutorials, which open the
|
||||
//! panel.
|
||||
//! screen's Learn section links to the list of skills and to each tutorial, which open the panel.
|
||||
|
||||
pub mod catalog;
|
||||
pub mod locate;
|
||||
@@ -109,9 +108,8 @@ fn for_you(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
}
|
||||
|
||||
/// The Quick skill guide card, as one button: a click, or Enter or Space while it has the keyboard
|
||||
/// focus, shows the panel's list of skills (`learn.skills`). The For you tab and the Home screen's
|
||||
/// Learn section show it.
|
||||
pub(crate) fn guide_card(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
/// focus, shows the panel's list of skills (`learn.skills`). The For you tab shows it.
|
||||
fn guide_card(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
// PLAN: assumed `Button::detail(impl Into<Label>)` (dp.R3, document-panels-w4).
|
||||
let card = Button::new(tl!("Quick skill guide"))
|
||||
.icon(IconSpec::svg(IconId::new("graduation-cap")))
|
||||
|
||||
@@ -27,7 +27,7 @@ use craft::ui::display::{Divider, Shade, Text};
|
||||
use craft::ui::layout_components::{Row, Stack};
|
||||
use craft::ui::list::{List, ListRow, ThumbAspect, ThumbSize};
|
||||
use craft::ui::menu::{Menu, MenuItem, PanelRow};
|
||||
use craft::ui::notices::{Notice, NoticeAction, NoticeLayout};
|
||||
use craft::ui::notices::{Notice, NoticeAction, NoticeIcon, NoticeLayout};
|
||||
use craft::ui::patterns::form_dialogs::{DialogFields, HostedParamDialog, Param, ParamDialog, ParamKind};
|
||||
use craft::ui::pickers::Select;
|
||||
use craft::ui::primitives::textures::{Priority, Revision, ThumbPaint, ThumbRender, ThumbRequest, ThumbSource, ThumbnailOptions, Thumbnails};
|
||||
@@ -791,6 +791,7 @@ fn no_library(ui: &mut Ui) -> bool {
|
||||
),
|
||||
)
|
||||
.title(tl!("Local Libraries"))
|
||||
.icon(NoticeIcon::Custom(IconSpec::svg(IconId::new("library"))))
|
||||
.layout(NoticeLayout::Centred)
|
||||
.action(NoticeAction::new(tl!("Create New Library")))
|
||||
.show(ui)
|
||||
|
||||
@@ -588,8 +588,8 @@ pub(crate) fn show_window(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
// PLAN: the zoom slider can set a zoom the five views do not name; it saves as the nearest of them.
|
||||
fn saved_view(view: PresetView, zoom: f64) -> View {
|
||||
match (view == PresetView::List, zoom) {
|
||||
(false, z) if z < 0.625 => View::SmallThumb,
|
||||
(false, z) if z < 0.875 => View::MediumThumb,
|
||||
(false, z) if z < 7.0 / 24.0 => View::SmallThumb,
|
||||
(false, z) if z < 0.5 => View::MediumThumb,
|
||||
(false, _) => View::LargeThumb,
|
||||
(true, z) if z < 0.75 => View::SmallList,
|
||||
(true, _) => View::LargeList,
|
||||
|
||||
@@ -76,6 +76,16 @@ pub(crate) fn menu_library_ids<K: LibraryKind>(app: &VectorcraftApp) -> Vec<Stri
|
||||
out
|
||||
}
|
||||
|
||||
/// A view picked in the browser saves as the view it is: the thresholds of `saved_view` lie between the zooms
|
||||
/// `View::preset` gives, so retuning one without the other would save another view.
|
||||
#[test]
|
||||
fn every_view_saves_as_itself() {
|
||||
for (view, _) in View::ALL {
|
||||
let (shown, zoom) = view.preset();
|
||||
assert_eq!(saved_view(shown, zoom), view);
|
||||
}
|
||||
}
|
||||
|
||||
fn undo_len(app: &VectorcraftApp) -> usize {
|
||||
app.session.doc().unwrap().history.undo.len()
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ fn tolerance(o: &Value, key: &str) -> NumberField<'static> {
|
||||
/// checkbox is on.
|
||||
fn row(app: &mut VectorcraftApp, ui: &mut Ui, o: &Value, label: &'static str, flag: &str, tol: Option<(&str, &dyn Fn() -> NumberField<'static>)>) {
|
||||
let on = o[flag].as_bool().unwrap_or(false);
|
||||
Row::new().fill_width().align(RowAlign::SpaceBetween).show(ui, |ui, _| {
|
||||
Row::new().fill_width().align(RowAlign::SpaceBetween).wrap(true).show(ui, |ui, _| {
|
||||
if let Some(now) = Checkbox::new(Bind::given(on)).label(label).id_salt(flag).show(ui).value().copied() {
|
||||
app.run("magicWand.set", json!({ flag: now })).ok();
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ fn body(app: &mut VectorcraftApp, ui: &mut Ui, first: Option<&Node>, n_sel: usiz
|
||||
}
|
||||
appearance_section::appearance_section(app, ui);
|
||||
section(tl!("Align")).show(ui, |ui, _| {
|
||||
Row::new().show(ui, |ui, _| {
|
||||
Row::new().wrap(true).show(ui, |ui, _| {
|
||||
super::align::align_buttons(app, ui);
|
||||
// The rest (Distribute Objects, Distribute Spacing, Align To) is the Align panel's.
|
||||
more_options(ui, "align", tl!("More Align options"));
|
||||
|
||||
@@ -391,7 +391,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
arrow_rows(app, ui, st.as_ref());
|
||||
ui.separator();
|
||||
Field::new(tl!("Profile")).show(ui, |ui, _| {
|
||||
Row::new().show(ui, |ui, _| {
|
||||
Row::new().wrap(true).show(ui, |ui, _| {
|
||||
profile_select(app, ui);
|
||||
flip_buttons(app, ui, st.as_ref());
|
||||
});
|
||||
|
||||
@@ -65,12 +65,13 @@ impl View {
|
||||
(View::SmallList, "Small List View"),
|
||||
(View::LargeList, "Large List View"),
|
||||
];
|
||||
/// The browser's view and thumbnail zoom this mode stands for.
|
||||
/// The browser's view and thumbnail zoom this mode stands for: thumbnails of about 12, 16 and 32 points on the
|
||||
/// 48-point large thumbnail, the 11, 15.5 and 30 point tiles of production.
|
||||
pub(crate) fn preset(self) -> (PresetView, f64) {
|
||||
match self {
|
||||
View::SmallThumb => (PresetView::Grid, 0.5),
|
||||
View::MediumThumb => (PresetView::Grid, 0.75),
|
||||
View::LargeThumb => (PresetView::Grid, 1.0),
|
||||
View::SmallThumb => (PresetView::Grid, 0.25),
|
||||
View::MediumThumb => (PresetView::Grid, 1.0 / 3.0),
|
||||
View::LargeThumb => (PresetView::Grid, 2.0 / 3.0),
|
||||
View::SmallList => (PresetView::List, 0.5),
|
||||
View::LargeList => (PresetView::List, 1.0),
|
||||
}
|
||||
@@ -751,6 +752,14 @@ fn popup(ui: &mut Ui, label: &'static str, opener: Option<&Response>, mut body:
|
||||
}
|
||||
}
|
||||
|
||||
// The footer's actions, in order.
|
||||
const LIBRARIES: usize = 0;
|
||||
const KINDS: usize = 1;
|
||||
const EDIT: usize = 2;
|
||||
const DELETE: usize = 3;
|
||||
const NEW: usize = 4;
|
||||
const NEW_GROUP: usize = 5;
|
||||
|
||||
/// The panel's footer: Swatch Libraries, Show Swatch Kinds, Edit Color Group or Swatch Options, New Color Group, New
|
||||
/// Swatch and Delete. Alt-click on Delete deletes without asking; Cmd/Ctrl-click on New Swatch makes a spot color, and
|
||||
/// Cmd/Ctrl+Shift-click a global process color. Swatches dragged from the list and dropped on New Swatch are
|
||||
@@ -763,31 +772,32 @@ fn footer(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
let group = actions::selected_group(app, &sel).filter(|_| opts.is_none());
|
||||
let icon = |id: &'static str| IconSpec::svg(IconId::new(id));
|
||||
let rows_drag = |d: &PanelDrag| matches!(d, PanelDrag::Paint { rows: Some(_), .. });
|
||||
// The first action sits at the end edge.
|
||||
let edit = if group.is_some() {
|
||||
FooterAction::new(icon("palette"), tl!("Edit or Apply Color Group"))
|
||||
} else {
|
||||
FooterAction::new(icon("dc-options"), tl!("Swatch Options")).enabled(opts.is_some())
|
||||
};
|
||||
// Libraries, Show Swatch Kinds and the edit action sit at the start edge; Delete at the end edge, then New Swatch
|
||||
// and New Color Group before it.
|
||||
let actions = [
|
||||
FooterAction::new(icon("library"), SwatchLibraries::MENU).pressed(library_panel::any_open::<SwatchLibraries>(&app.ui)),
|
||||
FooterAction::new(icon("dc-swatch-kinds"), tl!("Show Swatch Kinds")).pressed(kind != Kind::All),
|
||||
edit,
|
||||
FooterAction::new(icon("trash-2"), tl!("Delete Swatch"))
|
||||
.enabled(!del.is_empty())
|
||||
.takes_drops_disabled(del.is_empty())
|
||||
.accepts_drops::<PanelDrag>(rows_drag),
|
||||
FooterAction::new(icon("dc-new-item"), tl!("New Swatch")).accepts_drops::<PanelDrag>(rows_drag),
|
||||
FooterAction::new(icon("dc-folder"), tl!("New Color Group")),
|
||||
edit,
|
||||
FooterAction::new(icon("dc-swatch-kinds"), tl!("Show Swatch Kinds")).pressed(kind != Kind::All),
|
||||
FooterAction::new(icon("library"), SwatchLibraries::MENU).pressed(library_panel::any_open::<SwatchLibraries>(&app.ui)),
|
||||
];
|
||||
let out = FooterBar::actions(actions).show_footer(ui);
|
||||
let out = FooterBar::actions(actions).at_start(EDIT + 1).show_footer(ui);
|
||||
match out.picked {
|
||||
Some(0) if !del.is_empty() => actions::delete(app, del, out.mods.alt),
|
||||
Some(1) => actions::new_swatch(app, &sel, out.mods),
|
||||
Some(2) => {
|
||||
Some(DELETE) if !del.is_empty() => actions::delete(app, del, out.mods.alt),
|
||||
Some(NEW) => actions::new_swatch(app, &sel, out.mods),
|
||||
Some(NEW_GROUP) => {
|
||||
app.run("ui.newColorGroup", json!({"swatches": del})).ok();
|
||||
}
|
||||
Some(3) => match (group, opts) {
|
||||
Some(EDIT) => match (group, opts) {
|
||||
(Some(g), _) => actions::edit_group(app, &g),
|
||||
(None, Some(n)) => {
|
||||
app.run("ui.swatchOptions", json!({"name": n})).ok();
|
||||
@@ -800,19 +810,19 @@ fn footer(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
&& let Some(drag) = drop.payload::<PanelDrag>()
|
||||
{
|
||||
match drop.index {
|
||||
0 => dnd::on_footer_drop(app, dnd::FooterTarget::Delete, drag),
|
||||
1 => dnd::on_footer_drop(app, dnd::FooterTarget::New, drag),
|
||||
DELETE => dnd::on_footer_drop(app, dnd::FooterTarget::Delete, drag),
|
||||
NEW => dnd::on_footer_drop(app, dnd::FooterTarget::New, drag),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
popup(ui, tl!("Show Swatch Kinds"), out.responses.get(4), |ui| {
|
||||
popup(ui, tl!("Show Swatch Kinds"), out.responses.get(KINDS), |ui| {
|
||||
for (k, label) in Kind::ALL {
|
||||
if item(ui, label, true, Some(k == kind)) {
|
||||
app.ui.swatches_panel.kind = k;
|
||||
}
|
||||
}
|
||||
});
|
||||
popup(ui, tl!("Swatch Libraries"), out.responses.get(5), |ui| {
|
||||
popup(ui, tl!("Swatch Libraries"), out.responses.get(LIBRARIES), |ui| {
|
||||
ui.set_min_width(200.0);
|
||||
library_panel::library_menu::<SwatchLibraries>(app, ui);
|
||||
});
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
//! Headless frames of panel rows that the framework lays out: controls side by side stay inside the panel's width.
|
||||
|
||||
use serde_json::json;
|
||||
|
||||
use super::tests_appearance::app_with_rect;
|
||||
use super::*;
|
||||
use crate::i18n::Lang;
|
||||
use crate::panel_docking::PANEL_MIN_WIDTH;
|
||||
use crate::tests::panel_harness::{Panel, ROOM};
|
||||
|
||||
@@ -27,6 +30,100 @@ fn the_color_themes_hex_row_stays_inside_a_narrow_panel() {
|
||||
}
|
||||
}
|
||||
|
||||
/// Panel `panel` floated `width` wide in the whole app window, drawn in `lang`: the rect of its body, and the rects of
|
||||
/// the controls named each of `names` (catalog strings, shown in `lang`).
|
||||
fn floated(panel: &str, lang: &str, width: f32, names: &[&str]) -> (egui::Rect, Vec<(String, Vec<egui::Rect>)>) {
|
||||
use egui::accesskit::Role;
|
||||
const AT: f32 = 520.0;
|
||||
let mut app = app_with_rect();
|
||||
app.session.prefs.interface_language = lang.into();
|
||||
app.run("window.panel", json!({ "panel": panel })).unwrap();
|
||||
app.run("window.panel.float", json!({ "panel": panel, "x": AT, "y": 120, "width": width, "height": 700 })).unwrap();
|
||||
let ctx = crate::testing::ui_context();
|
||||
ctx.enable_accesskit();
|
||||
let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1440.0, 900.0));
|
||||
let mut nodes = Vec::new();
|
||||
for at in 1..=8 {
|
||||
let input = egui::RawInput { time: Some(f64::from(at) * 0.1), screen_rect: Some(screen), ..Default::default() };
|
||||
let out = crate::testing::app_frame(&mut app, &ctx, input);
|
||||
nodes = out.platform_output.accesskit_update.map_or_else(Vec::new, |update| update.nodes);
|
||||
}
|
||||
// The frames set the language from the preference; the names are looked up in it before English is put back.
|
||||
let shown: Vec<&str> = names.iter().map(|name| crate::i18n::t(name)).collect();
|
||||
crate::i18n::set_current(Lang::EN);
|
||||
let rect = |node: &egui::accesskit::Node| {
|
||||
node.bounds().map(|b| egui::Rect::from_min_max(egui::pos2(b.x0 as f32, b.y0 as f32), egui::pos2(b.x1 as f32, b.y1 as f32)))
|
||||
};
|
||||
// The floating panel's body: the tab panel at the left edge the float asked for.
|
||||
let body = nodes
|
||||
.iter()
|
||||
.filter(|(_, n)| n.role() == Role::TabPanel)
|
||||
.find_map(|(_, n)| rect(n).filter(|r| (r.left() - AT).abs() < 1.0))
|
||||
.unwrap_or_else(|| panic!("{panel} does not float at x {AT}"));
|
||||
assert!(body.width() <= width + 1.0, "{panel}'s body {body:?} is wider than the {width} the float asked for");
|
||||
let controls = shown
|
||||
.into_iter()
|
||||
.map(|name| {
|
||||
let found: Vec<egui::Rect> = nodes.iter().filter(|(_, n)| n.label().is_some_and(|l| l == name)).filter_map(|(_, n)| rect(n)).collect();
|
||||
assert!(!found.is_empty(), "{panel} shows no {name:?}");
|
||||
(name.to_owned(), found)
|
||||
})
|
||||
.collect();
|
||||
(body, controls)
|
||||
}
|
||||
|
||||
/// The controls named `names` (catalog strings, shown in `lang`) that reach past either side of panel `panel`,
|
||||
/// floated at the narrowest panel width in the whole app window, each with its rect.
|
||||
fn past_a_narrow_panel(panel: &str, lang: &str, names: &[&str]) -> Vec<String> {
|
||||
let (body, controls) = floated(panel, lang, PANEL_MIN_WIDTH, names);
|
||||
let outside = |r: &egui::Rect| r.left() < body.left() - 0.5 || r.right() > body.right() + 0.5;
|
||||
controls.iter().flat_map(|(name, found)| found.iter().filter(|r| outside(r)).map(move |r| format!("{name} at {r:?}"))).collect()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_profile_row_stays_on_one_line_in_a_wide_stroke_panel() {
|
||||
let (_, controls) = floated("stroke", "en", 360.0, &["Profile", "Flip Along", "Flip Across"]);
|
||||
// The field, its caption, the list and the two buttons share one line, so their middles are level.
|
||||
let middles: Vec<f32> = controls.iter().flat_map(|(_, found)| found.iter().map(|r| r.center().y)).collect();
|
||||
assert!(middles.windows(2).all(|m| (m[0] - m[1]).abs() < 1.0), "{controls:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_profile_row_wraps_in_a_narrow_stroke_panel() {
|
||||
let past = past_a_narrow_panel("stroke", "en", &["Profile", "Flip Along", "Flip Across"]);
|
||||
assert!(past.is_empty(), "past the panel: {past:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_attributes_rows_wrap_in_a_narrow_panel() {
|
||||
let past = past_a_narrow_panel("attributes", "en", &["Fill Rule", "Image Map", "Browser", "URL"]);
|
||||
assert!(past.is_empty(), "past the panel: {past:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_variables_footer_wraps_in_a_narrow_panel() {
|
||||
let past = past_a_narrow_panel("variables", "en", &["Delete Variable", "Lock Variables"]);
|
||||
assert!(past.is_empty(), "past the panel: {past:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_align_row_wraps_in_a_narrow_properties_panel() {
|
||||
let past = past_a_narrow_panel("properties", "en", &["Vertical Align Bottom", "More Align options"]);
|
||||
assert!(past.is_empty(), "past the panel: {past:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_document_info_rows_wrap_in_a_narrow_panel_in_german() {
|
||||
let past = past_a_narrow_panel("docInfo", "de", &["Flattener Preset"]);
|
||||
assert!(past.is_empty(), "past the panel: {past:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_magic_wand_rows_wrap_in_a_narrow_panel_in_french() {
|
||||
let past = past_a_narrow_panel("magicWand", "fr", &["Tolerance:"]);
|
||||
assert!(past.is_empty(), "past the panel: {past:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_color_wheel_box_and_its_strip_stay_inside_the_panel() {
|
||||
let mut app = app_with_rect();
|
||||
@@ -36,3 +133,12 @@ fn the_color_wheel_box_and_its_strip_stay_inside_the_panel() {
|
||||
assert!(strip.height() <= field.height(), "the strip {strip:?} is taller than the box {field:?}");
|
||||
assert!(field.right() <= ROOM.x && strip.right() <= ROOM.x, "the box {field:?} or its strip {strip:?} runs past the panel");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn align_to_shares_the_distribute_spacing_line_inside_the_align_panel() {
|
||||
let panel = Panel::new(app_with_rect(), align::show);
|
||||
let (field, to) = (panel.rect("Distribute Spacing"), panel.rect("Align to Artboard"));
|
||||
assert!(to.left() > field.right(), "Align To at {to:?} is not beside the spacing field {field:?}");
|
||||
assert!((field.top()..=field.bottom()).contains(&to.center().y), "Align To at {to:?} is off the spacing field's line {field:?}");
|
||||
assert!(to.right() <= ROOM.x, "Align To at {to:?} runs past the panel");
|
||||
}
|
||||
@@ -16,7 +16,7 @@ use craft::keymap::CommandRef;
|
||||
use craft::ui::buttons::IconButton;
|
||||
use craft::ui::choice::Checkbox;
|
||||
use craft::ui::contract::{Bind, Entry, GlyphLabel, LabelKind, LabelPress, Props, Show, ShowContainer, SideLabel, Sizing};
|
||||
use craft::ui::display::{Shade, Text};
|
||||
use craft::ui::display::{Divider, Shade, Text};
|
||||
use craft::ui::form::Field;
|
||||
use craft::ui::layout_components::Row;
|
||||
use craft::ui::menu::PanelRow;
|
||||
@@ -576,18 +576,21 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
IconButton::command(IconId::new("flip-vertical-2"), FLIP_HORIZONTAL).show(ui);
|
||||
IconButton::command(IconId::new("flip-horizontal-2"), FLIP_VERTICAL).show(ui);
|
||||
});
|
||||
// Live shape properties (a path with live corners is no shape).
|
||||
// Live shape properties (a path with live corners is no shape), ruled off from the fields as the options are.
|
||||
if let Some(n) = first_selected(app)
|
||||
&& let NodeKind::Path { live: Some(live), .. } = &n.kind
|
||||
&& !matches!(**live, LiveShape::Path { .. })
|
||||
&& !live_shape_rows(app, ui, &n, live, true)
|
||||
{
|
||||
Text::new(tl!("Shape Properties:")).show(ui);
|
||||
Text::new(tl!(n.kind_label())).shade(Shade::Muted).show(ui);
|
||||
Divider::horizontal().show(ui);
|
||||
if !live_shape_rows(app, ui, &n, live, true) {
|
||||
Text::new(tl!("Shape Properties:")).show(ui);
|
||||
Text::new(tl!(n.kind_label())).shade(Shade::Muted).show(ui);
|
||||
}
|
||||
}
|
||||
if part_hidden(app, HIDE_OPTIONS_KEY) {
|
||||
return;
|
||||
}
|
||||
Divider::horizontal().show(ui);
|
||||
let (sc, ss) = (app.session.prefs.scale_corners, app.session.prefs.scale_strokes);
|
||||
option_check(app, ui, tl!("Scale Corners"), "scaleCorners", sc);
|
||||
option_check(app, ui, tl!("Scale Strokes & Effects"), "scaleStrokes", ss);
|
||||
|
||||
@@ -558,7 +558,7 @@ fn footer(ui: &mut Ui, states: &RowStates) -> Option<&'static str> {
|
||||
FooterBar::body().show(ui, |ui, _| {
|
||||
Stack::new().show(ui, |ui, _| {
|
||||
for row in FOOTER {
|
||||
Row::new().show(ui, |ui, _| {
|
||||
Row::new().wrap(true).show(ui, |ui, _| {
|
||||
for &(icon, id) in row {
|
||||
let name = title(id, states.locked);
|
||||
let button = IconButton::new(IconId::new(icon)).label(name).tooltip(name).enabled(states.enabled(id));
|
||||
|
||||
@@ -2010,6 +2010,25 @@ mod tests {
|
||||
out.textures_delta.clear();
|
||||
}
|
||||
|
||||
/// Frames of the app with the dialog open ask for no rerun once its first frame has sized it: the commands of its
|
||||
/// set row publish the state they had the frame before.
|
||||
#[test]
|
||||
fn an_open_dialog_asks_for_no_rerun_after_its_first_frame() {
|
||||
let mut app = crate::testing::windowed(VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()));
|
||||
let ctx = app.ui_ctx.clone().unwrap();
|
||||
let raw =
|
||||
|| egui::RawInput { screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1600.0, 1000.0))), ..Default::default() };
|
||||
for _ in 0..3 {
|
||||
crate::testing::app_frame(&mut app, &ctx, raw());
|
||||
}
|
||||
open(&mut app);
|
||||
crate::testing::app_frame(&mut app, &ctx, raw());
|
||||
for frame in 0..4 {
|
||||
let out = crate::testing::app_frame(&mut app, &ctx, raw());
|
||||
assert_eq!(out.platform_output.num_completed_passes, 1, "frame {frame} after the first is drawn again");
|
||||
}
|
||||
}
|
||||
|
||||
/// An open dialog lists a live-effect plug-in installed while it is open, with the shortcut its
|
||||
/// set gives it, and drops the row while the plug-in is removed, keeping that shortcut in the
|
||||
/// set.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//! gives a real window, so a test lays text out and paints in the app's look; and the frame the
|
||||
//! hosts run.
|
||||
|
||||
use craft::ui::runtime::frame::{FrameInput, set_input};
|
||||
use craft::ui::runtime::frame::{FrameInput, set_input, take_output};
|
||||
use craft::ui::shell::embed;
|
||||
|
||||
/// Installs the runtime with a window system that has no OS services, the app's interface fonts
|
||||
@@ -36,8 +36,9 @@ pub(crate) fn ui_context() -> egui::Context {
|
||||
|
||||
/// One frame of the whole app on `ctx` as the hosts run it (kb.C26): the app has the window's context, as the hosts
|
||||
/// hand it when they create the app, gives the input of the frame
|
||||
/// (`embed::before_input`), the window draws with `raw`, and the app takes what the runtime gathered in it, running the
|
||||
/// commands it fired, as the host's next frame begins. The frame's texture uploads are handled.
|
||||
/// (`embed::before_input`, once, as the hosts call it), the window draws with `raw`, and the app takes what the runtime
|
||||
/// gathered in it, running the commands it fired, as the host's next frame begins ([`run_fired`]). The frame's texture
|
||||
/// uploads are handled.
|
||||
pub(crate) fn app_frame(app: &mut crate::VectorcraftApp, ctx: &egui::Context, raw: egui::RawInput) -> egui::FullOutput {
|
||||
part_frame(app, ctx, raw, |app, ui| {
|
||||
app.tick(ui.ctx());
|
||||
@@ -56,11 +57,18 @@ pub(crate) fn part_frame(
|
||||
app.raw_input(ctx, &mut raw);
|
||||
embed::before_input(ctx, |out| app.frame_input(out));
|
||||
let mut out = ctx.run_ui(raw, |ui| draw(app, ui));
|
||||
embed::before_input(ctx, |out| app.frame_input(out));
|
||||
run_fired(app, ctx);
|
||||
out.textures_delta.clear();
|
||||
out
|
||||
}
|
||||
|
||||
/// The app takes what the runtime gathered on `ctx` since the last frame began and runs the commands it fired, as the
|
||||
/// host's next `embed::before_input` does, without giving the runtime its input: the next frame gives it. A second
|
||||
/// input in one frame makes every command state the next frame publishes look changed, and the frame asks for a rerun.
|
||||
pub(crate) fn run_fired(app: &mut crate::VectorcraftApp, ctx: &egui::Context) {
|
||||
let _ = app.frame_input(take_output(ctx));
|
||||
}
|
||||
|
||||
/// Held by a test that changes the custom dictionary, which the whole process shares, or that needs it to hold still:
|
||||
/// every change moves the dictionary's generation, and a Check Spelling walk that sees it move checks its scope again
|
||||
/// from the start.
|
||||
|
||||
@@ -145,7 +145,8 @@ fn home_lists_recent_files_and_a_click_opens_one() {
|
||||
}
|
||||
|
||||
/// The Home screen has a Learn section: every tutorial of the Learn panel under its skill. A
|
||||
/// tutorial shows the Learn panel at its steps and no document is opened.
|
||||
/// tutorial shows the Learn panel at its steps and no document is opened; the Quick skill guide
|
||||
/// shows its list of skills.
|
||||
#[test]
|
||||
fn home_has_a_learn_section_that_opens_the_learn_panel() {
|
||||
use crate::panels::learn::{self, Tab, View, catalog};
|
||||
@@ -164,6 +165,9 @@ fn home_has_a_learn_section_that_opens_the_learn_panel() {
|
||||
assert_eq!(app.ui.learn, View { tab: Tab::Skills, skill: Some("draw"), tutorial: Some("pen-paths") });
|
||||
assert!(app.session.documents().is_empty(), "no document is opened");
|
||||
assert!(crate::menus::home_showing(&app), "Home stays");
|
||||
drop(app);
|
||||
home.click("Quick skill guide");
|
||||
assert_eq!(home.app().ui.learn, View { tab: Tab::Skills, skill: None, tutorial: None }, "the guide shows the list of skills");
|
||||
}
|
||||
|
||||
/// Home shown over open documents has the Learn section too; a tutorial chosen there leaves the
|
||||
|
||||
@@ -64,7 +64,7 @@ fn run_frame(
|
||||
}
|
||||
});
|
||||
// The commands the frame fired run as the host's next frame begins (`testing::app_frame`).
|
||||
craft::ui::shell::embed::before_input(ctx, |output| app.frame_input(output));
|
||||
crate::testing::run_fired(app, ctx);
|
||||
out.textures_delta.clear();
|
||||
(passes, out.platform_output.ime)
|
||||
}
|
||||
|
||||
@@ -125,10 +125,7 @@ impl Mac {
|
||||
screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(1600.0, 850.0))),
|
||||
..Default::default()
|
||||
};
|
||||
let app = &mut self.app;
|
||||
craft::ui::shell::embed::before_input(&self.ctx, |out| app.frame_input(out));
|
||||
|
||||
crate::testing::app_frame(app, &self.ctx, raw)
|
||||
crate::testing::app_frame(&mut self.app, &self.ctx, raw)
|
||||
}
|
||||
|
||||
/// AppKit chose an item by its key equivalent `sc`. A paste the menu asks the host for
|
||||
|
||||
@@ -48,14 +48,11 @@ pub(super) fn window(app: VectorcraftApp) -> Window {
|
||||
/// commands the pass fired run as the next frame begins.
|
||||
pub(super) fn app_step(h: &mut Window) {
|
||||
let ctx = h.ctx.clone();
|
||||
let input = |h: &mut Window| {
|
||||
let app = h.state_mut();
|
||||
app.adopt_context(&ctx);
|
||||
craft::ui::shell::embed::before_input(&ctx, |out| app.frame_input(out));
|
||||
};
|
||||
input(h);
|
||||
let app = h.state_mut();
|
||||
app.adopt_context(&ctx);
|
||||
craft::ui::shell::embed::before_input(&ctx, |out| app.frame_input(out));
|
||||
h.step();
|
||||
input(h);
|
||||
crate::testing::run_fired(h.state_mut(), &ctx);
|
||||
}
|
||||
|
||||
/// Draws a frame of `h` at `time` seconds.
|
||||
|
||||
@@ -315,11 +315,7 @@ pub(super) fn frame(app: &mut VectorcraftApp, events: Vec<egui::Event>) -> egui:
|
||||
static CTX: egui::Context = crate::testing::ui_context();
|
||||
}
|
||||
let ctx = CTX.with(Clone::clone);
|
||||
craft::ui::shell::embed::before_input(&ctx, |output| app.frame_input(output));
|
||||
let mut out = crate::testing::app_frame(app, &ctx, egui::RawInput { events, ..Default::default() });
|
||||
craft::ui::shell::embed::before_input(&ctx, |output| app.frame_input(output));
|
||||
out.textures_delta.clear();
|
||||
out
|
||||
crate::testing::app_frame(app, &ctx, egui::RawInput { events, ..Default::default() })
|
||||
}
|
||||
|
||||
/// The paste egui sends for a clipboard with a picture and no text.
|
||||
|
||||
+27
-10
@@ -147,18 +147,31 @@ pub fn root_theme(prefs: &Prefs) -> (ThemeId, ModeChoice, Option<Rgba>) {
|
||||
|
||||
/// The app's sizes over the framework's size sets (`sizes.json`): push buttons have the app's 4-point corners
|
||||
/// where the sets give pills, the Home title is 26-point under 60 points of page margin with a 36-point call to
|
||||
/// action, and the compact set takes the reference app's metrics:
|
||||
/// 26-point fields and spinners, 24-point push buttons, 10 points inside panels, 5 between rows, 13-point body type
|
||||
/// with 12.5-point labels and 11-point captions, 16-point glyphs in icon buttons, 5-point control corners, 8-point
|
||||
/// menus and 10-point windows, 33-point panel tabs, 310-point dock columns with 14-point column bars and 38-point
|
||||
/// icon columns.
|
||||
/// action, Home keeps production's rhythm (its item spacing of 5 plus the room it added: 9 from title to subtitle, 27
|
||||
/// to New and Open, 28-point New and Open with 16 points beside their labels and 14 between them, 33 between sections,
|
||||
/// 15 under a heading, 24-point link rows 5 apart), and the compact set takes the reference app's metrics:
|
||||
/// 26-point fields and spinners, 24-point push buttons, 10 points inside panels, 5 between rows, 16-point glyphs in
|
||||
/// icon buttons, 5-point control corners, 8-point menus and 10-point windows, 33-point panel tabs, 310-point dock
|
||||
/// columns with 14-point column bars and 38-point icon columns, 29-point menu rows, and dialogs 22 points inside their
|
||||
/// edge with 28-point buttons at least 72 points wide.
|
||||
/// Its type is the size the reference app draws: it set Inter at 92% of its nominal 13-point body, 12.5-point labels
|
||||
/// and 11.5-point captions, so they read at 12, 11.5 and 10.5 points, on the rows those nominal sizes gave.
|
||||
const SIZES: &[u8] = br#"{
|
||||
"all": {
|
||||
"radius.button": 4,
|
||||
"typography.display.size": 26,
|
||||
"typography.display.line_height": 32,
|
||||
"size.page.margin": 60,
|
||||
"size.page.action": 36
|
||||
"size.page.action": 36,
|
||||
"size.page.button": 28,
|
||||
"size.page.button_side": 16,
|
||||
"size.page.gap.title": 9,
|
||||
"size.page.gap.lead": 27,
|
||||
"size.page.gap.actions": 14,
|
||||
"size.page.gap.section": 33,
|
||||
"size.page.gap.heading": 15,
|
||||
"size.page.gap.link": 5,
|
||||
"size.page.link": 24
|
||||
},
|
||||
"compact": {
|
||||
"size.control.md": 26,
|
||||
@@ -175,13 +188,17 @@ const SIZES: &[u8] = br#"{
|
||||
"radius.control": 5,
|
||||
"radius.surface": 8,
|
||||
"radius.window": 10,
|
||||
"typography.body.size": 13,
|
||||
"size.dialog.button": 72,
|
||||
"size.dialog.button_height": 28,
|
||||
"size.row.menu": 29,
|
||||
"space.pad.dialog": 22,
|
||||
"typography.body.size": 12,
|
||||
"typography.body.line_height": 17,
|
||||
"typography.body_strong.size": 13,
|
||||
"typography.body_strong.size": 12,
|
||||
"typography.body_strong.line_height": 17,
|
||||
"typography.label.size": 12.5,
|
||||
"typography.label.size": 11.5,
|
||||
"typography.label.line_height": 17,
|
||||
"typography.caption.size": 11,
|
||||
"typography.caption.size": 10.5,
|
||||
"typography.caption.line_height": 15
|
||||
}
|
||||
}"#;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
use std::sync::{Mutex, MutexGuard};
|
||||
|
||||
use craft::ui::runtime::frame::take_output;
|
||||
use craft::ui::shell::embed;
|
||||
use egui::{Event, Rect, vec2};
|
||||
use serde_json::json;
|
||||
@@ -99,7 +100,7 @@ impl Frames {
|
||||
},
|
||||
|ui| chrome::control_bar(app, ui),
|
||||
);
|
||||
embed::before_input(&self.ctx, |out| app.frame_input(out));
|
||||
let _ = app.frame_input(take_output(&self.ctx));
|
||||
let nodes =
|
||||
output.platform_output.accesskit_update.take().map(|update| update.nodes.into_iter().map(|(_, node)| node).collect()).unwrap_or_default();
|
||||
output.textures_delta.clear();
|
||||
|
||||
@@ -31,13 +31,15 @@ fn pointer_events(events: &[Event]) -> usize {
|
||||
events.iter().filter(|event| matches!(event, Event::PointerMoved(_) | Event::PointerButton { .. })).count()
|
||||
}
|
||||
|
||||
/// One step of the app: the frame of `raw`, then empty frames at its time until all its pointer events arrived. A frame
|
||||
/// can take more than one pass, and egui gives the frame's events to its first; the framework gives a pass one press,
|
||||
/// as its last pointer event, and holds the events after it for the next frame ("Input pacing", one press per pass).
|
||||
/// One step of the app: the frame of `raw`, then empty frames at its time until all its pointer events arrived and the
|
||||
/// press lifecycle reported them. A frame can take more than one pass, and egui gives the frame's events to its first;
|
||||
/// the framework gives a pass one press, as its last pointer event, and holds the events after it for the next frame
|
||||
/// ("Input pacing", one press per pass). The lifecycle reports one phase a pass: a pass that brings a release and the
|
||||
/// next press reports the press's Down in the next pass, and the release that follows it one pass later still.
|
||||
fn run_ui(app: &mut VectorcraftApp, ctx: &egui::Context, mut raw: RawInput) -> egui::FullOutput {
|
||||
let (sent, time, screen_rect) = (pointer_events(&raw.events), raw.time, raw.screen_rect);
|
||||
let mut frames = Vec::new();
|
||||
let mut arrived = 0;
|
||||
let (mut arrived, mut owed) = (0, 0);
|
||||
loop {
|
||||
let mut first = None;
|
||||
let out = ctx.run_ui(raw, |ui| {
|
||||
@@ -49,8 +51,10 @@ fn run_ui(app: &mut VectorcraftApp, ctx: &egui::Context, mut raw: RawInput) -> e
|
||||
});
|
||||
let first = first.expect("a frame runs a pass");
|
||||
arrived += pointer_events(&first.events);
|
||||
let buttons = first.events.iter().filter(|event| matches!(event, Event::PointerButton { .. })).count();
|
||||
owed = (owed + buttons).saturating_sub(out.platform_output.num_completed_passes);
|
||||
frames.push(first);
|
||||
if arrived >= sent {
|
||||
if arrived >= sent && owed == 0 {
|
||||
FRAME_INPUT.with(|input| *input.borrow_mut() = Some((frames, ctx.cumulative_pass_nr())));
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ impl Scene {
|
||||
// As the hosts run a frame: the app gives its input, and the commands the pass fired run as the next frame begins.
|
||||
craft::ui::shell::embed::before_input(&self.ctx, |out| self.app.frame_input(out));
|
||||
let mut out = self.ctx.run_ui(raw, |ui| self.app.ui(ui));
|
||||
craft::ui::shell::embed::before_input(&self.ctx, |out| self.app.frame_input(out));
|
||||
let _ = self.app.frame_input(craft::ui::runtime::frame::take_output(&self.ctx));
|
||||
out.textures_delta.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
use std::sync::{Mutex, MutexGuard};
|
||||
|
||||
use craft::ui::runtime::frame::take_output;
|
||||
use craft::ui::shell::embed;
|
||||
use egui::{Event, Key, Modifiers};
|
||||
use serde_json::json;
|
||||
@@ -65,6 +66,7 @@ impl Keyboard {
|
||||
|
||||
fn frame(&mut self, app: &mut VectorcraftApp, events: Vec<Event>) {
|
||||
self.time += 0.05;
|
||||
app.adopt_context(&self.ctx);
|
||||
embed::before_input(&self.ctx, |out| app.frame_input(out));
|
||||
let mut out = self.ctx.run_ui(
|
||||
egui::RawInput {
|
||||
@@ -79,8 +81,8 @@ impl Keyboard {
|
||||
app.ui(ui);
|
||||
},
|
||||
);
|
||||
// The commands the pass fired run as the host's next frame begins.
|
||||
embed::before_input(&self.ctx, |out| app.frame_input(out));
|
||||
// The commands the pass fired run as the host's next frame begins; the next frame gives the input.
|
||||
let _ = app.frame_input(take_output(&self.ctx));
|
||||
out.textures_delta.clear();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -442,7 +442,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi
|
||||
such stubs into one vertex (within 4× the sweep's tolerance up and down its frame and 1/16 of the 0.01 pt precision
|
||||
along it, bounded by each cluster's extent so a run of tiny level segments keeps its length); regression tests
|
||||
in `crates/pathops/src/planar.rs`. Estimate unchanged.
|
||||
- **Done (#864):** SVG export writes physical unit suffixes on the root `<svg width="..." height="...">` for documents with physical units (`mm`, `cm`, `in`, `pc`), so external vector tools (Inkscape, LightBurn) and browsers render drawings at their intended physical scale rather than scaling to 75% under point-based user-unit assumptions; unitless user coordinates in `viewBox` and path geometry remain in 1:1 internal points per SVG 1.1 coords §7.10, preserving document units on round trips (`export_physical_units_writes_unit_suffixes`, `svg_round_trip_preserves_document_units`). General document unit preferences across restarts remain tracked under #864.
|
||||
- **Done (#864):** SVG export writes physical unit suffixes on the root `<svg width="..." height="...">` for documents with physical units (`mm`, `cm`, `in`, `pc`; documents in feet and yards are written in `in`, in meters in `cm`, and in Q or Ha in `mm`, since SVG has no unit for them: `every_physical_document_unit_exports_its_printed_size`), so external vector tools (Inkscape, LightBurn) and browsers render drawings at their intended physical scale rather than scaling to 75% under point-based user-unit assumptions; unitless user coordinates in `viewBox` and path geometry remain in 1:1 internal points per SVG 1.1 coords §7.10. A round trip keeps `mm`, `cm`, `in` and `pc` documents in their unit (`export_physical_units_writes_unit_suffixes`, `svg_round_trip_preserves_document_units`); documents in feet, yards, meters, Q or Ha keep their printed size and open again in the SVG unit they were written in. General document unit preferences across restarts remain tracked under #864.
|
||||
- **Missing:** general document unit preference on restart (#864; SVG export physical units done). Shape Builder regions (#937, closed), PDF text placement
|
||||
(#722, above), the bezier drag preview (#834, #3065, #3729) and deleting an interior anchor of an open path (above)
|
||||
are done.
|
||||
|
||||
+18
-10
@@ -2561,11 +2561,11 @@ script, and it does not change the document or the preferences. The reply's `kin
|
||||
top-level `import` or `export`, such as a React `.jsx` file), `notText` (a NUL byte, or more than one byte in ten a
|
||||
control character, in the first 8 KiB) or `tooLarge` (over 8 MiB). For a script, the reply holds these lists:
|
||||
|
||||
- `needs` lists what the script needs from the app that runs it: `language` (the script language's own objects
|
||||
and directives, such as `$`, `alert`, `UnitValue`, `#target` and `#targetengine`), `dom` (the reference app's
|
||||
document model), `files`, `menuCommands`, `dialogs`, and `hostOnly` (features only the reference app has:
|
||||
palettes, BridgeTalk, sockets, native code, XMP, the XML object and E4X, operator overloading, reflection, actions
|
||||
and `selectTool`).
|
||||
- `needs` lists what the script needs from the app that runs it: `language` (the script language's own objects,
|
||||
syntax and directives, such as `$`, `alert`, `UnitValue`, the XML object and E4X, `#target` and `#targetengine`),
|
||||
`dom` (the reference app's document model), `files`, `menuCommands`, `dialogs`, and `hostOnly` (features only the
|
||||
reference app has: palettes, BridgeTalk, sockets, native code, XMP, operator overloading, reflection, actions and
|
||||
`selectTool`).
|
||||
- `directives` lists the `#include`, `#includepath`, `#script`, `#strict`, `#target` and `#targetengine` lines,
|
||||
and `targets` splits each `#target` line's application specifier into `app`, `instance`, `version` and
|
||||
`locale`. A directive is read where it starts a line, written `#name` or `//@name`.
|
||||
@@ -2670,7 +2670,12 @@ also reads two ECMAScript 2020 forms (https://262.ecma-international.org/11.0/):
|
||||
`f?.(args)`), which give `undefined` and skip the rest of the chain when the value before `?.` is `undefined` or
|
||||
`null`, and `??`, which evaluates its right side only when its left side is `undefined` or `null`. Mixing `??` with `&&`
|
||||
or `||` without parentheses, and assigning to an optional chain, are syntax errors. In a `.jsx` file and a `source`
|
||||
string, `?.` and `??` are syntax errors. Which files read these forms is VectorCraft's own rule. The script reaches the
|
||||
string, `?.` and `??` are syntax errors. Which files read these forms is VectorCraft's own rule. Every script, `.js`,
|
||||
`.jsx` or `source`, also reads ECMAScript for XML (E4X, ECMA-357, 2nd edition,
|
||||
https://ecma-international.org/publications-and-standards/standards/ecma-357/): XML and XMLList literals, the `..`,
|
||||
`.@`, `.*`, `.()` and `::` selectors, `for each`, `default xml namespace`, and the global `XML`, `XMLList`,
|
||||
`Namespace`, `QName`, `isXMLName` and `setDefaultXMLNamespace`, as the XML object pages describe them
|
||||
(https://extendscript.docsforadobe.dev/integrating-xml/the-xml-object/). The script reaches the
|
||||
app through the global object `vc`, and writes to the Script Console and runs other files through `$`:
|
||||
|
||||
- `vc.run(id, params)` runs a command and returns its result. A command that fails throws an error the script can
|
||||
@@ -3878,10 +3883,10 @@ false, a tutorial whose sample was not opened, and a finished tutorial are error
|
||||
`learn.resetProgress {}` runs Reset progress and answers what `learn.list` answers; open documents, opened samples and
|
||||
the Learn view stay as they are.
|
||||
|
||||
The Home screen has a Learn section between Recent Files and the new-file presets, as
|
||||
The Home screen has a Learn section after the new-file presets, as
|
||||
[the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/homescreen-overview.html)
|
||||
lists Learn, with in-app tutorials, among the Home screen's options. The section holds the Quick skill guide card,
|
||||
which runs `learn.skills`, and every tutorial of the Learn panel under its skill, each a button that runs
|
||||
lists Learn, with in-app tutorials, among the Home screen's options. Its heading row ends in the Quick skill guide
|
||||
link, which runs `learn.skills`, and a card per skill lists that skill's tutorials as links, each running
|
||||
`learn.show {tutorial}`. The panel shows beside the Home screen; no document is opened, closed or switched, and a
|
||||
second choice keeps the panel shown. The section's place, its layout and what a choice opens are VectorCraft's own
|
||||
rules.
|
||||
@@ -10484,7 +10489,10 @@ without `useArtboards` (no central file when no art shows). `level: 3` (default)
|
||||
shadings and masks transparent image pixels out; `level: 2` writes gradients as bands of colour (as does
|
||||
`compatibleGradients`) and transparent pixels white. Type is always glyph outlines, so no fonts are needed (`embedFonts`
|
||||
is accepted); spot colours are Separation colour spaces, and overprinting fills and strokes overprint unless
|
||||
`overprints: "discard"`. RGB documents are written in CMYK unless `cmykPostScript: false`. A freeform gradient is
|
||||
`overprints: "discard"`. With `discardWhiteOverprint` (`document.setup`, on by default) paper white ones knock out
|
||||
instead; a white linked to a spot swatch that has a color, at a tint above 0%, still overprints. RGB documents are
|
||||
written in CMYK unless
|
||||
`cmykPostScript: false`. A freeform gradient is
|
||||
written as an image, in CMYK when every point is CMYK or when every point is Gray in a file written in CMYK. When the file would hold an
|
||||
image that can't be decoded, the image is left out, and `warnings` carries "an image couldn't be decoded and is missing
|
||||
from the picture" once for all such images.
|
||||
|
||||
@@ -93,13 +93,18 @@ build root every helper stays inside). `packaging/nightly-tests.py` runs the syn
|
||||
runs them with the Windows PowerShell suites, and `.github/workflows/nightly-macos.yml` builds and
|
||||
verifies the unsigned bundle behind the `full-ci` label.
|
||||
|
||||
Every Linux Nightly format starts the app the same way, through one launcher
|
||||
(`packaging/linux/nightly-launch.sh`): the plain tar's `vectorcraft`, the deb/rpm's
|
||||
`/usr/bin/vectorcraft-nightly`, the AppImage's `AppRun`, the Arch handoff's `bin/vectorcraft` and
|
||||
the Flatpak's `/app/bin/vectorcraft`. It runs the GUI beside it (`<app>-bin`, the standard Nightly
|
||||
layout; `/usr/lib/vectorcraft-nightly/vectorcraft-bin` for deb/rpm, `/app/libexec/vectorcraft-bin`
|
||||
inside the Flatpak) with `--launch-profile nightly-v1 --profile-root <dir> -- "$@"`, and passes a
|
||||
version query, help or the Launcher's own `--launch-profile` invocation straight through. The
|
||||
Every packaged Linux Nightly format starts the app the same way, through one launcher
|
||||
(`packaging/linux/nightly-launch.sh`): the deb/rpm's `/usr/bin/vectorcraft-nightly`, the AppImage's
|
||||
`AppRun`, the Arch handoff's `bin/vectorcraft` and the Flatpak's `/app/bin/vectorcraft`. It runs the
|
||||
GUI beside it (`<app>-bin`, the standard Nightly layout;
|
||||
`/usr/lib/vectorcraft-nightly/vectorcraft-bin` for deb/rpm, `/app/libexec/vectorcraft-bin` inside the
|
||||
Flatpak) with `--launch-profile nightly-v1 --profile-root <dir> -- "$@"`, and passes a version query,
|
||||
help or the Launcher's own `--launch-profile` invocation straight through. The plain tar's
|
||||
`vectorcraft` is craft-common-actions' shared template instead
|
||||
(`packaging/linux/nightly-tar-launch.sh`, #363 rendered for this app): it adds its own tokens unless the first argument is already a `--launch-profile` pair,
|
||||
execs `vectorcraft-bin` beside it with
|
||||
`--profile-root <${XDG_DATA_HOME:-~/.local/share}/ai.storyteller.vectorcraft.nightly> --`, and asks a
|
||||
bare `--version`/`-V` in the Launcher's form. The
|
||||
Nightly tar therefore holds `vectorcraft` (launcher), `vectorcraft-bin` (GUI), `vectorcraft.png`
|
||||
(the Nightly art) and the notices.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Parity with Adobe Illustrator
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-20 · **Change:** minor (Pencil Edit Selected Paths follows lifted strokes, carves, loops, closes and redraws compound paths; 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: G12: Asset Export tile context menus; scores and estimates unchanged; previously: M14/G12: Appearance panel: right-click item context menus for rows (Duplicate, Delete, Hide/Show, Edit Effect, Clear Appearance, Reduce to Basic Appearance) with selection handling, #8809; previously: Text styles panel: right-click item context menus for Character Styles and Paragraph Styles with Options, Duplicate, Delete, Redefine, Clear Overrides; scores and estimates unchanged; previously: G12: Actions panel item context menus for action sets (New Action…, New Set…, Duplicate Set, Delete Set, Set Options…) and actions (Play, Record, Duplicate, Delete, Action Options…, Batch…) with selection handling; clicking Duplicate on an action duplicates that action; headless tests in `crates/ui-egui/src/panels/actions.rs`; scores and estimates unchanged; previously: 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 rootLine truncated
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-25 · **Change:** minor (Essentials readiness row: Shape Builder item names its remaining depth, #937's fix unconfirmed on the reporter's file, #8314; scores and estimates unchanged; previously: Pencil Edit Selected Paths follows lifted strokes, carves, loops, closes and redraws compound paths; 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: G12: Asset Export tile context menus; scores and estimates unchanged; previously: M14/G12: Appearance panel: right-click item context menus for rows (Duplicate, Delete, Hide/Show, Edit Effect, Clear Appearance, Reduce to Basic Appearance) with selection handling, #8809; previously: Text styles panel: right-click item context menus for Character Styles and Paragraph Styles with Options, Duplicate, Delete, Redefine, Clear Overrides; scores and estimates unchanged; previously: G12: Actions panel item context menus for action sets (New Action…, New Set…, Duplicate Set, Delete Set, Set Options…) and actions (Play, Record, Duplicate, Delete, Action Options…, Batch…) with selection handling; clicking Duplicate on an action duplicates that action; headless tests in `crates/ui-egui/src/panels/actions.rs`; scores and estimates unchanged; previously: 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 dragLine truncated
|
||||
>
|
||||
> Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5).
|
||||
>
|
||||
@@ -79,6 +79,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-22 | minor | Essentials readiness row: the Shape Builder item names what its 4–8 h still covers: checking #937's fix on the reporter's file, still unconfirmed (the reproduced case is fixed), #8314. Scores and estimates unchanged. |
|
||||
| 2026-11-20 | minor | G12: Asset Export tiles have item context menus for Export, Remove, Rename, Select Artwork on Canvas and collecting selected artwork; right-click selects an unselected tile and preserves an existing multi-selection. Headless regressions: panels::tests_asset_export. Scores and estimates unchanged. |
|
||||
| 2026-11-20 | minor | G12: Actions panel item context menus for action sets (New Action…, New Set…, Duplicate Set, Delete Set, Set Options…) and actions (Play, Record, Duplicate, Delete, Action Options…, Batch…) with selection handling; clicking Duplicate on an action duplicates that action; headless tests in `crates/ui-egui/src/panels/actions.rs`; scores and estimates unchanged. |
|
||||
| 2026-11-20 | minor | G12: Appearance panel row context menus (Duplicate Stroke/Fill, Delete Stroke/Fill, Hide/Show Stroke/Fill, Edit Effect…, Duplicate Effect, Delete Effect, Hide/Show Effect, Clear Appearance, Reduce to Basic Appearance); right-clicking an unselected row targets that row first. Headless regressions: `panels::tests_appearance`. Scores and estimates unchanged. |
|
||||
@@ -351,7 +352,7 @@ review parallelize less and need humans.
|
||||
|---|---:|---:|---:|---|
|
||||
| **Full Illustrator** (ready for real work; decides the stage) | **~62%** (57–67%) | **~340–560 h** | ~95–160 h | the mainstream work below, plus 3D (50–85 h), raster effects (24–40 h), advanced type (20–28 h), generative AI (30–60 h), localization (55–90 h) and ecosystem |
|
||||
| **Mainstream illustrator** | **~65%** (60–70%) | **~230–380 h** | ~65–110 h | the interaction-fidelity pass (60–90 h), hardening and QA (30–50 h), stability (20–35 h), performance budgets (15–25 h), `.ai` exchange (10–20 h), the remaining depth of the everyday areas |
|
||||
| **Essentials user** | **~75%** (70–80%) | **~60–105 h** | ~25–45 h | launch and stability on Windows (20–35 h), in-app help and onboarding (8–15 h), basic QA (10–15 h), Shape Builder regions (4–8 h), UI polish |
|
||||
| **Essentials user** | **~75%** (70–80%) | **~60–105 h** | ~25–45 h | launch and stability on Windows (20–35 h), in-app help and onboarding (8–15 h), basic QA (10–15 h), Shape Builder depth (4–8 h; #937's reproduced case is fixed, unconfirmed on the reporter's file), UI polish |
|
||||
|
||||
### Full Illustrator: additive weighted sum over the dimensions
|
||||
|
||||
@@ -809,6 +810,7 @@ since 2026-10-01.
|
||||
|
||||
- **EPS Save with Use Artboards:** Save As › EPS Options show Use Artboards with All or Range, for a separate file per artboard ([saving in EPS](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/save-artwork-in-eps-format.html)), unchecked by default (the scripting reference's EPS save options list `saveMultipleArtboards` with a default of false, [scripting reference](https://web.archive.org/web/20160803105056/https://wwwimages.adobe.com/content/dam/Adobe/en/devnet/illustrator/sdk/CC2015_3/Illustrator%20JavaScript%20Scripting%20Reference.pdf)). Unchecked, Save writes one file whose bounding box fits all the visible art, as Export does, without the artboards' background colors; when no art shows, the page is the first artboard in its color. An opened EPS saved back this way loses its page margins. Checked with two or more chosen artboards, the file at the path is the central file of the visible art and each artboard is also written to `<name>_<artboard>.eps` beside it. Checked with one chosen artboard, VectorCraft writes that artboard as the page of the file at the path alone (the behavior Save had since #4293). Evidence: `cmd::fileio::tests_artboard_fill::eps_save_draws_the_color_on_an_artboard_page`, `tests::save::eps_save_without_use_artboards_fits_the_box_to_art_past_the_artboard`, `tests::save::opened_eps_saves_to_its_own_file_around_its_art_or_on_its_page`, `tests::save::eps_save_with_use_artboards_writes_the_central_file_and_one_per_artboard`, `dialogs::save_options::tests::eps_save_as_shows_use_artboards_off_and_writes_the_art_or_the_artboard`.
|
||||
- **EPS Options custom flattener settings:** the help page describes flattening an EPS's transparency with a preset or with custom options, adjusted through Custom ([saving in EPS](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/save-artwork-in-eps-format.html)). EPS Options now has Custom… beside the flattener Preset. It opens Custom Transparency Flattener Options on the settings the export would use: the raster/vector balance, both resolutions, the text and stroke outline switches, Clip Complex Regions and Anti-alias Rasters. OK goes back to EPS Options with the preset shown as [Custom], the export flattens with those settings, and the next EPS Options start from them; choosing a preset drops them, and Cancel goes back to EPS Options unchanged. Preserve Alpha Transparency stays off, and overprints are kept only with Overprints set to Preserve. The [Custom] label, the remembering, the Cancel behavior, Anti-alias Rasters and the ranges (balance 0 to 100, resolutions 1 to 2400 ppi) are VectorCraft's own. Evidence: `dialogs::tests_eps::custom_flattener_options_start_from_the_preset_and_cancel_goes_back_unchanged`, `custom_flattener_options_are_exported_and_remembered_until_a_preset_is_chosen`, `bad_custom_flattener_options_keep_the_dialog_open`.
|
||||
- **EPS export and Discard White Overprint:** the help page describes Discard White Overprint as taking the overprint attribute off white objects in output, without changing the artwork ([white overprint](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/white-overprint.html)). EPS export and PostScript printing, composite and separated, now follow Discard White Overprint in Output (Document Setup), as PDF export does: a white fill or stroke marked to overprint knocks out while the setting is on and overprints while it is off. The same page says the setting covers process white and not spot white, so a white fill linked to a spot swatch that has a color keeps overprinting. The tiles of an overprinting pattern fill overprint with it. Evidence: `cmd::fileio::tests_eps::overprints_are_kept_or_discarded`, `tests::tiles_overprint_with_their_overprinting_pattern`, `tests::white_type_fills_knock_out_with_discard_white_overprint`, `tests::spot_white_fills_overprint_with_discard_white_overprint`, `print::tests::white_overprints_knock_out_on_postscript_plates_with_discard_white_overprint`.
|
||||
- **Save PDF custom flattener settings:** the help page describes the Advanced section's flattener preset for PDF 1.3 saves of transparent art, with a Custom button for adjusting the flattener settings, and says neither is available at PDF 1.4 and later ([PDF options](https://helpx.adobe.com/illustrator/using/pdf-options.html)). Save PDF › Advanced now has Custom… beside Flattener preset, enabled for PDF 1.3, PDF/X-1a and PDF/X-3. It opens Custom Transparency Flattener Options on the settings the save would use: the raster/vector balance, both resolutions, the text and stroke outline switches and Anti-alias Rasters; Clip Complex Regions shows on, as the PDF 1.3 writer always clips, overprints are kept only with Overprint set to Preserve, and Preserve Alpha Transparency shows off, as PDF 1.3 rasters keep no alpha. OK goes back to Save PDF with the preset shown as [Custom] and the save flattens with those settings; settings equal to the preset's leave its name, choosing a preset drops them, and Cancel goes back unchanged. PDF presets keep the flattener preset but not these settings, and Save Preset… says so while they are set. `ui.savePdfDialog` keeps a `flattener` it is given. The [Custom] label, the Cancel behavior, Anti-alias Rasters, the editor's absence from the PDF preset editor and the ranges (balance 0 to 100, resolutions 1 to 2400 ppi) are VectorCraft's own. Evidence: `dialogs::save_pdf::tests::custom_is_enabled_where_the_save_flattens`, `custom_starts_from_the_preset_and_cancel_goes_back_unchanged`, `custom_options_are_written_until_a_preset_is_chosen`, `custom_options_equal_to_the_preset_leave_its_name`, `custom_shows_alpha_as_the_pdf_1_3_writer_drops_it`, `save_preset_says_it_leaves_the_custom_flattener_options_out`, `save_pdf_opens_with_the_flattener_options_given_and_refuses_bad_ones`.
|
||||
|
||||
- **Raster export backgrounds (#6125):** a raster export draws its background under the finished art, and blend modes read only the art below them, as on the canvas. An Outer Glow in Screen mode on the bare page shows in a PNG on white and in a JPEG. Flatten Transparency puts its white under the finished art the same way. Evidence: `tests::file::a_screen_outer_glow_is_in_raster_exports`, `tests::objectfx::a_screen_outer_glow_on_the_bare_page_shows_on_a_background`, `tests::knockout::page_knockout_and_isolated_blending`, `tests::knockout::no_blend_mode_reads_the_background`, `tests::cmykflatten::every_blend_mode_flattens_to_the_canvas_pixels_in_cmyk`.
|
||||
@@ -849,7 +851,7 @@ since 2026-10-01.
|
||||
- **Justification… on type on a path:** each paragraph's Desired Word Spacing, Letter Spacing and Glyph Scaling set its glyphs on type on a path as on point and area type, so the text after a wider gap starts further along the path, alignment and overflow use the spaced length, and a list marker keeps its width. Minimum and Maximum are not used on a path, and vertical type is not glyph scaled. SVG export writes such type as outlines with a warning. Tests `tests::justify::type_on_a_path_takes_desired_spacing_and_scaling`, `type_on_a_path_is_aligned_and_fitted_at_desired_spacing`, `vertical_type_and_list_markers_on_a_path_are_not_glyph_scaled` and the SVG test `text_layout::justification_spacing_on_a_path_is_outlined`. Public reference: the help page (<https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/adjust-word-and-letterspacing-in-justified-text.html>).
|
||||
- **Letter spacing and Full Justify between shaped clusters:** Desired Letter Spacing on any line, the letter spacing range of a justified line, and Single Word Justification's Full Justify add space only between shaped clusters, in horizontal, right-to-left and vertical type, so a combining mark stays on its letter and a Devanagari syllable's glyphs stay together. They add no space next to a zero-width format control (a soft hyphen, a bidi mark, embedding, override or isolate, a zero-width space, a joiner or non-joiner, a word joiner, a variation selector, a tag, the byte order mark), so a word wrapped in an override still reaches both edges of a justified line, and a Kinsoku push-in counts no gap at one either. A zero-width space is a line break opportunity but not a word separator ([CSS Text Level 3](https://www.w3.org/TR/css-text-3/#word-separator) does not list it), so a justified line gives it no share of its room. Desired Letter Spacing between the letters on either side of a zero-width space goes after the zero-width space, so a line that breaks there ends at its last letter, and the line breaker does not measure a gap after it. A line that Full Justify spreads and that ends in a drawn hyphen puts the same gap between its last letter and the hyphen. The cluster boundary is VectorCraft's own rule, based on the typographic character unit of [CSS Text Level 3](https://www.w3.org/TR/css-text-3/#typographic-character-unit). Tests `tests::justify::single_word_full_justify_keeps_combining_mark_with_base`, `desired_and_fitted_letter_spacing_skip_shaped_cluster`, `rtl_single_word_cluster_gap_follows_drawn_order`, `vertical_single_word_cluster_gap_follows_drawn_order`, `single_word_full_justify_keeps_conjunct_cluster`, `desired_letter_spacing_skips_bidi_format_controls`, `letter_spacing_and_full_justify_skip_joiners_and_soft_hyphens`, `format_controls_are_the_zero_width_default_ignorables`, `zero_width_space_takes_no_word_space_room`, `desired_letter_spacing_ends_a_line_broken_at_a_zero_width_space_without_a_gap`, `single_word_full_justify_spreads_up_to_the_drawn_hyphen` and `layout::wrapping_tests::kinsoku_shori_type_counts_no_gap_at_a_format_control`. Public reference: the help page (<https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/adjust-word-and-letterspacing-in-justified-text.html>).
|
||||
- **Justified lines with tabs:** a tab is not a word space, so a justified area type line no longer gives it a share of its room that no glyph draws. On a justified line with a tab, the text up to the last tab keeps its spacing, each tab keeps its stop and its leader stays in its gap, and the text after the last tab takes the room (word spaces first, then letter spacing, glyph scaling and the gaps between its letters), so the line ends on the far edge. A tab separates two words, so Single Word Justification does not align a word-tab-word line. Right-to-left lines take the text drawn after the last tab drawn, and vertical lines work down the column. Spreading the room after the last tab is VectorCraft's own rule. Tests `tests::justify::a_justified_line_with_a_tab_spreads_the_text_after_it_to_the_edge`, `a_justified_tab_keeps_its_leader_inside_its_gap`, `a_justified_word_tab_word_line_reaches_the_edge`, `the_last_line_with_a_tab_fills_the_measure_only_with_justify_all`, `a_justified_line_takes_its_room_after_its_last_tab`, `a_justified_vertical_line_with_a_tab_reaches_the_end_of_its_column`, `a_justified_right_to_left_line_with_a_tab_spans_its_measure` and `justified_point_type_with_a_tab_keeps_its_width`. Public reference: the help pages (<https://helpx.adobe.com/illustrator/using/formatting-paragraphs.html>, <https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/adjust-word-and-letterspacing-in-justified-text.html>).
|
||||
- **Show Hidden Characters marks every character that prints no ink:** [the help page](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/insert-white-space-and-break-characters.html) lists the characters that Type › Show Hidden Characters makes visible: paragraph returns, forced line breaks, tabs, spaces, nonbreaking spaces, discretionary hyphens and the end of the text. Besides the dot over a space, ¶ at a paragraph's end and # at the story's end, the canvas draws an arrow across each tab's advance to its stop, a ring over a nonbreaking space (U+00A0) and a smaller one over a narrow nonbreaking space (U+202F), a short tick over the spaces of a set width (U+2000 to U+200A, U+205F, U+3000), ¬ at a discretionary hyphen (U+00AD) whether or not the line breaks there, and a bent arrow after a line that a forced line break (U+2028) ends, which gets no ¶. The marks follow the baseline of vertical type and of type on a path, ¶ goes at the left end of a right-to-left line, and type on a path gets # after its last character when the path shows all of its text. The shapes of the marks, and marking U+202F and the spaces of a set width, are VectorCraft's own rules. The marks are drawn only on the canvas and are not saved or exported. Tests: `canvas::tests::hidden_characters_mark_tabs_nonbreaking_spaces_and_discretionary_hyphens`, `hidden_characters_mark_forced_line_breaks`, `hidden_characters_mark_a_discretionary_hyphen_at_a_break_once`, `hidden_characters_follow_vertical_type`, `hidden_characters_end_a_right_to_left_line_at_its_left`, `hidden_characters_mark_type_on_a_path` and `show_hidden_characters_draws_every_kind_of_mark`.
|
||||
- **Show Hidden Characters marks every character that prints no ink:** [the help page](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/insert-white-space-and-break-characters.html) lists the characters that Type › Show Hidden Characters makes visible: paragraph returns, forced line breaks, tabs, spaces, nonbreaking spaces, discretionary hyphens and the end of the text. Besides the dot over a space, ¶ at a paragraph's end and # at the story's end, the canvas draws an arrow across each tab's advance to its stop, a ring over a nonbreaking space (U+00A0) and a smaller one over a narrow nonbreaking space (U+202F), a short tick over the spaces of a set width (U+2000 to U+200A, U+205F, U+3000), ¬ at a discretionary hyphen (U+00AD) whether or not the line breaks there, and a bent arrow after a line that a forced line break (U+2028) ends, which gets no ¶. The marks follow the baseline of vertical type and of type on a path, ¶ goes at the left end of a right-to-left line, and type on a path gets # after its last character when the path shows all of its text. The shapes of the marks, and marking U+202F and the spaces of a set width, are VectorCraft's own rules. The marks are drawn only on the canvas and are not saved or exported. Type that the canvas does not draw, because it or a group or layer holding it is hidden, gets no marks; this is VectorCraft's own rule. Tests: `canvas::tests::hidden_characters_mark_tabs_nonbreaking_spaces_and_discretionary_hyphens`, `hidden_characters_mark_forced_line_breaks`, `hidden_characters_mark_a_discretionary_hyphen_at_a_break_once`, `hidden_characters_follow_vertical_type`, `hidden_characters_end_a_right_to_left_line_at_its_left`, `hidden_characters_mark_type_on_a_path`, `canvas::marks::tests::hidden_characters_get_every_kind_of_mark` and `hidden_characters_and_auto_spell_check_leave_out_type_in_hidden_groups_and_layers`.
|
||||
- **The text style panel menus' Duplicate and Delete:** in the Character Styles and Paragraph Styles panel menus, Duplicate highlights the copy, as Create New Style highlights the new style, and Delete leaves no style highlighted, as the Delete button does, so Duplicate, Clear Overrides, Redefine and Style Options are disabled until another style is clicked. A highlighted style that is renamed in Style Options or deleted by a command is no longer highlighted either. The tests `panels::text_styles::tests::panel_menu_duplicate_and_delete_update_the_highlighted_style` and `a_highlighted_style_that_is_no_longer_listed_is_not_highlighted` cover this. Public reference: [Character and paragraph styles](https://web.archive.org/web/20261015081534/https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html).
|
||||
- **Item context menus in the Character Styles and Paragraph Styles panels:** right-clicking a style row displays a context menu ({Kind} Style Options…, Duplicate {Kind} Style, Delete {Kind} Style, Redefine {Kind} Style, Clear Overrides). Right-clicking an unselected row highlights it before displaying the menu; right-clicking an item in an existing multi-selection preserves the selection. Style Options and Delete are disabled for the built-in Normal style; Redefine is enabled when active text has styling; Clear Overrides is enabled when text is selected. Duplicate creates `<name> copy` and highlights it; Delete removes non-Normal styles in one undo step. Tests `panels::text_styles::tests::right_click_context_menu_in_character_styles_panel`, `right_click_context_menu_in_paragraph_styles_panel`, `right_click_context_menu_normal_style_disables_options_and_delete`, and `right_click_context_menu_preserves_multiselection`. Public reference: [Character and paragraph styles](https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html).
|
||||
- **Names of new styles and symbols:** `charStyle.new` and `paraStyle.new` trim the white space around the name they are given, as `charStyle.rename` and `paraStyle.rename` do, and refuse a name that is then empty; Duplicate names its copy from the trimmed name. `symbol.new` and `symbol.duplicate` trim the name as Symbol Options does, and `library.use` adds a library's text style under its trimmed name. Public reference: [Character and paragraph styles](https://web.archive.org/web/20260825113735/https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html).
|
||||
@@ -1088,7 +1090,6 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- `vectorcraft-js` parses JavaScript as ECMAScript 5.1 defines it, with the legacy octal forms, block functions and lenient regular expressions of Annex B, into a syntax tree with source spans. A comma may follow the last argument of a call or `new` expression and the last parameter of a function other than a setter, as ECMAScript 2017 allows (https://tc39.es/ecma262/2017/#sec-left-hand-side-expressions, https://tc39.es/ecma262/2017/#sec-function-definitions); `f(,)` and `f(1,,)` give a `SyntaxError`. It reads the `#target`, `#include` and other preprocessor lines as directives without running them, and a script that breaks the grammar or an early-error rule gives a `SyntaxError` with its line and column. Nesting past the parser's depth limit (`Options::max_depth`, 200 by default) gives a `SyntaxError` instead of exhausting the stack. `cargo xtask test262` fetches the conformance suite at a pinned commit and parses its ES5 tests: 5,411 of 5,418 runs pass (the 7 others use `let` and `const`). This entry covers parsing; the next entry covers running scripts. Tests: `crates/js/src/tests.rs`, `crates/engine/tests/it/js_lexer_vs_scriptcheck.rs`.
|
||||
- `vectorcraft-js` identifiers, written out or as `\uXXXX` and `\u{...}` escapes, take the characters Unicode's `ID_Start` and `ID_Continue` properties allow (https://www.unicode.org/reports/tr31/), plus `$` and, at the start, `_`, as later ECMAScript editions define them (https://tc39.es/ecma262/#sec-names-and-keywords). `Other_ID_Start` characters such as U+2118 and `Other_ID_Continue` characters such as U+00B7 and the zero width non-joiner and joiner are accepted, and no `Pattern_Syntax` or `Pattern_White_Space` character is. Letter categories come from Unicode 17.0, so U+088F starts an identifier and U+1ACF may follow its first character; characters assigned after Unicode 17.0 are not yet identifier characters. Tests: `crates/js/src/tests.rs` (`identifier_characters_are_unicode_17_id_start_and_id_continue`, which checks every code point, `identifiers_take_the_characters_unicode_17_assigned`, `identifiers_take_the_other_id_start_and_continue_characters`, `identifiers_refuse_pattern_syntax_surrogates_and_bad_escapes`, `no_pattern_syntax_or_white_space_character_is_an_identifier_character`).
|
||||
- `vectorcraft-js`'s `Realm` runs ECMAScript 5.1 scripts: the parsed script compiles to verified bytecode that a non-recursive interpreter runs, with closures, `this`, `arguments`, `with`, direct and indirect `eval`, `new Function`, `try`/`catch`/`finally`, labeled `break` and `continue`, and `for`-`in` in insertion order, over a mark-and-sweep heap, with the built-ins the next two entries list. Every run is bounded by fuel, heap bytes, frames, nested host calls and an interrupt flag (smaller defaults in the wasm build), and a run that reaches a limit stops with a limit error that `try` cannot catch. `cargo xtask test262` also runs the suite's ES5 language tests that need only the built-ins present: 4,280 of 4,286 runs pass (4 of the others expect the completion values of later editions, and 2 expect a configurable function `length`). The app does not call it yet. Tests: `crates/js/src/interp_tests.rs`, `crates/js/tests/test262.rs`.
|
||||
- With `Options::es2015`, `vectorcraft-js` also reads and runs these ECMAScript 2015 forms (https://262.ecma-international.org/6.0/): `let` and `const` with block scope and their temporal dead zone (a read or write before the declaration runs throws a `ReferenceError`, and a write to a `const` throws a `TypeError` in any code), a new `let` binding for each iteration of a `for` or `for`-`in` loop, function declarations scoped to their block, arrow functions with the `this` and `arguments` of the code around them and no `prototype`, template literals and tagged templates with one frozen strings object for each site, default and rest parameters with an `arguments` object that does not follow the parameters, and spread in array literals, calls and `new`. Spread reads arrays by index, reading the length again before each element, strings and `String` objects by code point, and objects with a `length` property by index, and throws a `TypeError` for any other value; that rule is VectorCraft's own until iterators are added. Spread and template objects take fuel for each element and count against the heap limit, and nested arrows and templates count against `Options::max_depth`. `script.run` sets the option for a `.js` file, and `eval`, `Function`, `#include` files and `$.evalFile` read code the way the script does; a `.jsx` file and a `source` string stay ES5.1. Destructuring, `for`-`of`, classes, generators and modules are still syntax errors. `cargo xtask test262` reads the suite's tests of these forms without and with the option: 390 of 390 negative parse runs and 533 of 708 other runs pass with it (373 and 27 without it). Of the 175 failing runs, 151 do not parse because the tests also use forms this list leaves out (classes, method definitions, destructuring, `for`-`of`, trailing commas in parameter lists, and a later edition's rule for escapes in tagged templates), and 24 expect function `name` properties, a configurable function `length` and the `caller` and `arguments` restrictions, ECMAScript 2015 rules that `vectorcraft-js` does not implement. Tests: `crates/js/src/es2015_tests.rs`, `crates/js/tests/test262.rs`, `crates/engine/src/tests/script_run.rs`.
|
||||
- With `Options::es2015`, `vectorcraft-js` also reads and runs these ECMAScript 2015 forms (https://262.ecma-international.org/6.0/): `let` and `const` with block scope and their temporal dead zone (a read or write before the declaration runs throws a `ReferenceError`, and a write to a `const` throws a `TypeError` in any code), a new `let` binding for each iteration of a `for` or `for`-`in` loop, function declarations scoped to their block, arrow functions with the `this` and `arguments` of the code around them and no `prototype`, template literals and tagged templates with one frozen strings object for each site, default and rest parameters with an `arguments` object that does not follow the parameters, and spread in array literals, calls and `new`. Spread uses the iterator protocol (see the `for`-`of` line below). Spread and template objects take fuel for each element and count against the heap limit, and nested arrows and templates count against `Options::max_depth`. `script.run` sets the option for a `.js` file, and `eval`, `Function`, `#include` files and `$.evalFile` read code the way the script does; a `.jsx` file and a `source` string stay ES5.1. Classes, generators and modules are still syntax errors. `cargo xtask test262` reads the suite's tests of these forms without and with the option: when these forms were added, 390 of 390 negative parse runs and 565 of 589 other runs passed with it (373 and 27 without it), and the 24 failing runs expected function `name` properties, a configurable function `length` and the `caller` and `arguments` restrictions. The object-literal line below adds function names and configurable lengths; the `caller` and `arguments` restrictions are still not implemented. Tests: `crates/js/src/es2015_tests.rs`, `crates/js/tests/test262.rs`, `crates/engine/src/tests/script_run.rs`.
|
||||
- `Options::es2015` also reads and runs two ECMAScript 2020 forms (https://262.ecma-international.org/11.0/): optional chains (`a?.b`, `a?.[key]`, `f?.(args)` and the accesses and calls after them), which evaluate their base once and give `undefined` without evaluating the rest of the chain when a value before `?.` is `undefined` or `null`, keep the object as `this` for `a?.b()` and `a.b?.()`, make `eval?.(code)` an indirect eval and make `delete a?.b` true when `a` is `undefined` or `null`; and `??`, which keeps any left side other than `undefined` and `null`. `?.` before a digit reads as `?` and a number (`a?.5:1`). Mixing `??` with `&&` or `||` without parentheses, assigning to or updating an optional chain, a tagged template after one and `new a?.b()` are syntax errors. A skipped part of a chain takes no fuel, and a chain of any length compiles without recursion. Using the ECMAScript 2015 option for them, so `.js` files read them and `.jsx` files and `source` strings do not, is VectorCraft's own rule. With the suite's `expressions/optional-chaining` and `expressions/coalesce` tests that need only the forms above, `cargo xtask test262` reads 426 of 426 negative parse runs and 591 of 782 other runs as passing with the option (409 and 27 without it). Of the 191 failing runs, 175 are those the entry above names, and 16 do not parse because the tests also use method definitions, classes, `for`-`of` or `new.target`. Tests: `crates/js/src/es2020_tests.rs`, `crates/js/tests/test262.rs`.
|
||||
- `vectorcraft-js` provides the ECMAScript 5.1 built-ins `Object` with its property-descriptor functions, `create`, `keys`, `seal` and `freeze` (section 15.2), `Function.prototype.bind` (15.3.4.5), `Array` with every ES5 method (15.4), the error types (15.11), `Math` (15.8), `JSON` with revivers, replacers and indentation (15.12), and the global functions with Annex B's `escape` and `unescape` (15.1, B.2). The array methods work on array-like objects. A method visits only the indices that exist when its range is longer than 4,096 indices and more than 8 times the properties on the object and its prototypes, so `new Array(4294967295).join("")` ends at once; a shorter range is visited index by index, holes included, and each index takes fuel. `join` writes a cycle back to an array as an empty string, `JSON.stringify` throws a `TypeError` on a cycle, and deep `JSON` nesting uses no native stack. Every loop takes fuel and every result is checked against the heap limit. `cargo xtask test262` runs the suite's ES5 built-in tests that need only these built-ins: 6,798 of 6,866 runs pass (the 34 failing tests expect rules of later editions). It also fetches the `json2.js` polyfill at a pinned commit and checks that its `stringify` and `parse` agree with the built-in `JSON`. Tests: `crates/js/src/builtins_tests.rs`, `crates/js/tests/test262.rs`, `crates/js/tests/json2.rs`.
|
||||
@@ -1102,6 +1103,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- `vectorcraft-js` runs ECMAScript for XML (ECMA-357, 2nd edition, https://ecma-international.org/publications-and-standards/standards/ecma-357/) when `Options::e4x` is set, which it is not by default: XML and XMLList literals with embedded `{}` expressions, the `..`, `.@`, `.*`, `.()` and `::` selectors, assignment and `delete` on selected nodes, `for each`, `default xml namespace`, and the `XML`, `XMLList`, `Namespace` and `QName` objects with their methods and settings. `xml.xpath(expression[, variables])` evaluates an XPath 1.0 expression (https://www.w3.org/TR/1999/REC-xpath-19991116/) with all 13 axes and the 27 core functions, and returns the selected nodes as an XMLList in document order without repeats. Each property of `variables` binds the variable of its name, an XMLList runs the expression on each of its elements in turn, and a prefix in a name test resolves through the context element's in-scope namespaces. An expression that breaks the grammar gives a `SyntaxError`; an unknown function, a wrong argument count, an unbound prefix or variable, and a result that is not a node-set or that holds the root or a namespace node give a `TypeError`. `id()` selects nothing, and evaluation uses no native stack, takes fuel and counts against the heap limit. `<!DOCTYPE>` in an XML string gives a `SyntaxError`. An XML declaration at the start of an XML string, after optional white space, is checked against XML 1.0's grammar (https://www.w3.org/TR/xml/#NT-XMLDecl): a version of `1.` and digits, then an optional encoding name and an optional standalone `yes` or `no`, in that order; any other declaration, or one with a character XML does not allow, gives a `SyntaxError`. The parser takes fuel for the length of every name, white space run and declaration it scans, and for the text it searched when a quote, CDATA section, comment or processing instruction is not closed. Parsing, serializing, comparing and copying trees use no native stack, and each takes fuel and counts against the heap limit. Inserting a node into itself or its descendants throws a `TypeError` before the tree changes, a literal or XML string nested past `Options::max_depth` gives a `SyntaxError`, and a tree built past that depth stops at the heap limit. Tests: `crates/js/src/xml_tests.rs`.
|
||||
- Scripts: `inScopeNamespaces()`, `namespace()`, `namespaceDeclarations()`, the XPath `namespace` axis, prefixes in an XPath expression and the qualified names `name()` gives count the namespaces they collect from a node and its ancestors against the heap limit, so a node with many namespaces in scope stops the script at the heap limit instead of growing past it. `addNamespace()`, `setNamespace()`, `setName()` and `removeNamespace()` read an element's attributes in place instead of copying them, and `removeNamespace()` counts its walk of the tree; `child()` by index, `comments()`, `text()`, `elements()`, `processingInstructions()` and `normalize()` on an XMLList count their copy of its items; `replace()` counts its copy of the children it matched; and `name()` counts the prefixed name it builds. The `XML`, `XMLList`, `Namespace` and `QName` constructors, `isXMLName()`, `attribute()`, `namespace()`, `propertyIsEnumerable()`, `setName()`, `setLocalName()`, `addNamespace()`, `removeNamespace()` and `setNamespace()` count the copy they make when they flatten a long string argument, and `QName.prototype.toString()` counts its result before it builds it. Tests: `crates/js/src/xml_tests.rs`.
|
||||
- Scripts: assigning to a named child of an XML element (`x.b = v`) counts its list of the matching children against the heap limit, and assigning through an empty XMLList counts the chain of targets it climbs, so an assignment that would not fit stops before the tree changes. `copy()`, `toXMLString()`, `normalize()`, the `..` selector and inserting a node count the stack they keep for each open level of the tree, `copy()` and `toXMLString()` read an element's attributes in place instead of copying the list, `toXMLString()` also reads its namespace declarations in place, and `copy()` counts the declarations it copies before it copies them. `toXMLString()` counts the flat copy it makes of text or an attribute value built by joining strings. Deleting children or attributes by name, and assigning an attribute, remove the nodes in place instead of building a second list. `toXMLString()` counts the set of prefixes it passes looking up a namespace, and picks a new `ns` prefix in one pass over the declarations in scope. Inserting an XMLList, and assigning one to an item of an XMLList, count their copy of the list's items. Parsing counts the open elements, the text it gathers, each tag's attributes and the sets that check them, and the namespace declarations it makes. Comparing XML values, converting them to strings, and reading a name, a namespace or embedded text from a string built by joining strings count the flat copy they make; an attribute name read from a string counts its copy. Tests: `crates/js/src/xml_tests.rs`.
|
||||
- Scripts: `script.run` and File › Scripts run every script with E4X on, `.js` and `.jsx` files, `#include` files, `$.evalFile`, `eval` and `Function` alike, so XML literals and the global `XML`, `XMLList`, `Namespace`, `QName`, `isXMLName` and `setDefaultXMLNamespace` work as the XML object pages describe them (https://extendscript.docsforadobe.dev/integrating-xml/the-xml-object/). `script.check` lists the `e4x` and `xml` features under the `language` need instead of `hostOnly`. Tests: `crates/engine/src/tests/script_run.rs`, `crates/scriptcheck/src/tests.rs`.
|
||||
- **UI:** Illustrator 2026 layout restyled to measured values:
|
||||
- Medium Dark theme, categorized and Advanced toolbars (a tool group's flyout opens on a right press, a long press or a press on its corner triangle), 35 pt document tabs, 33 pt panel tabs.
|
||||
- Hint bar, contextual task bar, 19 dock panels with ≡ menus.
|
||||
@@ -1232,7 +1234,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- A tool's name in a Learn tutorial step is a blue link that shows where the tool is without choosing it (`learn.locateTool {tool}`): its toolbar button is marked, a collapsed group's flyout opens with the tool's row marked, a torn-off strip comes to the front, and a tool no shown toolbar holds is marked in the All Tools drawer. The mark, its 3 seconds and the hidden-toolbar cases are VectorCraft's own rules ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html); `panels::learn::tests`, the `a_learn_link_*` tests in `toolbar::tests`).
|
||||
- Under a tutorial's steps, View more opens the tutorial's own practice sample as a new untitled document, and once the tutorial is finished, Next Up moves to the next tutorial in the same skill, as the help page describes ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html)). The samples are VectorCraft's own drawings. A Finish tutorial button that shows once the sample is open, the untitled copy, Back to skills in place of Next Up after a skill's last tutorial, and Next Up showing the next tutorial without opening its sample are VectorCraft's own rules. `learn.openSample`, `learn.finish`, `learn.next` and `learn.skills` (Back to skills) script them. Not done: the help page's short video. Regression tests: `view_more_opens_the_tutorial_s_sample_as_a_new_untitled_document`, `finishing_a_tutorial_offers_next_up_in_its_skill`, `the_practice_controls_work_from_the_keyboard`, `the_last_tutorial_of_a_skill_offers_back_to_skills`, `learn_finish_and_learn_next_follow_the_practice`, `learn_skills_shows_the_list_of_skills`, `the_practice_commands_reject_a_missing_or_unknown_tutorial`, `every_tutorial_has_its_own_readable_sample` and `the_next_tutorial_is_the_next_one_in_the_same_skill` in `crates/ui-egui/src/panels/learn/tests.rs`.
|
||||
- A Learn tutorial's steps are marked complete as the learner works, and a skill's progress ring fills as its tutorials are finished, as the help page describes ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html)). Each step has a check box that marks it done once the tutorial's sample is open (`learn.markStep`); Finish tutorial marks every step done; a skill's count shows its tutorials finished of all, and a finished tutorial has a check mark in its skill's list. Marking steps by hand, the count, keeping the progress in the preferences (the web build keeps it while the page is open) and Reset progress (`learn.resetProgress`) are VectorCraft's own rules; `learn.list` reports the progress. Regression tests: `a_step_s_check_box_marks_only_that_step`, `a_step_s_check_box_works_from_the_keyboard`, `finishing_tutorials_fills_their_skill_s_ring_and_count`, `a_skill_with_no_tutorials_shows_0_of_0`, `learn_mark_step_checks_its_params`, `reset_progress_clears_only_the_progress`, `the_preferences_keep_the_progress` and `saved_progress_is_read_leniently` in `crates/ui-egui/src/panels/learn/tests.rs`.
|
||||
- The Home screen has a Learn section with the in-app tutorials, as the help page lists among the Home screen's options ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/homescreen-overview.html)): the Quick skill guide card shows the Learn panel's list of skills (`learn.skills`), and each tutorial, listed under its skill, shows the panel at its steps (`learn.show`). It shows with no document open and over open documents, and a choice leaves the documents as they are. Its place between Recent Files and the new-file presets, its layout and what a choice opens are VectorCraft's own rules (`tests::home::home_has_a_learn_section_that_opens_the_learn_panel`, `home_learn_section_over_open_documents_leaves_them_as_they_are`, `home_quick_skill_guide_card_works_from_the_keyboard`).
|
||||
- The Home screen has a Learn section with the in-app tutorials, as the help page lists among the Home screen's options ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/homescreen-overview.html)): the Quick skill guide link in its heading row shows the Learn panel's list of skills (`learn.skills`), and each tutorial, listed in its skill's card, shows the panel at its steps (`learn.show`). It shows with no document open and over open documents, and a choice leaves the documents as they are. Its place after the new-file presets, its layout and what a choice opens are VectorCraft's own rules (`tests::home::home_has_a_learn_section_that_opens_the_learn_panel`, `home_learn_section_over_open_documents_leaves_them_as_they_are`, `home_quick_skill_guide_card_works_from_the_keyboard`).
|
||||
- The errors of the blend spine commands (Move Spine Point, Reshape Spine Segment, Add Spine Point and Delete Spine Point) show in the status bar in the interface language: each has a row in every catalog that translates all status and error messages and in Bulgarian (`blend_spine_param_errors_are_translated`).
|
||||
- The errors of Automatic Plane Positioning (`perspective.plane.infer`) and of its two Perspective Grid Options (`perspective.widget.options`) show in the status bar in the interface language: a hidden grid, both options off, a negative `tolerance`, `at` given with `clear`, and an `anchorPoint` or `gridlineIntersection` that is not true or false. Each has a row in every catalog that translates all status and error messages, with the parameter names kept (`automatic_plane_positioning_errors_are_translated`).
|
||||
- The errors of the 3D effects (Extrude & Bevel, Revolve, Inflate, Rotate and their Classic forms) show in the status bar in the interface language: the art a 3D effect cannot build a solid from, invalid light, graphics and surface settings, and the notes for an object that draws no 3D faces or more wireframe edges than the limit. Each has a row in every catalog that translates all status and error messages, and the effect's name and the values in the message are translated or kept as written (`three_d_refusals_are_translated_in_every_complete_catalog`, `three_d_refusals_translate_with_their_values`).
|
||||
@@ -2072,6 +2074,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- **Pasting into hex color fields:** in the hex fields of the Color Picker, Swatch Options, Recolor Artwork, the Color panel, Document Setup, Duotone, Color Themes and Perspective Grid, a click or keyboard focus selects the digits. A pasted code of six digits, with or without `#`, replaces them wherever the caret is. A pasted code of three digits also replaces them, unless the paste holds only those digits and exactly three digits stay; those digits then edit the text in place. A press on another field commits the text as Tab and Enter do. As VectorCraft's own rule, a paste that is not a color leaves the field as it was. Tests: `a_hex_code_pasted_into_the_hex_field_replaces_its_digits` in `crates/ui-egui/src/dialogs/tests.rs`, `define_grid_takes_a_three_digit_color` in `crates/ui-egui/src/dialogs/tests_perspective.rs` and `a_paste_into_a_hex_field_replaces_or_edits_its_digits` in `crates/ui-egui/src/tests/numfields.rs`.
|
||||
- **Color Picker layout (#2008):** a centered draggable header, equal-width actions above aligned HSB/RGB/Hex and Lab/CMYK fields, compact field and slider, and warnings below the preview. No horizontal scrolling; narrow windows stack the sections with vertical scrolling. Tests in `dialogs/color_picker.rs` cover actual pointer/key input, typed values before OK/Enter, Cancel/Escape rollback, one Undo step, mode-size stability, warnings and layout at two UI scales. The screen sampler sits above the field and the upstream two-grid Tab order is retained. AccessKit regressions check the action names and each channel slider's displayed value, units and range. German and enlarged English UI renders were reviewed locally; no reference images are shipped. This is a layout improvement, with no change to scores or remaining-hour estimates.
|
||||
- **Eyedropper sources (#1251):** ordinary and Shift clicks, Shift+Alt appearance append, raster pixels and gradient-stop sampling can read visible locked/template art and sources outside isolation. Sampling leaves the source and selection intact; Alt reverse still uses editable hits, and hidden art stays excluded. Engine/tool/hit regressions cover the editing boundary, color models and one-step Undo/Redo. The general object/image workflow is described in [public HelpX](https://helpx.adobe.com/illustrator/using/tool-techniques/eyedropper-tool.html); the lock/isolation expectations come from the user report and these regressions, without a new full-parity measurement.
|
||||
- **Eyedropper hover outline:** as VectorCraft's own behavior, with Smart Guides › Object Highlighting on, the Eyedropper outlines the object a click at the pointer would act on, in the selection tools' 1.5 px layer-color outline: the source a click copies from (locked and template art included), the selected gradient mesh a click recolors, the front editable object an Alt-click gives the selection's attributes to (the one below when locked art covers it), and for a Shift-click the object whose color is sampled (a blend or envelope where its art is drawn, the art below where it leaves a gap). A selected object is outlined too. With Cmd held, a click selects with the selection tool lent to the Eyedropper, and the outline is that tool's. The Selection tool's outline, lent or not, leaves out a group whose selected member is under the pointer, where a press keeps the selection. Finding a Shift-click's sample counts a blend's steps before the blend is evaluated. Empty canvas and hidden art show no outline, and with the Eyedropper or a selection tool, Space held for the view tools hides the outline. Tests: `eyedropper_hover_outlines_the_object_under_the_pointer`, `eyedropper_hover_outline_follows_object_highlighting`, `eyedropper_hover_outline_is_the_object_the_click_acts_on`, `eyedropper_hover_outline_follows_the_selection_cmd_and_the_document`, `selection_hover_outline_skips_a_selected_group_member` and `eyedropper_shift_hover_outlines_the_object_sampled` in `crates/ui-egui/src/canvas/tests.rs`, and `shift_hover_names_the_object_the_sample_comes_from`, `shift_hover_names_the_envelope_where_its_art_is_drawn`, `hover_names_the_selected_mesh_a_click_recolors` and `blend_steps_count_before_the_blend_is_evaluated` in `crates/tools/src/xform/eyedropper.rs`.
|
||||
- **Eyedropper colors in a CMYK document (#2276):** a CMYK image (a four-component JPEG, or an 8- or 16-bit chunky CMYK TIFF) gives its ink amounts as they are, and an RGB image's pixel or an RGB color given to `paint.setFill`, `paint.setStroke`, `paint.sampleColor` or `swatch.new {color}` (hex input and gradient stops included) is separated through the color settings' CMYK working space and intent, as Document Color Mode converts it. With the default Generic CMYK, RGB 83/170/223 separates to C62 M19 Y0 K0, where the profile-free formula gave C63 M24 Y0 K13.
|
||||
- **RGB input to other commands in a CMYK document:** type colors (`text.create`, `text.setStyle`, `text.setRangeStyle`), a Shape Builder hex fill, `paint.editGradient` stops, freeform gradient points, gradient mesh points (the Mesh tool gives a new point the fill's color in its own model), the Symbol Stainer's color and the swatch commands (`swatch.new {colors}`, `swatch.newGroup`, `swatch.editGroup`, `swatch.edit`) separate RGB through the color settings as `paint.setFill` does: with Generic CMYK, `text.setStyle {fill: "#53aadf"}` gives C62 M19 Y0 K0. A color a swatch already has keeps its model, and a swatch color given with `mode` is converted into that mode only.
|
||||
- **Generic CMYK (SWOP-like):** each ink's 40% and 50% tints gain as [CGATS TR 001](https://registry.color.org/cmyk-registry/cgats_tr_001) gives for SWOP printing, and separations stay within SWOP's [300% total ink limit](https://en.wikipedia.org/wiki/Specifications_for_Web_Offset_Publications). The paper, solid and overprint colors, the black-generation curve and the black point are VectorCraft's own values: RGB black separates to 90% black under neutral cyan, magenta and yellow that fill the ink limit (C75 M68 Y67 K90). The ICC profile written for it (embedded in exports) gives the paper as its media white point, and its colorimetric Lab → CMYK table is the inverse of its CMYK → Lab table, without black-point compensation; the perceptual and saturation tables keep compensation.
|
||||
@@ -2560,6 +2563,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
A subpath keeps its anchors in chunks of up to 256 anchors, and the versions of a path share the chunks they have not changed. Editing one anchor copies only the chunk that holds it, so its undo step keeps that chunk instead of a copy of every anchor; adding or deleting an anchor copies the chunk it is in and rebuilds the subpath's table of chunks. When the renderer looks for the anchors that moved, it compares only the chunks the edit copied. Moving one anchor of a selected open path of 10,000 or 200,000 anchors (`path.moveAnchor`, `path.setHandle`, `path.moveAnchors` or a nudge) keeps at most 48 KiB in the undo step and in the redo step, where it kept a copy of every anchor at 56 bytes each (counted in the engine's tests). Files are written and read as before, each subpath's anchors as one list.
|
||||
Opening a document keeps the layouts it makes for its type objects, up to 128 MiB, and the first frame uses them instead of laying those objects out again. It does not keep a layout with bitmap or color glyphs or a text object with a gradient. The frame uses a layout only for a text object equal to the one laid out, and only while the fonts and the hyphenation exceptions have not changed. It uses each layout once. The renderer drops the rest when a frame that used one ends, and all of them after eight frames that use none. The frames of a threaded story are laid out while the file is read, and the first frame lays them out again. The pixels are the same. On Windows at 1600 × 1200, in medians of seven interleaved rounds of a local example, counted in the main thread's CPU cycles because other builds were running: with 5,000 point type objects in view the first frame takes 409 million cycles instead of 894 million and the open 816 million instead of 665 million, so the two together take 1,225 million instead of 1,559 million; with one area type object of 500 paragraphs the first frame takes 697 million instead of 1,193 million and the open 535 million instead of 568 million.
|
||||
Type › Show Hidden Characters keeps the marks it places on each text object from one frame to the next. The canvas lays a text object out again when an edit changes it or its threaded story, or when the last frame that showed the marks did not draw it, and it lays out all type in view again when the fonts or the hyphenation exceptions change. With 1,000 two-line labels in view, drawing the marks takes 0.8 ms per frame in a release build instead of 19.7 ms.
|
||||
Show Hidden Characters and Auto Spell Check find the document's text objects among its other objects once for each change to the document, in one list that both draw from, instead of visiting every object in every frame. An edit, Undo, Redo or a switch to another document makes a new list, and the canvas drops the list while it draws neither overlay.
|
||||
With a Type tool active, the in and out ports of the selected area type and type on a path, and the highlight of a selected story's other frames after Select All, use each frame's layout from the last frame instead of laying the frame out again. A frame is laid out again when its text object changes, or when the fonts or the hyphenation exceptions change. With 200 selected area type frames of about 400 characters, one of them being edited, the Type tool's overlays take 0.27 ms per frame instead of 121 ms; with a 5-frame story selected they take 0.016 ms instead of 2.0 ms (release build on Linux, medians of seven runs, measured while other builds were running).
|
||||
A selection with more than 100,000 points to outline shows its bounds instead of each object's outline and anchors. Paths count their anchors. Area type and type on a path count the anchors of their frame or path, and point type counts six: its box's corners and the ends of its baseline marker. Images, symbol instances, placed documents, and area type or type on a path in perspective count the four corners of their box, and gradient meshes and envelopes count their points and the ends of their mesh lines. The hover highlight leaves out an object past that count, and such an object shows its bounds as the key object. With 32,768 type objects, images, symbol instances, gradient meshes or envelopes selected, the selection's outlines and anchors add fewer than 100 vertices to the canvas's mesh (#2460).
|
||||
The canvas keeps the selected objects' outlines, anchors and handles from one frame to the next as one mesh. It builds an object's marks again when the object, its layer color or its selected anchors change. A pan moves the kept outlines and handles and places the anchor squares again. Each subpath and handle gets its triangles the first time it is in view. A frame with a new zoom or rotation draws the marks one shape at a time and keeps nothing, and the next frame at that view builds them. The pixels are the same, apart from two small differences: a kept outline's corner of exactly 90 degrees in a rotated view can keep its miter or cut corner after a pan, and kept vertices can move by rounding errors. On Windows at 1440 × 900, in a release build, with 2,000 selected circles of 50 anchors each in 10 fill colors, an idle frame takes 12.8 ms instead of 59.9 ms with the Selection tool and 29.8 ms instead of 192.1 ms with Direct Selection (medians of five runs). A frame during a zoom takes about what it did: 86.7 ms instead of 80.0 ms with the Selection tool.
|
||||
@@ -3220,6 +3224,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-22 | minor | Essentials readiness row: the Shape Builder item names what its 4–8 h still covers: checking #937's fix on the reporter's file, still unconfirmed (the reproduced case is fixed), #8314. Scores and estimates unchanged. |
|
||||
| 2026-11-20 | minor | G12: Asset Export tiles have item context menus for Export, Remove, Rename, Select Artwork on Canvas and collecting selected artwork; right-click selects an unselected tile and preserves an existing multi-selection. Headless regressions: panels::tests_asset_export. Scores and estimates unchanged. |
|
||||
| 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. |
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ against Illustrator's public documentation; **estimated** unless noted.
|
||||
| Roman Hanging Punctuation | done | Paragraph panel menu › Roman Hanging Punctuation, `text.setFormat {romanHangingPunctuation}` (#2756): per paragraph, Optical Margin Alignment's punctuation and amounts without the letters; paragraph styles carry it. Evidence: `tests::roman_hanging_punctuation_hangs_punctuation_but_not_letters`, `typecmd::area_tests::roman_hanging_punctuation_is_set_per_paragraph_and_saved_only_when_on` |
|
||||
| Hyphenation… and Justification… options | done | Eleven Indian languages use attributed patterns and preserve syllables in both composers (#4947). Hyphenation… (`ui.hyphenation`, `text.setFormat`) sets each paragraph's Words Longer Than, After First, Before Last, Hyphen Limit, Hyphenation Zone (Single-line Composer only) and Hyphenate Capitalized Words, and paragraph styles carry them (#2310). Justification… (`ui.justification`, `text.setFormat`, #2755) sets Word Spacing, Letter Spacing and Glyph Scaling (Minimum, Desired, Maximum), Auto Leading and Single Word Justification; Desired applies to every line, justified lines and the Every-line Composer use the ranges. Vertical type isn't glyph scaled. Auto Leading also sets the Leading the Character panel shows for Auto type, the leading Alt+↑/↓ (`type.step`) steps from, per paragraph, and the lines Fill with Placeholder Text counts. Evidence: `crates/text/src/tests/justify.rs`, `dialogs::justification::tests`, `tests_prefs::auto_leading_steps_and_fills_from_the_paragraph_auto_leading`, `panels::character` test `leading_field_shows_the_paragraph_auto_leading` |
|
||||
| Tab stops and leaders; Tabs panel | partial | Tabs panel and stops with leaders in the model (`text.tabs.set`); a stop drags from where the press landed (#1458); leaders fill the tab's gap, repeated on a grid so they line up from line to line (#1877); Ctrl-dragging a stop (Command on macOS) moves all the stops together; in right-aligned area type the text before a line's last tab sits at its stops, from the left edge, and the text after it against the right edge, as Illustrator's own layout in a user's `.ai` sets a price list (evidence: `tests::right_aligned_area_type_sets_the_text_after_its_last_tab_against_the_edge`; centred lines are still aligned as a whole); in justified area type the text up to a line's last tab keeps its spacing and its tabs their stops, and the text after the last tab takes the line's room to the far edge, VectorCraft's own rule (evidence: `tests::justify::a_justified_line_with_a_tab_spreads_the_text_after_it_to_the_edge` and the other tab tests in `crates/text/src/tests/justify.rs`) |
|
||||
| Hidden characters (Show Hidden Characters) | done | `type.hiddenCharacters`: marks spaces, tabs, nonbreaking and narrow nonbreaking spaces, the spaces of a set width, discretionary hyphens, forced line breaks, paragraph ends and the story's end, in horizontal, vertical and right-to-left type and on a path; the mark shapes are VectorCraft's own. Evidence: `canvas::tests::hidden_characters_*` |
|
||||
| Hidden characters (Show Hidden Characters) | done | `type.hiddenCharacters`: marks spaces, tabs, nonbreaking and narrow nonbreaking spaces, the spaces of a set width, discretionary hyphens, forced line breaks, paragraph ends and the story's end, in horizontal, vertical and right-to-left type and on a path, and none on type in a hidden group or layer; the mark shapes are VectorCraft's own. Evidence: `canvas::tests::hidden_characters_*` |
|
||||
| Spell check (Check Spelling, Auto Spell Check, custom dictionary) | done | the engine (#4936): `text.spelling.check` lists the unknown words of the document's type, each run in its Language, at the bytes `text.editRange` changes, and `text.spelling.suggest` gives suggestions, both from craft-proof, each paragraph on its own (English from the first dictionary it finds: a Hunspell dictionary in the user's dictionaries folder, the SCOWL dictionary built in from craft-i18n, a system Hunspell dictionary, and last the public-domain Moby word list built into it; other languages from the dictionaries craft-proof finds for them). The custom dictionary commands are done: `text.spelling.addWord`, `removeWord` and `changeWord` (Add, and Edit Custom Dictionary's Add, Delete and Change), and `text.spelling.dictionary` lists the words, saved to `Custom Dictionary.txt` beside the preferences; Ignore All: `text.spelling.ignoreAll` skips a word in the active document while it is open. Auto Spell Check is done: Edit › Spelling › Auto Spell Check (`edit.autoSpellCheck`, off at first, saved with the view settings) draws a red wavy line under the unknown words of the visible type, leaves out type with effects, and follows edits, the custom dictionary and Ignore All. A right-click on an underlined word lists the words its dictionary suggests (each replaces it in one undo step, `text.editRange`), or No Suggestions, then Ignore All and Add to Dictionary, and a right-click on type has Spelling › Auto Spell Check, checked while it is on. Edit › Edit Custom Dictionary… lists the custom dictionary's words, with an Entry field and Add, Delete and Change, applied on Done (Cancel leaves the dictionary as it was). The modal Check Spelling dialog is done: Edit › Spelling › Check Spelling… (`Cmd+I`, `ui.checkSpelling`) opens a modal dialog displaying the unrecognized word in sentence context ("Not in Dictionary"), a list of suggestions with double-click or selection to replace ("Change to" field), and action buttons: Ignore, Ignore All, Change (one-step Undo/Redo via `text.editRange`), Change All (batched across occurrences in a single undo step), Add to Dictionary (`text.spelling.addWord`), Done and Cancel, with keyboard navigation (Tab between controls, Enter to Change or Done, Escape to close). Evidence: `crates/engine/src/tests/spelling.rs`, `crates/ui-egui/src/canvas/tests.rs` (`auto_spell_check_*`), `crates/ui-egui/src/tests/contextmenu.rs` (the right-click), `crates/ui-egui/src/dialogs/custom_dictionary.rs` (the dialog), `crates/ui-egui/src/dialogs/check_spelling.rs` (the Check Spelling dialog). |
|
||||
| Smart Punctuation, Change Case, Find & Replace | done | Type › Smart Punctuation… opens a dialog with the ff, fi, ffi and ff, fl, ffl ligatures, Smart Quotes, Smart Spaces, En, Em Dashes, Ellipses and Expert Fractions, Replace In and Report Results, which lists the count of each replacement; ligatures and fractions are written only where the font has a glyph for them. Evidence: `tests::menucmds::smart_punctuation_ligatures_spaces_and_fractions_are_counted`, `smart_punctuation_skips_ligatures_and_fractions_the_font_lacks`, `smart_spaces_keeps_one_space_after_a_period`, `dialogs::smart_punctuation::tests::menu_item_opens_the_dialog_and_ok_reports_the_counts` |
|
||||
| Alt + numeric-keypad codes while typing (Windows: `Alt+0176` → °) | partial | #5108: on Windows the character Windows posts when Alt comes up after keypad digits is typed at the caret like any other, in the typing's undo step, and the keypad digits typed with Alt run no shortcut. With NumLock off the keypad keys (Insert, End, arrows, Clear, Home, Page Up/Down without the extended-key flag) count as digits too and don't move the caret (`windows_alt_codes` unit tests; neither NumLock on nor off has been tried on a Windows machine yet). `type.insert {code}` (Windows Alt+0 code, Windows-1252 for 128–159) and `{unicode}` (hex code point) insert a character by its code (`menucmds::insert_a_character_by_its_code`). macOS and Linux have no such system convention and egui reports a keypad digit as the top-row digit, so there it does nothing; a floating panel window doesn't receive the character |
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
No build and no window: a recorder script stands in for the GUI, so the argv and environment the
|
||||
launcher passes are read directly.
|
||||
"""
|
||||
import hashlib
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -13,6 +14,10 @@ from pathlib import Path
|
||||
|
||||
HERE = Path(__file__).resolve().parent
|
||||
LAUNCHER = HERE / "nightly-launch.sh"
|
||||
# The plain tar's entrypoint is craft-common-actions' template rendered for this app; these are its bytes.
|
||||
TAR_LAUNCHER = HERE / "nightly-tar-launch.sh"
|
||||
TAR_PROFILE = "ai.storyteller.vectorcraft.nightly"
|
||||
TAR_LAUNCHER_SHA256 = "bf00f60a1644c1fd0ce440f4c992cd009f812e539c729a4b63638b1b8aed0c01"
|
||||
|
||||
RECORDER = """#!/bin/sh
|
||||
printf 'config=<%s>\n' "${VECTORCRAFT_CONFIG_DIR:-}"
|
||||
@@ -167,5 +172,85 @@ class Launchers(unittest.TestCase):
|
||||
self.assertIn("app binary is missing", result.stderr)
|
||||
|
||||
|
||||
class TarLauncher(unittest.TestCase):
|
||||
"""The plain tar's entrypoint: the shared template, rendered for VectorCraft."""
|
||||
|
||||
def setUp(self):
|
||||
self.scratch = tempfile.TemporaryDirectory()
|
||||
self.addCleanup(self.scratch.cleanup)
|
||||
self.root = Path(self.scratch.name).resolve()
|
||||
self.home = self.root / "home with space"
|
||||
self.home.mkdir()
|
||||
self.env = {"HOME": str(self.home), "PATH": "/usr/bin:/bin"}
|
||||
|
||||
def place(self):
|
||||
"""The kit's flat tar: the `vectorcraft` launcher beside the `vectorcraft-bin` GUI."""
|
||||
tree = self.root / "tar"
|
||||
tree.mkdir()
|
||||
(tree / "vectorcraft-bin").write_text(RECORDER, encoding="utf-8")
|
||||
(tree / "vectorcraft-bin").chmod(0o755)
|
||||
(tree / "vectorcraft").write_bytes(TAR_LAUNCHER.read_bytes())
|
||||
(tree / "vectorcraft").chmod(0o755)
|
||||
return tree / "vectorcraft"
|
||||
|
||||
def lines(self, launcher, *args, env=None):
|
||||
result = subprocess.run([str(launcher), *args], cwd=str(self.root), env=env or self.env,
|
||||
capture_output=True, text=True, timeout=30)
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
return result.stdout.splitlines()
|
||||
|
||||
def test_every_argument_follows_the_profile_tokens(self):
|
||||
launcher = self.place()
|
||||
root = f"{self.home}/.local/share/{TAR_PROFILE}"
|
||||
tokens = ["config=<>", "<--launch-profile>", "<nightly-v1>", "<--profile-root>", f"<{root}>"]
|
||||
self.assertEqual(self.lines(launcher), [*tokens, "<-->"])
|
||||
self.assertEqual(self.lines(launcher, "drawing with spaces.svg", "--other-name.svg"),
|
||||
[*tokens, "<-->", "<drawing with spaces.svg>", "<--other-name.svg>"])
|
||||
|
||||
def test_the_profile_follows_xdg_data_home(self):
|
||||
launcher = self.place()
|
||||
xdg = self.root / "xdg with space"
|
||||
env = dict(self.env, XDG_DATA_HOME=str(xdg))
|
||||
self.assertEqual(self.lines(launcher, "drawing.svg", env=env),
|
||||
["config=<>", "<--launch-profile>", "<nightly-v1>", "<--profile-root>",
|
||||
f"<{xdg / TAR_PROFILE}>", "<-->", "<drawing.svg>"])
|
||||
self.assertFalse(xdg.exists(), "the launcher creates no folder of its own")
|
||||
|
||||
def test_a_version_query_asks_the_gui_in_the_launcher_form(self):
|
||||
launcher = self.place()
|
||||
root = f"{self.home}/.local/share/{TAR_PROFILE}"
|
||||
for query in ("--version", "-V"):
|
||||
with self.subTest(query=query):
|
||||
self.assertEqual(self.lines(launcher, query),
|
||||
["config=<>", "<--launch-profile>", "<nightly-v1>", "<--profile-root>",
|
||||
f"<{root}>", "<--version>"])
|
||||
|
||||
def test_a_launcher_profile_argv_passes_through_unchanged(self):
|
||||
launcher = self.place()
|
||||
argv = ["--launch-profile", "nightly-v1", "--profile-root", str(self.root / "launcher root"), "--", "drawing.svg"]
|
||||
self.assertEqual(self.lines(launcher, *argv, env=self.env),
|
||||
["config=<>", *[f"<{arg}>" for arg in argv]])
|
||||
|
||||
def test_a_missing_gui_fails_rather_than_starting_another_binary(self):
|
||||
launcher = self.place()
|
||||
(self.root / "tar/vectorcraft-bin").unlink()
|
||||
result = subprocess.run([str(launcher)], cwd=str(self.root), env=self.env,
|
||||
capture_output=True, text=True, timeout=30)
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
self.assertEqual(result.stdout, "")
|
||||
|
||||
def test_the_bytes_are_the_shared_template_rendered_for_vectorcraft(self):
|
||||
data = TAR_LAUNCHER.read_bytes()
|
||||
self.assertEqual(hashlib.sha256(data).hexdigest(), TAR_LAUNCHER_SHA256,
|
||||
"the tar launcher must stay byte for byte scripts/nightly-launcher.sh.in rendered for vectorcraft")
|
||||
self.assertIn(b'target="$dir/vectorcraft-bin"', data)
|
||||
self.assertIn(f'{TAR_PROFILE}"'.encode(), data)
|
||||
|
||||
def test_the_flat_tar_stages_the_template(self):
|
||||
source = (HERE / "nightly.sh").read_text(encoding="utf-8")
|
||||
self.assertIn('"$ROOT/packaging/linux/nightly-tar-launch.sh" "$STAGE/vectorcraft"', source)
|
||||
self.assertNotIn('"$ROOT/packaging/linux/nightly-launch.sh" "$STAGE/vectorcraft"', source)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
# Nightly launcher generated by craft-common-actions scripts/nightly-launcher.sh.in. Do not edit:
|
||||
# the shared nightly producer accepts this file only byte for byte as rendered for the app.
|
||||
set -eu
|
||||
dir=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)
|
||||
readonly dir
|
||||
target="$dir/vectorcraft-bin"
|
||||
readonly target
|
||||
profile_root="${XDG_DATA_HOME:-$HOME/.local/share}/ai.storyteller.vectorcraft.nightly"
|
||||
readonly profile_root
|
||||
case "${1-}" in
|
||||
# The ArtCraft Launcher passes its own profile and per-install root; the app validates the pair.
|
||||
--launch-profile) exec "$target" "$@" ;;
|
||||
--version | -V) exec "$target" --launch-profile nightly-v1 --profile-root "$profile_root" --version ;;
|
||||
esac
|
||||
exec "$target" --launch-profile nightly-v1 --profile-root "$profile_root" -- "$@"
|
||||
@@ -19,10 +19,12 @@ nightly_build_gui
|
||||
STAGE="$NIGHTLY_WORK/stage"
|
||||
mkdir -p "$STAGE"
|
||||
# The standard Nightly layout: `<app>` is the launcher and `<app>-bin` the GUI it starts, so an
|
||||
# unpacked tar is isolated like the packages and the shared smoke can query the entrypoint.
|
||||
# unpacked tar is isolated like the packages and the shared smoke can query the entrypoint. The
|
||||
# launcher is craft-common-actions' canonical template rendered for this app (scripts/nightly_app.py
|
||||
# launcher); the formats package.sh stages keep their own launcher.
|
||||
cp "$NIGHTLY_GUI" "$STAGE/vectorcraft-bin"
|
||||
chmod 755 "$STAGE/vectorcraft-bin"
|
||||
cp "$ROOT/packaging/linux/nightly-launch.sh" "$STAGE/vectorcraft"
|
||||
cp "$ROOT/packaging/linux/nightly-tar-launch.sh" "$STAGE/vectorcraft"
|
||||
chmod 755 "$STAGE/vectorcraft"
|
||||
# The Nightly art, not stable's: with both channels open the two tars must not share an icon.
|
||||
cp "$ROOT/assets/app-icon/vectorcraft-nightly.png" "$STAGE/vectorcraft.png"
|
||||
|
||||
@@ -5,7 +5,7 @@ use std::process::Command;
|
||||
|
||||
use serde_json::Value;
|
||||
|
||||
const REV: &str = "4bed21baaa41d2b47bef90879c04df521f6f6043";
|
||||
const REV: &str = "b0d422cf0c23baccdaca314b916458a89c0952e0";
|
||||
const PACKAGES: &[(&str, &str, &str)] = &[
|
||||
("craft-pdf", "0.1.0", REV),
|
||||
("krilla", "0.8.2", REV),
|
||||
|
||||
Reference in new issue
Block a user