mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-05 13:32:45 -05:00
Merge main into feat/scripts-api-d10-print-options
This commit is contained in:
commit
3ae4153c13
42 files changed
+1666
-213
No files matched your search
Generated
+86
-86
@@ -1231,7 +1231,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-automation",
|
||||
"craft-behavior",
|
||||
@@ -1272,7 +1272,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-affinity"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"flate2",
|
||||
@@ -1283,7 +1283,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-appkit"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"block2 0.6.2",
|
||||
"objc2 0.6.5",
|
||||
@@ -1295,7 +1295,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-atomic"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"rustix 1.1.6",
|
||||
]
|
||||
@@ -1303,7 +1303,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-automation"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"base64 0.23.1",
|
||||
"craft-behavior",
|
||||
@@ -1328,7 +1328,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-behavior"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"bitflags 2.13.2",
|
||||
@@ -1346,7 +1346,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-browse"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-docpath",
|
||||
@@ -1364,7 +1364,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-cdr"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"flate2",
|
||||
@@ -1373,7 +1373,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-cloud-ui"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"egui",
|
||||
]
|
||||
@@ -1381,7 +1381,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-cms"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"md-5",
|
||||
"rayon",
|
||||
@@ -1390,12 +1390,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-codepage"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
|
||||
[[package]]
|
||||
name = "craft-color-ui"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-cms",
|
||||
@@ -1415,7 +1415,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-control"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-control-protocol",
|
||||
"craft-platform",
|
||||
@@ -1426,7 +1426,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-control-protocol"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"getrandom 0.3.4",
|
||||
"serde_json",
|
||||
@@ -1436,7 +1436,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-dds"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"rayon",
|
||||
]
|
||||
@@ -1444,7 +1444,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-dialogs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"block2 0.6.2",
|
||||
"craft-appkit",
|
||||
@@ -1470,7 +1470,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-doc"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"blake3",
|
||||
"craft-ecproj-format",
|
||||
@@ -1486,7 +1486,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-docpath"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
@@ -1494,7 +1494,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-draw"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-color-ui",
|
||||
@@ -1513,7 +1513,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-dxf"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-codepage",
|
||||
"encoding_rs",
|
||||
@@ -1525,7 +1525,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ecproj-format"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -1535,12 +1535,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-eps"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
|
||||
[[package]]
|
||||
name = "craft-font-catalog"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"fontique",
|
||||
"harfrust 0.13.3",
|
||||
@@ -1555,7 +1555,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-font-manager"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-font-catalog",
|
||||
@@ -1574,7 +1574,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-font-os-windows"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"windows-registry",
|
||||
"windows-sys 0.61.2",
|
||||
@@ -1583,7 +1583,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-font-store"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"cap-primitives",
|
||||
"craft-atomic",
|
||||
@@ -1606,12 +1606,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-fonts-build"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
|
||||
[[package]]
|
||||
name = "craft-gif"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"gif",
|
||||
]
|
||||
@@ -1619,7 +1619,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-gzip"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
]
|
||||
@@ -1627,7 +1627,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-host"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"craft-i18n",
|
||||
@@ -1640,7 +1640,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-i18n"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"brotli 9.1.3",
|
||||
"brotli-decompressor 6.3.2",
|
||||
@@ -1670,7 +1670,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-image-codecs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-dds",
|
||||
"craft-jpeg",
|
||||
@@ -1697,7 +1697,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-imaging"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-color-ui",
|
||||
@@ -1715,7 +1715,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-jpeg"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
@@ -1723,7 +1723,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-jxl"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"brotli-decompressor 5.0.3",
|
||||
"jixel",
|
||||
@@ -1734,7 +1734,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-keymap"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-host",
|
||||
"craft-i18n",
|
||||
@@ -1749,7 +1749,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-layers"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-i18n",
|
||||
@@ -1763,7 +1763,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-menu"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -1781,7 +1781,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-metadata"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"brotli-decompressor 6.3.2",
|
||||
"chrono",
|
||||
@@ -1793,7 +1793,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-metafile"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"encoding_rs",
|
||||
"image",
|
||||
@@ -1804,7 +1804,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-mime"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"craft-codepage",
|
||||
@@ -1814,7 +1814,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-nightly"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"uds_windows",
|
||||
"winsafe",
|
||||
@@ -1823,7 +1823,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-pages"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-keymap",
|
||||
@@ -1839,7 +1839,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-pcraft-format"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"serde",
|
||||
@@ -1850,7 +1850,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-pdf"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"hayro-interpret",
|
||||
"hayro-syntax",
|
||||
@@ -1862,7 +1862,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-platform"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"async-channel",
|
||||
"async-io",
|
||||
@@ -1895,7 +1895,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-plotter"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"kurbo 0.13.1",
|
||||
"thiserror 2.0.21",
|
||||
@@ -1904,7 +1904,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-print"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -1928,7 +1928,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-proof"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"log",
|
||||
"miniz_oxide 0.9.1",
|
||||
@@ -1939,7 +1939,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ps"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-eps",
|
||||
"flate2",
|
||||
@@ -1953,7 +1953,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-psd"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"encoding_rs",
|
||||
"flate2",
|
||||
@@ -1964,7 +1964,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-quit"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"dispatch2",
|
||||
"egui",
|
||||
@@ -1977,7 +1977,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-review"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"base64 0.23.1",
|
||||
"craft-behavior",
|
||||
@@ -1996,7 +1996,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-settings"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-atomic",
|
||||
"craft-host",
|
||||
@@ -2013,7 +2013,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-stream-codecs"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"fax",
|
||||
"hayro-ccitt",
|
||||
@@ -2024,7 +2024,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-svg"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-image-codecs",
|
||||
"craft-xml",
|
||||
@@ -2045,7 +2045,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-table"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-keymap",
|
||||
@@ -2057,7 +2057,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-text"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-font-manager",
|
||||
@@ -2082,7 +2082,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-theme"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"craft-tracked",
|
||||
@@ -2097,7 +2097,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-theme-store"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-atomic",
|
||||
"craft-behavior",
|
||||
@@ -2112,7 +2112,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-tiff"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"thiserror 2.0.21",
|
||||
@@ -2122,7 +2122,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-time"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"thiserror 2.0.21",
|
||||
@@ -2131,7 +2131,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-timeline"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-keymap",
|
||||
@@ -2146,12 +2146,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-tracked"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
|
||||
[[package]]
|
||||
name = "craft-ui"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-cloud-ui",
|
||||
"craft-ui-canvas",
|
||||
@@ -2165,7 +2165,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-canvas"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-i18n",
|
||||
@@ -2181,7 +2181,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-contract"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"accesskit",
|
||||
"craft-behavior",
|
||||
@@ -2219,7 +2219,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-macros"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"proc-macro-crate",
|
||||
"proc-macro2",
|
||||
@@ -2230,7 +2230,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-panels"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -2248,7 +2248,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-patterns"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -2269,7 +2269,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-shell"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -2290,7 +2290,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-ui-widgets"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-behavior",
|
||||
"craft-host",
|
||||
@@ -2309,7 +2309,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-update"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"chrono",
|
||||
@@ -2341,7 +2341,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-vectorcraft-format"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"serde",
|
||||
@@ -2352,7 +2352,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-wayland"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"raw-window-handle",
|
||||
"wayland-backend",
|
||||
@@ -2362,7 +2362,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-web-api"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"serde_json",
|
||||
@@ -2373,7 +2373,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-win32"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"winsafe",
|
||||
]
|
||||
@@ -2381,7 +2381,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-window"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"craft-appkit",
|
||||
"craft-atomic",
|
||||
@@ -2413,7 +2413,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-xml"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"quick-xml 0.41.0",
|
||||
"serde",
|
||||
@@ -3772,7 +3772,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a"
|
||||
[[package]]
|
||||
name = "hayro-cmap"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"brotli 8.0.4",
|
||||
"hayro-postscript",
|
||||
@@ -3781,7 +3781,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "hayro-interpret"
|
||||
version = "0.7.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"bitflags 2.13.2",
|
||||
"hayro-cmap",
|
||||
@@ -3799,7 +3799,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "hayro-jbig2"
|
||||
version = "0.3.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"fearless_simd",
|
||||
"hayro-ccitt",
|
||||
@@ -3817,12 +3817,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "hayro-postscript"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
|
||||
[[package]]
|
||||
name = "hayro-syntax"
|
||||
version = "0.7.2"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"hayro-ccitt",
|
||||
@@ -4805,7 +4805,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "krilla"
|
||||
version = "0.8.2"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"bumpalo",
|
||||
@@ -4962,7 +4962,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4"
|
||||
[[package]]
|
||||
name = "linesweeper"
|
||||
version = "0.5.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0#a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"kurbo 0.13.1",
|
||||
|
||||
+38
-38
@@ -10,51 +10,51 @@ license = "MIT OR Apache-2.0"
|
||||
rust-version = "1.95"
|
||||
|
||||
[workspace.dependencies]
|
||||
craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", default-features = false, features = ["interpret", "write"] }
|
||||
craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0", default-features = false, features = ["interpret", "write"] }
|
||||
craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
# Language packs: the Craft apps' shared font store installs them (#4936).
|
||||
craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
# 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 = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
# `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile.
|
||||
craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", features = ["pcraft-pixels"] }
|
||||
craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0", features = ["pcraft-pixels"] }
|
||||
# Native Affinity documents (craft-libs#914).
|
||||
craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
# Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778).
|
||||
craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
# SVG parsing, limits, SVGZ and writer (craft-libs#778).
|
||||
craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", features = ["tree"] }
|
||||
craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0", features = ["tree"] }
|
||||
craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
# EPS container, previews, ASCII85 and DSC comments (craft-libs#778).
|
||||
craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
# DXF tags, reader and writer (craft-libs#778, #926, #927).
|
||||
craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
# WMF, EMF and EMF+ reader (craft-libs#778).
|
||||
craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", default-features = false, features = ["read", "write"] }
|
||||
craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0", default-features = false, features = ["read", "write"] }
|
||||
craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
# 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 = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
# 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 = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
# Nightly profile isolation, launch protocol, and security fence.
|
||||
craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
# internal
|
||||
vectorcraft-geom = { path = "crates/geom" }
|
||||
vectorcraft-color = { path = "crates/color" }
|
||||
@@ -194,13 +194,13 @@ lto = "thin"
|
||||
codegen-units = 1
|
||||
|
||||
[patch.crates-io]
|
||||
hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
krilla = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
|
||||
hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
krilla = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0" }
|
||||
ecolor = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
|
||||
emath = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
|
||||
epaint = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
|
||||
|
||||
@@ -48,3 +48,14 @@ objc2-core-text = { version = "0.3", default-features = false, features = ["std"
|
||||
tempfile = "3"
|
||||
vectorcraft-testkit = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
# The files of other crates that this crate compiles or its tests read, for CI's test selection.
|
||||
[package.metadata.craft]
|
||||
reads = [
|
||||
"apps/vectorcraft/src/mac_fonts.rs",
|
||||
"apps/vectorcraft/src/prefs_dir.rs",
|
||||
"apps/vectorcraft/src/profile.rs",
|
||||
"apps/vectorcraft/src/system_fonts.rs",
|
||||
"apps/vectorcraft/src/windows_cores.rs",
|
||||
"crates/plugins/tests/fixtures/desaturate.wasm",
|
||||
]
|
||||
@@ -28,7 +28,7 @@ egui_extras = { 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 = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", version = "0.1.0" }
|
||||
craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0", version = "0.1.0" }
|
||||
|
||||
wasm-bindgen = "0.2"
|
||||
serde_json = { workspace = true }
|
||||
|
||||
@@ -24,3 +24,7 @@ craft-image-codecs = { workspace = true }
|
||||
# tests/it's `import_limits`, `outline_limits` and `text` modules need `synth`, also when this crate
|
||||
# is tested without vectorcraft-engine (`cargo xtask ci shard`).
|
||||
vectorcraft-affinity = { path = ".", features = ["synth"] }
|
||||
|
||||
# The files of other crates that this crate's tests compile or read, for CI's test selection.
|
||||
[package.metadata.craft]
|
||||
reads = ["xtask/affinity-corpus.sha256", "xtask/src/sha256.rs"]
|
||||
@@ -144,3 +144,14 @@ ruzstd = { workspace = true }
|
||||
vectorcraft-js = { workspace = true }
|
||||
# A bundled font's own glyph boxes, for the glyph bounds tests.
|
||||
skrifa = { workspace = true }
|
||||
|
||||
# The files of other crates that this crate compiles or its tests read, for CI's test selection.
|
||||
[package.metadata.craft]
|
||||
reads = [
|
||||
"crates/affinity/tests/support/corpus.rs",
|
||||
"crates/affinity/tests/support/text_fixture.rs",
|
||||
"crates/apischema/src/conformance.rs",
|
||||
"crates/plugins/tests/fixtures/desaturate.wasm",
|
||||
"xtask/affinity-corpus.sha256",
|
||||
"xtask/src/sha256.rs",
|
||||
]
|
||||
@@ -679,8 +679,24 @@ pub fn matrix_param(p: &Value, key: &str) -> Option<Affine> {
|
||||
}
|
||||
/// A colour from `"#rrggbb"`, a colour key (`"cmyk 0 100 100 0"`, `"lab 55 60 40"`), `[r,g,b]` (0..1),
|
||||
/// `{"c":..,"m":..,"y":..,"k":..}` (percent when any component is above 1, else 0..1), `{"gray":..}` or `{"l":..,"a":..,"b":..}` (CIE Lab: L 0..100, a and b about
|
||||
/// −128..127). `None` for a hex color with an alpha part (`#rrggbbaa` or `#rgba`, with or without the `#`).
|
||||
/// −128..127). `None` for a hex color with an alpha part (`#rrggbbaa` or `#rgba`, with or without the `#`),
|
||||
/// and for a color with a component too large to store ([`color_is_finite`]).
|
||||
pub fn color_value(v: &Value) -> Option<Color> {
|
||||
given_color(v).filter(color_is_finite)
|
||||
}
|
||||
|
||||
/// Is every component of `c` finite? A number past `f32::MAX`, such as `{"c": 1e300}`, is stored
|
||||
/// as an infinity.
|
||||
pub fn color_is_finite(c: &Color) -> bool {
|
||||
match *c {
|
||||
Color::Rgb { r, g, b } | Color::Lab { l: r, a: g, b } => [r, g, b].iter().all(|x| x.is_finite()),
|
||||
Color::Cmyk { c, m, y, k } => [c, m, y, k].iter().all(|x| x.is_finite()),
|
||||
Color::Gray { k } => k.is_finite(),
|
||||
}
|
||||
}
|
||||
|
||||
/// The color `v` gives, as [`color_value`] reads it, with its components unchecked.
|
||||
fn given_color(v: &Value) -> Option<Color> {
|
||||
match v {
|
||||
Value::String(s) if hex_with_alpha(s) => None,
|
||||
// A hex, or a colour key ("cmyk 0 100 100 0", as Recolor Artwork lists colours).
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//! the bridges connect, replacing the circles or added above them.
|
||||
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_doc::{Document, Node, NodeId, NodeKind};
|
||||
use vectorcraft_doc::{Document, LiveShape, Node, NodeId, NodeKind};
|
||||
use vectorcraft_geom::PathData;
|
||||
use vectorcraft_pathops::addons::pathtools as pt;
|
||||
|
||||
@@ -34,7 +34,7 @@ pub(super) fn specs() -> Vec<CommandSpec> {
|
||||
"Smooth Bridge",
|
||||
["Object", "Plug-ins", "Path Precision Tools"],
|
||||
None,
|
||||
"{radius?: % 1..1000 (100; the radius of each bridge's two arcs as a percentage of the smaller circle's radius: larger makes a wider, gentler bridge), gap?: pt 0..1000 (instead of radius: the arcs' radius is the smaller circle's radius plus this gap, so each arc stays this gap away from a circle of the smaller circle's size about the arc's center; for equal circles this gap apart that is where a third circle this gap from both sits, as in a triangular grid, so the channels around an empty place in such a grid are one width; giving both is an error), reach?: pt 0..10000 (10; with three or more circles: how far apart two circles' outlines may be for a bridge between them, overlapping ones included; two circles are bridged at any distance), keepOriginals?: bool (false: each outline replaces its circles, painted as the topmost of them, and a group or compound path the other circles leave empty goes; true: it goes directly above that circle and the circles stay), ids?: [id] (default: the selection; a group, other than a clipping group, gives the objects inside it)} join circles (paths whose outline is a circle, not hidden or locked) into metaball (aka meatball) shapes. Two circles become one closed outline: around each circle on its side away from the other, and along two concave arcs, one on each side, that touch both circles so the outline runs on smoothly into them. With three or more, every two circles within reach are bridged the same way, and the bridges that connect are united into one shape each (holes smaller than 1% of the smallest circle's area are filled); a pair within reach but too far apart for the radius gets no bridge, and so does one whose neck would be thinner than the precision its shape is united at, and a circle bridged to no other is left as it is. Overlapping and touching circles are joined too. One circle inside another (among three or more, any such pair within reach) is an error; so are two circles too far apart for the radius (the arcs would not reach both, or would cross), or three or more with no pair the arcs can join, which suggests a larger radius or gap when the largest one would bridge them; so are no two circles within reach, more than 2000 circles and more than 8000 bridges. One undo step; the outlines (and the circles left as they are) are selected → {ids, alone}, with {id} too for two circles",
|
||||
"{radius?: % 1..1000 (100; the radius of each bridge's two arcs as a percentage of the smaller circle's radius: larger makes a wider, gentler bridge), gap?: pt 0..1000 (instead of radius: the arcs' radius is the smaller circle's radius plus this gap, so each arc stays this gap away from a circle of the smaller circle's size about the arc's center; for equal circles this gap apart that is where a third circle this gap from both sits, as in a triangular grid, so the channels around an empty place in such a grid are one width; giving both is an error), reach?: pt 0..10000 (10; with three or more circles: how far apart two circles' outlines may be for a bridge between them, overlapping ones included; two circles are bridged at any distance), keepOriginals?: bool (false: each outline replaces its circles, painted as the topmost of them, and a group or compound path the other circles leave empty goes; true: it goes directly above that circle and the circles stay), ids?: [id] (default: the selection; a group, other than a clipping group, gives the objects inside it)} join circles (paths whose outline is a circle, not hidden or locked) into metaball (aka meatball) shapes. Two circles become one closed outline: around each circle on its side away from the other, and along two concave arcs, one on each side, that touch both circles so the outline runs on smoothly into them. With three or more, every two circles within reach are bridged the same way, and the bridges that connect are united into one shape each (holes smaller than 1% of the smallest circle's area are filled); a pair within reach but too far apart for the radius gets no bridge, and so does one whose neck would be thinner than the precision its shape is united at, and a circle bridged to no other is left as it is. Overlapping and touching circles are joined too. An object that is not a circle is an error that says why (an ellipse whose width and height differ, a compound path, a hidden or locked object, or another object). One circle inside another (among three or more, any such pair within reach) is an error; so are two circles too far apart for the radius (the arcs would not reach both, or would cross), or three or more with no pair the arcs can join, which suggests a larger radius or gap when the largest one would bridge them; so are no two circles within reach, more than 2000 circles and more than 8000 bridges. One undo step; the outlines (and the circles left as they are) are selected → {ids, alone}, with {id} too for two circles",
|
||||
has_selection,
|
||||
bridge
|
||||
)]
|
||||
@@ -61,17 +61,30 @@ fn bridge(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
if roots.len() > pt::MAX_BRIDGED_CIRCLES {
|
||||
return Err(bad(C, "select at most 2000 circles to bridge"));
|
||||
}
|
||||
let circles: Vec<(NodeId, pt::Circle)> = {
|
||||
// The circles, and why the first object that is not one is refused.
|
||||
let (circles, why): (Vec<(NodeId, pt::Circle)>, Option<&str>) = {
|
||||
let d = &s.doc()?.doc;
|
||||
let editable = d.editable();
|
||||
d.paint_order(roots.iter().copied())
|
||||
let mut why = None;
|
||||
let circles = d
|
||||
.paint_order(roots.iter().copied())
|
||||
.into_iter()
|
||||
.filter_map(|id| match &d.node(id)?.kind {
|
||||
NodeKind::Path { path, guide: false, clipping: false, .. } if editable(id) => Some((id, pt::circle_of(path)?)),
|
||||
_ => None,
|
||||
.filter_map(|id| {
|
||||
let found = match &d.node(id)?.kind {
|
||||
NodeKind::Path { path, guide: false, clipping: false, .. } if editable(id) => pt::circle_of(path).map(|c| (id, c)),
|
||||
_ => None,
|
||||
};
|
||||
if found.is_none() && why.is_none() {
|
||||
why = Some(not_a_circle(d, id, editable(id)));
|
||||
}
|
||||
found
|
||||
})
|
||||
.collect()
|
||||
.collect();
|
||||
(circles, why)
|
||||
};
|
||||
if let Some(why) = why {
|
||||
return Err(bad(C, format!("select two or more circles to bridge: {why}")));
|
||||
}
|
||||
if circles.len() != roots.len() || circles.len() < 2 {
|
||||
return Err(bad(C, "select two or more circles to bridge"));
|
||||
}
|
||||
@@ -159,6 +172,26 @@ fn members(d: &Document, ids: &[NodeId]) -> Vec<NodeId> {
|
||||
out
|
||||
}
|
||||
|
||||
/// Why object `id`, which is not a circle the command bridges, is refused; `editable` says whether it can be
|
||||
/// edited (not hidden or locked).
|
||||
fn not_a_circle(d: &Document, id: NodeId, editable: bool) -> &'static str {
|
||||
// A pie spanning the whole turn, or none of it, is the whole ellipse.
|
||||
let whole = |(start, end): (f64, f64)| {
|
||||
let span = (end - start).rem_euclid(360.0);
|
||||
span < 1e-9 || 360.0 - span < 1e-9
|
||||
};
|
||||
match d.node(id).map(|n| &n.kind) {
|
||||
_ if !editable => "a selected object is hidden or locked",
|
||||
// A transform that stretches an ellipse leaves its stored width and height as they were, so one stored with
|
||||
// equal width and height gets the general message.
|
||||
Some(NodeKind::Path { live: Some(live), guide: false, clipping: false, .. }) if matches!(**live, LiveShape::Ellipse { w, h, pie, .. } if whole(pie) && w != h) => {
|
||||
"an ellipse whose width and height differ is not a circle: draw it with Shift held, or give it equal width and height"
|
||||
}
|
||||
Some(NodeKind::Compound { .. }) => "a compound path is not a circle: release it first",
|
||||
_ => "a selected object is not a circle",
|
||||
}
|
||||
}
|
||||
|
||||
/// Remove each of `parents` that is left with nothing in it, and then each group above it left with
|
||||
/// nothing in it in turn. Layers stay.
|
||||
fn remove_emptied(d: &mut Document, parents: Vec<NodeId>) -> Result<()> {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//! gap, many circles joined to their neighbors within reach, and what it refuses.
|
||||
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_doc::{NodeId, NodeKind};
|
||||
use vectorcraft_doc::{LiveShape, NodeId, NodeKind};
|
||||
use vectorcraft_geom::kurbo::Shape;
|
||||
|
||||
use crate::Session;
|
||||
@@ -173,6 +173,50 @@ fn far_apart_nested_and_other_objects_are_refused() {
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), steps, "nothing changed, no undo step");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_refusal_says_why_an_object_is_not_a_circle() {
|
||||
let mut s = session();
|
||||
let a = circle(&mut s, 100.0, 100.0, 20.0);
|
||||
let b = circle(&mut s, 160.0, 100.0, 20.0);
|
||||
// A hand-drawn ellipse 1 pt taller than wide.
|
||||
let oval = NodeId(s.execute("shape.ellipse", &json!({"x": 200, "y": 80, "width": 40, "height": 41})).unwrap()["id"].as_u64().unwrap());
|
||||
let square = NodeId(s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 20, "height": 20})).unwrap()["id"].as_u64().unwrap());
|
||||
let stretched = circle(&mut s, 300.0, 100.0, 20.0);
|
||||
s.execute("object.transform", &json!({"ids": [stretched.0], "matrix": [2.0, 0.0, 0.0, 1.0, 0.0, 0.0]})).unwrap();
|
||||
let steps = s.doc().unwrap().history.undo.len();
|
||||
let e = err(&mut s, json!({"ids": [a.0, oval.0]}));
|
||||
assert!(
|
||||
e.ends_with(
|
||||
"select two or more circles to bridge: an ellipse whose width and height differ is not a circle: draw it with Shift held, or give it equal width and height"
|
||||
),
|
||||
"{e}"
|
||||
);
|
||||
let e = err(&mut s, json!({"ids": [a.0, square.0]}));
|
||||
assert!(e.ends_with("select two or more circles to bridge: a selected object is not a circle"), "{e}");
|
||||
// A circle stretched by a transform keeps its equal stored width and height, so it is not called unequal.
|
||||
let equal = match s.doc().unwrap().doc.node(stretched).map(|n| &n.kind) {
|
||||
Some(NodeKind::Path { live: Some(live), .. }) => matches!(**live, LiveShape::Ellipse { w, h, .. } if w == h),
|
||||
_ => false,
|
||||
};
|
||||
assert!(equal, "the stretched circle keeps a live ellipse of equal width and height");
|
||||
let e = err(&mut s, json!({"ids": [a.0, stretched.0]}));
|
||||
assert!(e.ends_with("select two or more circles to bridge: a selected object is not a circle"), "{e}");
|
||||
let e = err(&mut s, json!({"ids": [a.0]}));
|
||||
assert!(e.ends_with("select two or more circles to bridge"), "one circle: {e}");
|
||||
select(&mut s, &[b]);
|
||||
s.execute("object.hide", &json!({})).unwrap();
|
||||
let e = err(&mut s, json!({"ids": [a.0, b.0]}));
|
||||
assert!(e.ends_with("select two or more circles to bridge: a selected object is hidden or locked"), "{e}");
|
||||
s.execute("edit.undo", &json!({})).unwrap();
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), steps, "no undo step for a refusal");
|
||||
|
||||
select(&mut s, &[a, b]);
|
||||
let compound = NodeId(s.execute("object.compoundPath.make", &json!({})).unwrap()["id"].as_u64().unwrap());
|
||||
let c = circle(&mut s, 300.0, 200.0, 20.0);
|
||||
let e = err(&mut s, json!({"ids": [compound.0, c.0]}));
|
||||
assert!(e.ends_with("select two or more circles to bridge: a compound path is not a circle: release it first"), "{e}");
|
||||
}
|
||||
|
||||
/// A 3 × 3 grid of circles of radius 10, 4 apart (centers 24 apart), in rows from (100, 100).
|
||||
fn grid(s: &mut Session) -> Vec<NodeId> {
|
||||
(0..9).map(|k| circle(s, 100.0 + 24.0 * (k % 3) as f64, 100.0 + 24.0 * (k / 3) as f64, 10.0)).collect()
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
//! Selection Tools (`addon.select.*`), a built-in add-on: Select by Artboards selects the objects
|
||||
//! overlapping, fully inside or fully outside one or more chosen artboards (#5525), and Select by
|
||||
//! Link Status selects the images and placed documents whose file is linked, embedded, missing or
|
||||
//! modified (#5526), saying which ones it had to leave out and why. Its submenu (Object › Plug-ins
|
||||
//! › Selection Tools), the Links panel's menu items and the dialogs are the UI's.
|
||||
//! modified (#5526), saying which ones it had to leave out and why. Edit Points Only narrows the
|
||||
//! selection to the anchor points selected in it, dropping selected segments and objects without
|
||||
//! anchor points. Its submenu (Object › Plug-ins › Selection Tools), the Links panel's menu items
|
||||
//! and the dialogs are the UI's.
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
use std::collections::BTreeSet;
|
||||
use std::collections::{BTreeMap, BTreeSet, HashSet};
|
||||
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_doc::{LockedArtboards, Node, NodeId, NodeKind};
|
||||
use vectorcraft_geom::Point;
|
||||
use vectorcraft_doc::{AnchorRef, LockedArtboards, Node, NodeId, NodeKind};
|
||||
use vectorcraft_geom::{PathData, Point};
|
||||
|
||||
use super::super::links::{Status, statuses};
|
||||
use super::super::panelcmds::listed_artboards;
|
||||
@@ -47,6 +49,15 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
has_doc,
|
||||
by_link_status
|
||||
),
|
||||
cmd!(
|
||||
"addon.select.editPointsOnly",
|
||||
"Edit Points Only",
|
||||
["Object", "Plug-ins", "Selection Tools"],
|
||||
None,
|
||||
"{segmentEnds?: false (true: the points at the ends of each selected segment stay selected, as anchor points; any non-boolean value, including null, is an error)} narrow the selection to paths and their selected anchor points: a path with selected anchor points keeps them; a path with selected segments drops the segments and keeps its other selected anchor points, and the points at the segments' ends leave the selection unless segmentEnds is true; a path selected whole stays selected whole and still receives object transforms, including stroke and effect scaling when enabled; a group or compound path selected whole gives way to the paths inside it, each selected whole unless it has an explicit anchor pick, leaving out hidden and locked ones, a Shaper Group's original shapes and, while guides are locked, paths made into guides; explicit anchor picks take precedence regardless of selection order; type, images, symbols, meshes and other objects without anchor points, and ruler guides, leave the selection. With nothing selected, or no anchor point left to keep, it is an error that leaves the selection as it was. The command does not add an undo step. In the desktop dialog, a successful preview or OK clears only that dialog's preview error if it is still the current status message → {changed (false when the selection already held only anchor points), count (the paths left selected), points (the anchor points selected on them)}",
|
||||
has_doc,
|
||||
edit_points_only
|
||||
),
|
||||
]
|
||||
}
|
||||
|
||||
@@ -193,3 +204,114 @@ fn by_link_status(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
}
|
||||
Ok(out)
|
||||
}
|
||||
|
||||
/// The anchor points of `path` that `refs` names, leaving out references to points it does not have.
|
||||
fn on_path(path: &PathData, refs: &BTreeSet<AnchorRef>) -> BTreeSet<AnchorRef> {
|
||||
refs.iter().copied().filter(|&(si, ai)| path.subpaths.get(si).is_some_and(|sp| ai < sp.anchors.len())).collect()
|
||||
}
|
||||
|
||||
/// The points at the ends of the segments `segments` of `path`.
|
||||
fn segment_ends(path: &PathData, segments: &BTreeSet<AnchorRef>) -> BTreeSet<AnchorRef> {
|
||||
let mut ends = BTreeSet::new();
|
||||
for &(si, seg) in segments {
|
||||
if let Some(sp) = path.subpaths.get(si) {
|
||||
ends.extend([(si, seg), (si, (seg + 1) % sp.anchors.len().max(1))]);
|
||||
}
|
||||
}
|
||||
ends
|
||||
}
|
||||
|
||||
/// The paths inside container `n` with at least one anchor point, depth first, through the groups
|
||||
/// and compound paths in it: hidden and locked objects (and what they hold), a Shaper Group's
|
||||
/// original shapes, and paths made into guides while `guides_locked`, are left out.
|
||||
fn paths_inside<'a>(n: &'a Node, guides_locked: bool, out: &mut Vec<&'a Node>) {
|
||||
let originals = usize::from(n.extras().shaper.is_some());
|
||||
for c in n.children().into_iter().flatten().skip(originals) {
|
||||
if !c.visible || c.locked {
|
||||
continue;
|
||||
}
|
||||
match &c.kind {
|
||||
NodeKind::Path { guide: true, .. } if guides_locked => {}
|
||||
NodeKind::Path { path, .. } if path.anchors().next().is_some() => out.push(c),
|
||||
NodeKind::Group { .. } | NodeKind::Compound { .. } => paths_inside(c, guides_locked, out),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// `addon.select.editPointsOnly`: narrow the selection to the anchor points selected in it.
|
||||
fn edit_points_only(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
const C: &str = "addon.select.editPointsOnly";
|
||||
let keep_ends = match p.get("segmentEnds") {
|
||||
None => false,
|
||||
Some(value) => value.as_bool().ok_or_else(|| bad(C, "`segmentEnds` must be true or false"))?,
|
||||
};
|
||||
let guides_locked = s.menu.guides_locked;
|
||||
let st = s.doc()?;
|
||||
let (doc, sel) = (&st.doc, &st.selection);
|
||||
if sel.objects.is_empty() {
|
||||
return Err(bad(C, "select anchor points or segments first"));
|
||||
}
|
||||
// Each path once, in selection order, with its points kept: `None` for all of them.
|
||||
let mut seen = HashSet::new();
|
||||
let explicit: HashSet<NodeId> = sel.objects.iter().copied().filter(|id| sel.anchors.contains_key(id)).collect();
|
||||
let mut kept: Vec<(NodeId, usize, Option<BTreeSet<AnchorRef>>)> = vec![];
|
||||
for id in &sel.objects {
|
||||
let Some(n) = doc.node(*id) else { continue };
|
||||
if !doc.ancestry(*id).is_some_and(|ancestors| ancestors.iter().all(|id| doc.node(*id).is_some_and(|n| n.visible && !n.locked))) {
|
||||
continue;
|
||||
}
|
||||
match &n.kind {
|
||||
NodeKind::Path { path, .. } => {
|
||||
let Some(refs) = sel.anchors.get(id) else {
|
||||
let count = path.anchors().count();
|
||||
if count > 0 && seen.insert(*id) {
|
||||
kept.push((*id, count, None));
|
||||
}
|
||||
continue;
|
||||
};
|
||||
let mut picked = on_path(path, refs);
|
||||
if let Some(segments) = sel.segments.get(id)
|
||||
&& !keep_ends
|
||||
{
|
||||
let ends = segment_ends(path, segments);
|
||||
picked.retain(|r| !ends.contains(r));
|
||||
}
|
||||
if !picked.is_empty() && seen.insert(*id) {
|
||||
kept.push((*id, picked.len(), Some(picked)));
|
||||
}
|
||||
}
|
||||
NodeKind::Group { .. } | NodeKind::Compound { .. } => {
|
||||
let mut inside = vec![];
|
||||
paths_inside(n, guides_locked, &mut inside);
|
||||
for c in inside {
|
||||
if explicit.contains(&c.id) {
|
||||
continue;
|
||||
}
|
||||
if seen.insert(c.id) {
|
||||
kept.push((c.id, c.path_data().map_or(0, |path| path.anchors().count()), None));
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
let points: usize = kept.iter().map(|(_, n, _)| n).sum();
|
||||
let objects: Vec<NodeId> = kept.iter().map(|(id, ..)| *id).collect();
|
||||
let anchors: BTreeMap<NodeId, BTreeSet<AnchorRef>> = kept.into_iter().filter_map(|(id, _, set)| Some((id, set?))).collect();
|
||||
if objects.is_empty() {
|
||||
return Err(bad(C, "no anchor points are selected"));
|
||||
}
|
||||
let changed = objects != sel.objects || anchors != sel.anchors || !sel.segments.is_empty() || !sel.guides.is_empty();
|
||||
let count = objects.len();
|
||||
if changed {
|
||||
s.select(|_, sel| {
|
||||
let (key, key_anchor) = (sel.key.filter(|k| objects.contains(k)), sel.key_anchor);
|
||||
sel.set(objects);
|
||||
sel.anchors = anchors;
|
||||
sel.key = key;
|
||||
sel.key_anchor = key_anchor;
|
||||
})?;
|
||||
}
|
||||
Ok(json!({ "changed": changed, "count": count, "points": points }))
|
||||
}
|
||||
@@ -337,3 +337,320 @@ mod by_link_status {
|
||||
assert!(Session::new().execute(C, &json!({"status": "linked"})).is_err());
|
||||
}
|
||||
}
|
||||
|
||||
/// Edit Points Only.
|
||||
mod edit_points_only {
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_doc::NodeId;
|
||||
|
||||
use super::rect;
|
||||
use crate::Session;
|
||||
|
||||
const C: &str = "addon.select.editPointsOnly";
|
||||
|
||||
/// A document with two rectangles, `a` and `b` (four anchors each, anchor 0 first).
|
||||
fn two() -> (Session, NodeId, NodeId) {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({"width": 400, "height": 300})).unwrap();
|
||||
let a = rect(&mut s, 10.0, 10.0, 50.0, 50.0);
|
||||
let b = rect(&mut s, 100.0, 10.0, 50.0, 50.0);
|
||||
(s, a, b)
|
||||
}
|
||||
|
||||
/// Anchors 0 and 1 of `a`, anchor 3 of `b`, and then segment 1 of `b` (its ends are anchors 1 and 2).
|
||||
fn mixed(s: &mut Session, a: NodeId, b: NodeId) {
|
||||
let items = json!([{"id": a.0, "anchors": [[0, 0], [0, 1]]}, {"id": b.0, "anchors": [[0, 3]]}]);
|
||||
s.execute("select.anchorsMany", &json!({"items": items})).unwrap();
|
||||
s.execute("select.segments", &json!({"id": b.0, "segments": [[0, 1]], "mode": "add"})).unwrap();
|
||||
}
|
||||
|
||||
fn refs(v: &[(usize, usize)]) -> BTreeSet<(usize, usize)> {
|
||||
v.iter().copied().collect()
|
||||
}
|
||||
|
||||
/// Selected objects, with the selected anchors of those selected in part.
|
||||
type Picked = (Vec<NodeId>, BTreeMap<NodeId, BTreeSet<(usize, usize)>>);
|
||||
|
||||
/// The selected objects and their selected anchors.
|
||||
fn picked(s: &Session) -> Picked {
|
||||
let sel = &s.doc().unwrap().selection;
|
||||
(sel.objects.clone(), sel.anchors.clone())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn selected_segments_drop_out_and_the_anchor_points_stay() {
|
||||
let (mut s, a, b) = two();
|
||||
mixed(&mut s, a, b);
|
||||
let before = s.doc().unwrap().selection.clone();
|
||||
assert_eq!(before.anchors[&b], refs(&[(0, 1), (0, 2), (0, 3)]), "a segment's ends move with it");
|
||||
let undo = s.doc().unwrap().history.undo.len();
|
||||
let r = s.execute(C, &json!({})).unwrap();
|
||||
assert_eq!(r, json!({"changed": true, "count": 2, "points": 3}));
|
||||
let sel = &s.doc().unwrap().selection;
|
||||
assert_eq!(sel.objects, vec![a, b]);
|
||||
assert_eq!(sel.anchors[&a], refs(&[(0, 0), (0, 1)]));
|
||||
assert_eq!(sel.anchors[&b], refs(&[(0, 3)]), "the segment's ends leave the selection");
|
||||
assert!(sel.segments.is_empty(), "no segment stays selected");
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), undo, "only the selection changes");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn segment_ends_stay_as_anchor_points_when_asked() {
|
||||
let (mut s, a, b) = two();
|
||||
mixed(&mut s, a, b);
|
||||
let r = s.execute(C, &json!({"segmentEnds": true})).unwrap();
|
||||
assert_eq!(r, json!({"changed": true, "count": 2, "points": 5}));
|
||||
let sel = &s.doc().unwrap().selection;
|
||||
assert_eq!(sel.anchors[&b], refs(&[(0, 1), (0, 2), (0, 3)]));
|
||||
assert!(sel.segments.is_empty());
|
||||
// With the default, a path holding only a selected segment leaves the selection.
|
||||
s.execute("select.segments", &json!({"id": b.0, "segments": [[0, 0]]})).unwrap();
|
||||
s.execute("select.anchors", &json!({"id": a.0, "anchors": [[0, 2]], "mode": "add"})).unwrap();
|
||||
let r = s.execute(C, &json!({"segmentEnds": false})).unwrap();
|
||||
assert_eq!(r, json!({"changed": true, "count": 1, "points": 1}));
|
||||
assert_eq!(picked(&s), (vec![a], BTreeMap::from([(a, refs(&[(0, 2)]))])));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_selection_of_anchor_points_alone_is_left_as_it_is() {
|
||||
let (mut s, a, b) = two();
|
||||
s.execute("select.anchors", &json!({"id": a.0, "anchors": [[0, 0], [0, 2]]})).unwrap();
|
||||
let before = picked(&s);
|
||||
assert_eq!(s.execute(C, &json!({})).unwrap(), json!({"changed": false, "count": 1, "points": 2}));
|
||||
assert_eq!(picked(&s), before);
|
||||
// Paths selected whole keep all their points.
|
||||
s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap();
|
||||
assert_eq!(s.execute(C, &json!({})).unwrap(), json!({"changed": false, "count": 2, "points": 8}));
|
||||
assert_eq!(picked(&s), (vec![a, b], BTreeMap::new()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn explicit_anchor_picks_override_group_expansion_in_either_order() {
|
||||
for group_first in [true, false] {
|
||||
let (mut s, a, b) = two();
|
||||
s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap();
|
||||
let group = NodeId(s.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap());
|
||||
s.select(|_, sel| {
|
||||
sel.set(if group_first { vec![group, a] } else { vec![a, group] });
|
||||
sel.anchors.insert(a, refs(&[(0, 0)]));
|
||||
})
|
||||
.unwrap();
|
||||
let before = s.doc().unwrap().doc.node(a).unwrap().path_data().unwrap().clone();
|
||||
assert_eq!(s.execute(C, &json!({})).unwrap(), json!({"changed": true, "count": 2, "points": 5}));
|
||||
assert_eq!(s.doc().unwrap().selection.anchors[&a], refs(&[(0, 0)]));
|
||||
s.execute("object.move", &json!({"dx": 10, "dy": 20})).unwrap();
|
||||
let after = s.doc().unwrap().doc.node(a).unwrap().path_data().unwrap();
|
||||
for ((_, i, old), (_, _, new)) in before.anchors().zip(after.anchors()) {
|
||||
if i == 0 {
|
||||
assert_ne!(new.p, old.p);
|
||||
} else {
|
||||
assert_eq!(new.p, old.p, "unselected anchors stay in place");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hidden_or_locked_selected_nodes_and_their_ancestors_are_left_out() {
|
||||
for locked in [false, true] {
|
||||
for target in ["path", "group", "ancestor", "layer"] {
|
||||
let (mut s, a, b) = two();
|
||||
let good = rect(&mut s, 200.0, 10.0, 20.0, 20.0);
|
||||
s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap();
|
||||
let group = NodeId(s.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap());
|
||||
let blocked = match target {
|
||||
"path" => a,
|
||||
"layer" => s.doc().unwrap().doc.layers[0].id,
|
||||
_ => group,
|
||||
};
|
||||
let doc = std::sync::Arc::make_mut(&mut s.doc_mut().unwrap().doc);
|
||||
let node = doc.node_mut(blocked).unwrap();
|
||||
if locked {
|
||||
node.locked = true;
|
||||
} else {
|
||||
node.visible = false;
|
||||
}
|
||||
let selected = if matches!(target, "path" | "ancestor") { a } else { group };
|
||||
s.execute("select.set", &json!({"ids": [good.0, selected.0]})).unwrap();
|
||||
if target == "layer" {
|
||||
let before = s.doc().unwrap().selection.clone();
|
||||
assert!(s.execute(C, &json!({})).is_err());
|
||||
assert_eq!(s.doc().unwrap().selection, before);
|
||||
} else {
|
||||
s.execute(C, &json!({})).unwrap();
|
||||
assert_eq!(picked(&s), (vec![good], BTreeMap::new()), "{target}, locked: {locked}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn group_expansion_selects_each_descendant_path() {
|
||||
let (mut s, _, _) = two();
|
||||
let mut groups = vec![];
|
||||
let mut paths = vec![];
|
||||
for x in [10.0, 100.0, 200.0] {
|
||||
let a = rect(&mut s, x, 100.0, 20.0, 20.0);
|
||||
let b = rect(&mut s, x, 150.0, 20.0, 20.0);
|
||||
s.execute("select.set", &json!({"ids": [a.0, b.0]})).unwrap();
|
||||
groups.push(NodeId(s.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap()));
|
||||
paths.extend([a, b]);
|
||||
}
|
||||
s.select(|_, sel| sel.set(groups)).unwrap();
|
||||
s.execute(C, &json!({})).unwrap();
|
||||
assert_eq!(picked(&s), (paths, BTreeMap::new()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn appearance_row_commands_survive_preview_replacement_and_cancel() {
|
||||
for index in [json!(1), Value::Null] {
|
||||
for selection_preview in [false, true] {
|
||||
let (mut s, a, b) = two();
|
||||
mixed(&mut s, a, b);
|
||||
s.execute("appearance.addFill", &json!({})).unwrap();
|
||||
s.execute("appearance.setActiveItem", &json!({"index": 0})).unwrap();
|
||||
s.begin_interaction("Drag").unwrap();
|
||||
s.doc_mut().unwrap().interaction.as_mut().unwrap().tool = !selection_preview;
|
||||
if selection_preview {
|
||||
s.preview(C, &json!({})).unwrap();
|
||||
assert_eq!(s.appearance_item(), None);
|
||||
} else {
|
||||
s.preview("object.move", &json!({"dx": 10, "dy": 0})).unwrap();
|
||||
}
|
||||
s.execute("appearance.setActiveItem", &json!({"index": index})).unwrap();
|
||||
let expected = index.as_u64().map(|i| i as usize);
|
||||
s.preview("object.move", &json!({"dx": 20, "dy": 0})).unwrap();
|
||||
assert_eq!(s.appearance_item(), expected, "replacement preserves the explicit row command");
|
||||
s.cancel_interaction().unwrap();
|
||||
assert_eq!(s.appearance_item(), expected, "cancel preserves the explicit row command");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cancel_preserves_an_appearance_row_command_without_another_preview() {
|
||||
for index in [json!(1), Value::Null] {
|
||||
let (mut s, a, b) = two();
|
||||
mixed(&mut s, a, b);
|
||||
s.execute("appearance.addFill", &json!({})).unwrap();
|
||||
s.execute("appearance.setActiveItem", &json!({"index": 0})).unwrap();
|
||||
s.begin_interaction("Drag").unwrap();
|
||||
s.doc_mut().unwrap().interaction.as_mut().unwrap().tool = true;
|
||||
s.preview(C, &json!({})).unwrap();
|
||||
s.execute("appearance.setActiveItem", &json!({"index": index})).unwrap();
|
||||
s.cancel_interaction().unwrap();
|
||||
assert_eq!(s.appearance_item(), index.as_u64().map(|i| i as usize));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn canceling_a_selection_preview_restores_the_active_appearance_item() {
|
||||
let (mut s, a, b) = two();
|
||||
mixed(&mut s, a, b);
|
||||
s.execute("appearance.addFill", &json!({})).unwrap();
|
||||
s.execute("appearance.setActiveItem", &json!({"index": 0})).unwrap();
|
||||
let before = s.doc().unwrap().doc.node(a).unwrap().appearance.items.clone();
|
||||
s.begin_interaction("Edit Points Only").unwrap();
|
||||
s.preview(C, &json!({})).unwrap();
|
||||
assert_eq!(s.appearance_item(), None);
|
||||
s.preview(C, &json!({"segmentEnds": true})).unwrap();
|
||||
assert_eq!(s.appearance_item(), None);
|
||||
s.cancel_interaction().unwrap();
|
||||
assert_eq!(s.appearance_item(), Some(0));
|
||||
s.execute("paint.setFill", &json!({"color": "#ff0000"})).unwrap();
|
||||
let after = &s.doc().unwrap().doc.node(a).unwrap().appearance.items;
|
||||
assert_ne!(after[0], before[0]);
|
||||
assert_eq!(&after[1..], &before[1..]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn whole_paths_keep_object_transforms_and_stroke_scaling() {
|
||||
let (mut s, a, _) = two();
|
||||
s.execute("select.set", &json!({"ids": [a.0]})).unwrap();
|
||||
s.execute("stroke.set", &json!({"weight": 4})).unwrap();
|
||||
let before = s.doc().unwrap().doc.node(a).unwrap().appearance.stroke_width();
|
||||
s.execute(C, &json!({})).unwrap();
|
||||
assert!(!s.doc().unwrap().selection.anchors.contains_key(&a));
|
||||
s.execute("object.transform", &json!({"matrix": [2, 0, 0, 2, 0, 0], "strokes": true})).unwrap();
|
||||
assert!(s.doc().unwrap().doc.node(a).unwrap().appearance.stroke_width() > before);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn groups_and_compound_paths_give_way_to_their_paths_and_other_objects_leave() {
|
||||
let (mut s, a, b) = two();
|
||||
let c = rect(&mut s, 200.0, 10.0, 20.0, 20.0);
|
||||
let hidden = rect(&mut s, 200.0, 100.0, 20.0, 20.0);
|
||||
let text = NodeId(s.execute("text.create", &json!({"x": 20, "y": 200, "text": "Points"})).unwrap()["id"].as_u64().unwrap());
|
||||
s.execute("select.set", &json!({"ids": [b.0, c.0, hidden.0, text.0]})).unwrap();
|
||||
let group = s.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap();
|
||||
s.execute("select.set", &json!({"ids": [hidden.0]})).unwrap();
|
||||
s.execute("object.hide", &json!({})).unwrap();
|
||||
let d = rect(&mut s, 20.0, 20.0, 10.0, 10.0);
|
||||
s.execute("select.set", &json!({"ids": [a.0, d.0]})).unwrap();
|
||||
s.execute("object.compoundPath.make", &json!({})).unwrap();
|
||||
let compound = s.doc().unwrap().selection.objects.clone();
|
||||
assert_eq!(compound.len(), 1);
|
||||
let members: Vec<NodeId> = s.doc().unwrap().doc.node(compound[0]).unwrap().children().unwrap().iter().map(|m| m.id).collect();
|
||||
assert_eq!(members.len(), 2);
|
||||
s.execute("select.set", &json!({"ids": [compound[0].0, group]})).unwrap();
|
||||
let r = s.execute(C, &json!({})).unwrap();
|
||||
assert_eq!(r, json!({"changed": true, "count": 4, "points": 16}), "{r}");
|
||||
let mut want = members;
|
||||
want.extend([b, c]);
|
||||
assert_eq!(picked(&s), (want, BTreeMap::new()), "the hidden path and the type are left out");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn guide_paths_in_a_group_are_left_out_while_guides_are_locked() {
|
||||
let (mut s, a, b) = two();
|
||||
s.execute("select.set", &json!({"ids": [b.0]})).unwrap();
|
||||
s.execute("view.guides.make", &json!({})).unwrap();
|
||||
let text = NodeId(s.execute("text.create", &json!({"x": 20, "y": 200, "text": "Points"})).unwrap()["id"].as_u64().unwrap());
|
||||
s.execute("select.set", &json!({"ids": [b.0, text.0]})).unwrap();
|
||||
let group = s.execute("object.group", &json!({})).unwrap()["id"].as_u64().unwrap();
|
||||
s.execute("view.guides.lock", &json!({"locked": true})).unwrap();
|
||||
s.execute("select.set", &json!({"ids": [group]})).unwrap();
|
||||
let before = s.doc().unwrap().selection.clone();
|
||||
let e = s.execute(C, &json!({})).unwrap_err().to_string();
|
||||
assert!(e.contains("no anchor points are selected"), "{e}");
|
||||
assert_eq!(s.doc().unwrap().selection, before);
|
||||
s.execute("select.set", &json!({"ids": [a.0, group]})).unwrap();
|
||||
assert_eq!(s.execute(C, &json!({})).unwrap(), json!({"changed": true, "count": 1, "points": 4}));
|
||||
assert_eq!(picked(&s), (vec![a], BTreeMap::new()));
|
||||
// Unlocked, the guide path is a path like any other.
|
||||
s.execute("view.guides.lock", &json!({"locked": false})).unwrap();
|
||||
s.execute("select.set", &json!({"ids": [group]})).unwrap();
|
||||
assert_eq!(s.execute(C, &json!({})).unwrap(), json!({"changed": true, "count": 1, "points": 4}));
|
||||
assert_eq!(picked(&s), (vec![b], BTreeMap::new()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn nothing_to_keep_is_an_error_that_leaves_the_selection() {
|
||||
let (mut s, a, b) = two();
|
||||
let text = NodeId(s.execute("text.create", &json!({"x": 20, "y": 200, "text": "Points"})).unwrap()["id"].as_u64().unwrap());
|
||||
s.execute("select.none", &json!({})).unwrap();
|
||||
assert!(s.execute(C, &json!({})).is_err(), "nothing selected");
|
||||
s.execute("select.segments", &json!({"id": a.0, "segments": [[0, 0]]})).unwrap();
|
||||
s.execute("select.add", &json!({"ids": [text.0]})).unwrap();
|
||||
let before = s.doc().unwrap().selection.clone();
|
||||
let e = s.execute(C, &json!({})).unwrap_err().to_string();
|
||||
assert!(e.contains("no anchor points are selected"), "{e}");
|
||||
assert_eq!(s.doc().unwrap().selection, before);
|
||||
for p in [
|
||||
json!({"segmentEnds": null}),
|
||||
json!({"segmentEnds": "yes"}),
|
||||
json!({"segmentEnds": 1}),
|
||||
json!({"segmentEnds": [true]}),
|
||||
json!({"segmentEnd": true}),
|
||||
] {
|
||||
s.execute("select.anchors", &json!({"id": b.0, "anchors": [[0, 0]]})).unwrap();
|
||||
s.execute("select.segments", &json!({"id": a.0, "segments": [[0, 0]], "mode": "add"})).unwrap();
|
||||
let before = s.doc().unwrap().selection.clone();
|
||||
assert!(s.execute(C, &p).is_err(), "{p}");
|
||||
assert_eq!(s.doc().unwrap().selection, before, "{p}");
|
||||
}
|
||||
assert!(Session::new().execute(C, &Value::Null).is_err(), "without a document");
|
||||
}
|
||||
}
|
||||
@@ -139,7 +139,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Select Appearance Item",
|
||||
[],
|
||||
None,
|
||||
"{index: paint-order item index in the first selected object's stack | null} make that fill/stroke row the target of the paint.setFill/setStroke, stroke.set/setAdvanced, paint.editGradient/setGradientGeom, transparency.set and effect.* calls that omit `item` (a fill row brings the Fill proxy forward, a stroke row the Stroke proxy); null or any selection change clears it → {index}",
|
||||
"{index: paint-order item index in the first selected object's stack | null} make that fill/stroke row the target of the paint.setFill/setStroke, stroke.set/setAdvanced, paint.editGradient/setGradientGeom, transparency.set and effect.* calls that omit `item` (a fill row brings the Fill proxy forward, a stroke row the Stroke proxy); null or any selection change clears it. A row set or cleared outside a drag's preview stays set or cleared when the preview is replaced or canceled → {index}",
|
||||
has_selection,
|
||||
set_active_item
|
||||
),
|
||||
@@ -174,7 +174,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
}
|
||||
|
||||
/// The Appearance panel's active row, remembered for the selection it was chosen in.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub(crate) struct ActiveItem {
|
||||
doc: u64,
|
||||
objects: Vec<NodeId>,
|
||||
@@ -956,6 +956,7 @@ fn set_active_item(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let index = match p.get("index") {
|
||||
Some(Value::Null) => {
|
||||
s.active_appearance_item = None;
|
||||
clear_preview_item(s);
|
||||
return Ok(json!({ "index": Value::Null }));
|
||||
}
|
||||
Some(_) => index_param(p, "index", C)?,
|
||||
@@ -968,9 +969,21 @@ fn set_active_item(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let doc = st.uid;
|
||||
s.fill_active = fill;
|
||||
s.active_appearance_item = Some(ActiveItem { doc, objects, index });
|
||||
clear_preview_item(s);
|
||||
Ok(json!({ "index": index }))
|
||||
}
|
||||
|
||||
fn clear_preview_item(s: &mut Session) {
|
||||
if !s.previewing {
|
||||
if let Some(it) = s.active_mut().and_then(|st| st.interaction.as_mut()) {
|
||||
it.active_appearance_item = None;
|
||||
}
|
||||
if let Some(held) = &mut s.held_interaction {
|
||||
held.interaction.active_appearance_item = None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn add_item(s: &mut Session, p: &Value, fill: bool) -> Result<Value> {
|
||||
let cmd = if fill { "appearance.addFill" } else { "appearance.addStroke" };
|
||||
let mut ids = row_targets(s, p, cmd)?;
|
||||
|
||||
@@ -43,7 +43,7 @@ use std::sync::OnceLock;
|
||||
use serde_json::Value;
|
||||
use vectorcraft_apischema::shown_key;
|
||||
|
||||
use super::{bad, command_specs, find_command};
|
||||
use super::{bad, color_is_finite, command_specs, find_command};
|
||||
use crate::Result;
|
||||
|
||||
/// What a params description says about the keys of the params object.
|
||||
@@ -608,16 +608,16 @@ pub(crate) fn undefaulted_type(effect: &str, key: &str) -> Option<Value> {
|
||||
|
||||
/// Can an effect read `v` as its `color`: a string [`Color::from_hex`] reads (`#rrggbb`, `#rgb`,
|
||||
/// `#rrggbbaa`, black, white, red, green, blue), `[r, g, b]` whose first three entries are numbers
|
||||
/// (read on a 0..1 scale) or a color object (`{"model": "rgb", "r": …}`)? The effect draws its
|
||||
/// default color for any other value, except that an array of three or more entries draws an
|
||||
/// entry that isn't a number as 0.
|
||||
/// (read on a 0..1 scale) or a color object (`{"model": "rgb", "r": …}`), with no component too
|
||||
/// large to store ([`color_is_finite`])? The effect draws its default color for any other value,
|
||||
/// except that an array of three or more entries draws an entry that isn't a number as 0.
|
||||
///
|
||||
/// [`Color::from_hex`]: vectorcraft_color::Color::from_hex
|
||||
fn is_effect_color(v: &Value) -> bool {
|
||||
match v {
|
||||
Value::String(s) => vectorcraft_color::Color::from_hex(s).is_some(),
|
||||
Value::Array(a) => a.len() >= 3 && a.iter().take(3).all(Value::is_number),
|
||||
Value::Object(_) => serde_json::from_value::<vectorcraft_color::Color>(v.clone()).is_ok(),
|
||||
Value::Array(a) => a.len() >= 3 && a.iter().take(3).all(|n| n.as_f64().is_some_and(|n| (n as f32).is_finite())),
|
||||
Value::Object(_) => serde_json::from_value::<vectorcraft_color::Color>(v.clone()).is_ok_and(|c| color_is_finite(&c)),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ pub(super) const ALLOWED: &[&str] = &[
|
||||
"addon.pen.segment",
|
||||
"addon.pen.togglePoint",
|
||||
"addon.select.byArtboards",
|
||||
"addon.select.editPointsOnly",
|
||||
"addon.shapes.box3d",
|
||||
"addon.shapes.configure",
|
||||
"addon.shapes.ellipse",
|
||||
|
||||
@@ -122,8 +122,8 @@ const WAIT_FOR_TOOL_EDIT: &[&str] = &[
|
||||
/// Does command `id`, run on its own, first apply the edit the active tool is computing on
|
||||
/// another thread and the input held for it ([`Session::finish_tool_edit`])? Every command that
|
||||
/// can edit, select, save or give a document a new revision does; queries that only read do not
|
||||
/// (`commands_that_do_not_wait_for_a_tool_edit_change_no_document` in the command sweep checks
|
||||
/// them). A frontend that adds params from
|
||||
/// (`every_command_with_junk_params` and `commands_that_do_not_wait_for_a_tool_edit_change_no_document`
|
||||
/// in the command sweep check them). A frontend that adds params from
|
||||
/// its own state (the active artboard) applies them first itself.
|
||||
pub fn waits_for_tool_edit(id: &str) -> bool {
|
||||
find_command(id).is_some_and(|spec| spec.journal || WAIT_FOR_TOOL_EDIT.contains(&id))
|
||||
|
||||
@@ -10,6 +10,7 @@ pub struct Interaction {
|
||||
pub doc: Arc<Document>,
|
||||
/// The selection the previews start from (shared, so a preview frame copies nothing).
|
||||
pub selection: Arc<Selection>,
|
||||
pub(crate) active_appearance_item: Option<PreviewAppearanceItem>,
|
||||
/// The document's [`crate::DocState::revision`] when the interaction began. The previews change the document's
|
||||
/// revision, and this value stays the same until the interaction ends.
|
||||
pub revision: u64,
|
||||
@@ -62,6 +63,12 @@ impl Interaction {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub(crate) struct PreviewAppearanceItem {
|
||||
pub(crate) before: Option<crate::cmd::appearance::ActiveItem>,
|
||||
pub(crate) after: Option<crate::cmd::appearance::ActiveItem>,
|
||||
}
|
||||
|
||||
/// An interaction that a command from outside the tool set aside while it runs
|
||||
/// ([`crate::Session::outside_interaction`]).
|
||||
#[derive(Debug)]
|
||||
|
||||
@@ -545,6 +545,7 @@ impl Session {
|
||||
effect: None,
|
||||
doc: st.doc.clone(),
|
||||
selection: Arc::new(st.selection.clone()),
|
||||
active_appearance_item: None,
|
||||
revision: st.revision,
|
||||
preview: None,
|
||||
tool: false,
|
||||
@@ -573,6 +574,8 @@ impl Session {
|
||||
if self.script_running() {
|
||||
return Err(EngineError::Busy);
|
||||
}
|
||||
self.restore_preview_appearance_item();
|
||||
let before_item = self.active_appearance_item.clone();
|
||||
// While the active tool paints with the chosen fill or stroke (the Live Paint Bucket, the
|
||||
// Shape Builder), paint previews of that kind change only the colors it paints with, so each
|
||||
// preview starts from the colors the interaction began with; so does a preview with
|
||||
@@ -639,8 +642,11 @@ impl Session {
|
||||
}
|
||||
let params = self.noted(params);
|
||||
let batch_paint = (r.is_ok() && cmd == "command.batch").then(|| self.paint.clone());
|
||||
let after_item = self.active_appearance_item.clone();
|
||||
let st = self.doc_mut()?;
|
||||
if let Some(it) = &mut st.interaction {
|
||||
it.active_appearance_item =
|
||||
(before_item != after_item).then_some(crate::interaction::PreviewAppearanceItem { before: before_item, after: after_item });
|
||||
it.used_defaults_only |= ran_defaults_only;
|
||||
// A failed preview leaves the document at the snapshot, so nothing is left to commit
|
||||
// (not even an earlier successful preview, which the reset above already undid).
|
||||
@@ -758,8 +764,18 @@ impl Session {
|
||||
}
|
||||
}
|
||||
|
||||
fn restore_preview_appearance_item(&mut self) {
|
||||
let changed = self.active_mut().and_then(|st| st.interaction.as_mut()).and_then(|it| it.active_appearance_item.take());
|
||||
if let Some(changed) = changed
|
||||
&& self.active_appearance_item == changed.after
|
||||
{
|
||||
self.active_appearance_item = changed.before;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn cancel_interaction(&mut self) -> Result<()> {
|
||||
self.put_back_interaction();
|
||||
self.restore_preview_appearance_item();
|
||||
self.clear_deferred_overlay_cache();
|
||||
self.decoded_images.empty();
|
||||
self.pending_paint = None;
|
||||
|
||||
@@ -266,6 +266,52 @@ fn a_color_with_an_alpha_part_is_refused() {
|
||||
s.execute("object.rasterize", &json!({"ppi": 72, "background": "#ff0000"})).unwrap();
|
||||
}
|
||||
|
||||
/// A color param with a component too large to store (past `f32::MAX`, which would be stored as an
|
||||
/// infinity) is refused and changes nothing, in every form a color is given in: CMYK, `[r, g, b]`,
|
||||
/// Gray, Lab and a color object. The ends of each range still set the color.
|
||||
#[test]
|
||||
fn a_color_with_a_component_too_large_to_store_is_refused() {
|
||||
let mut s = session();
|
||||
let id = rect(&mut s);
|
||||
s.execute("select.set", &json!({"ids": [id.0]})).unwrap();
|
||||
let before = s.doc().unwrap().doc.clone();
|
||||
let undo = s.doc().unwrap().history.undo.len();
|
||||
for bad in [
|
||||
json!({"c": f64::MAX, "m": 0, "y": 0, "k": 0}),
|
||||
json!({"c": 0, "m": 0, "y": 0, "k": 1e308}),
|
||||
json!([1e300, 0, 0]),
|
||||
json!([0, 0, -1e300]),
|
||||
json!({"gray": 1e300}),
|
||||
json!({"l": 1e300, "a": 0, "b": 0}),
|
||||
json!({"l": 50, "a": 0, "b": -1e300}),
|
||||
json!({"model": "rgb", "r": 1e300, "g": 0, "b": 0}),
|
||||
json!({"model": "cmyk", "c": 0, "m": 1e300, "y": 0, "k": 0}),
|
||||
] {
|
||||
for (cmd, p) in [
|
||||
("artboard.setProps", json!({"index": 0, "color": bad})),
|
||||
("artboard.new", json!({"color": bad})),
|
||||
("paint.setFill", json!({"ids": [id.0], "color": bad})),
|
||||
("paint.setStroke", json!({"ids": [id.0], "color": bad})),
|
||||
("swatch.new", json!({"name": "Far", "color": bad})),
|
||||
("swatch.new", json!({"colors": ["#00ff00", bad]})),
|
||||
("text.create", json!({"x": 10, "y": 10, "text": "a", "color": bad})),
|
||||
] {
|
||||
assert!(s.execute(cmd, &p).is_err(), "{cmd} {p}");
|
||||
}
|
||||
}
|
||||
assert_eq!(*s.doc().unwrap().doc, *before, "a color too large to store changes nothing");
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), undo, "and records no undo step");
|
||||
let fill = |s: &Session| node(s, id).appearance.fill_paint().color();
|
||||
s.execute("paint.setFill", &json!({"ids": [id.0], "color": {"c": 100, "m": 0, "y": 0, "k": 0}})).unwrap();
|
||||
assert_eq!(fill(&s), Some(Color::cmyk(1.0, 0.0, 0.0, 0.0)));
|
||||
s.execute("paint.setFill", &json!({"ids": [id.0], "color": [1, 0, 0]})).unwrap();
|
||||
assert_eq!(fill(&s).map(|c| c.to_hex()).as_deref(), Some("#ff0000"));
|
||||
s.execute("paint.setFill", &json!({"ids": [id.0], "color": {"gray": 100}})).unwrap();
|
||||
assert_eq!(fill(&s), Some(Color::gray(1.0)));
|
||||
s.execute("paint.setFill", &json!({"ids": [id.0], "color": {"l": 100, "a": -128, "b": 127}})).unwrap();
|
||||
assert_eq!(fill(&s), Some(Color::lab(100.0, -128.0, 127.0)));
|
||||
}
|
||||
|
||||
/// The native format writes an artboard's background color and reads it back. An artboard without
|
||||
/// one is written as before, with no `color` key.
|
||||
#[test]
|
||||
|
||||
@@ -30,17 +30,27 @@ fn no_panic(r: Result<Value, vectorcraft_engine::EngineError>) -> Result<Value,
|
||||
|
||||
/// Run one call; returns a failure description or None.
|
||||
fn probe(fx: Fixture, id: &str, params: &Value) -> Option<String> {
|
||||
probe_and_compare(fx, id, params, false).0
|
||||
}
|
||||
|
||||
/// Run one call as [`probe`] does, returning its failure description, and with `compare`, also
|
||||
/// `id params [fixture]` when the call changed the session's [`tool_edit_state`], panic or not.
|
||||
fn probe_and_compare(fx: Fixture, id: &str, params: &Value, compare: bool) -> (Option<String>, Option<String>) {
|
||||
let mut s = fx.session();
|
||||
let before = compare.then(|| tool_edit_state(&s));
|
||||
let r = catch_quiet(|| no_panic(s.execute(id, params)));
|
||||
match r {
|
||||
let changed = before.filter(|b| tool_edit_state(&s) != *b).map(|_| format!("{id} {params} [{fx:?}]"));
|
||||
let failure = match r {
|
||||
Err(msg) => Some(format!("PANIC {id} {params} [{fx:?}]: {msg}")),
|
||||
Ok(_) => {
|
||||
if s.in_interaction() {
|
||||
return Some(format!("{id} {params} [{fx:?}]: left an interaction open"));
|
||||
Some(format!("{id} {params} [{fx:?}]: left an interaction open"))
|
||||
} else {
|
||||
check_session(&s).err().map(|e| format!("{id} {params} [{fx:?}]: {e}"))
|
||||
}
|
||||
check_session(&s).err().map(|e| format!("{id} {params} [{fx:?}]: {e}"))
|
||||
}
|
||||
}
|
||||
};
|
||||
(failure, changed)
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -223,31 +233,43 @@ fn junk_cases(c: &vectorcraft_engine::CommandSpec, path: &str) -> Vec<Value> {
|
||||
cases
|
||||
}
|
||||
|
||||
/// Every command with every junk case in every fixture: no panic, no interaction left open and no
|
||||
/// broken invariant ([`probe`]). In `Single` and `Multi`, every command that runs at once while the
|
||||
/// active tool computes an edit on another thread (it does not `waits_for_tool_edit`) also leaves
|
||||
/// the documents' revisions and selections, the active document and the current paint as they were
|
||||
/// ([`tool_edit_state`]), as `commands_that_do_not_wait_for_a_tool_edit_change_no_document` checks
|
||||
/// for the cases that turn each option on and off.
|
||||
#[test]
|
||||
fn every_command_with_junk_params() {
|
||||
let dir = vectorcraft_testkit::TempDir::new("sweep");
|
||||
let path = safe_path(&dir);
|
||||
let mut failures = vec![];
|
||||
let mut changed = vec![];
|
||||
let mut calls = 0usize;
|
||||
for fx in Fixture::ALL {
|
||||
for c in command_specs() {
|
||||
let compare = matches!(fx, Fixture::Single | Fixture::Multi) && !vectorcraft_engine::waits_for_tool_edit(c.id);
|
||||
let cases = junk_cases(c, &path);
|
||||
for p in &cases {
|
||||
calls += 1;
|
||||
if let Some(f) = probe(fx, c.id, p) {
|
||||
failures.push(f);
|
||||
}
|
||||
let (failure, change) = probe_and_compare(fx, c.id, p, compare);
|
||||
failures.extend(failure);
|
||||
changed.extend(change);
|
||||
}
|
||||
}
|
||||
}
|
||||
assert!(calls > 5_000, "only {calls} calls");
|
||||
failures.sort();
|
||||
failures.dedup();
|
||||
changed.sort();
|
||||
changed.dedup_by(|a, b| a.split(' ').next() == b.split(' ').next());
|
||||
assert!(
|
||||
failures.is_empty(),
|
||||
"{} failures (of {calls} calls):\n{}",
|
||||
failures.is_empty() && changed.is_empty(),
|
||||
"{} failures (of {calls} calls):\n{}\n{} commands change a document without waiting for a tool edit:\n{}",
|
||||
failures.len(),
|
||||
failures.iter().take(60).cloned().collect::<Vec<_>>().join("\n")
|
||||
failures.iter().take(60).cloned().collect::<Vec<_>>().join("\n"),
|
||||
changed.len(),
|
||||
changed.join("\n")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -262,10 +284,11 @@ fn tool_edit_state(s: &Session) -> ToolEditState {
|
||||
(docs, s.active_index(), s.paint.clone())
|
||||
}
|
||||
|
||||
/// The params the tool-edit sweep sends `c`: junk params, then each documented key turned on and
|
||||
/// off, with a string under a file or folder key replaced by a location inside `path`'s folder.
|
||||
fn tool_edit_cases(c: &vectorcraft_engine::CommandSpec, path: &str) -> Vec<Value> {
|
||||
let mut cases = junk_cases(c, path);
|
||||
/// The params the tool-edit sweep sends `c` beyond its junk cases, which the junk sweep checks:
|
||||
/// each documented key turned on and off, with a string under a file or folder key replaced by a
|
||||
/// location inside `path`'s folder.
|
||||
fn option_cases(c: &vectorcraft_engine::CommandSpec, path: &str) -> Vec<Value> {
|
||||
let mut cases = vec![];
|
||||
for k in command_param_keys(c) {
|
||||
for v in [json!(true), json!(false), json!(1), json!("on")] {
|
||||
cases.push(json!({ k.as_str(): safe_value_for_command(c, &k, &v, path) }));
|
||||
@@ -333,7 +356,7 @@ fn sweep_cases_name_files_only_inside_the_temp_folder() {
|
||||
}
|
||||
}
|
||||
let mut cases = junk_params_for_command(c, &path);
|
||||
cases.extend(tool_edit_cases(c, &path));
|
||||
cases.extend(option_cases(c, &path));
|
||||
cases.extend(serializable_cases(c, &path));
|
||||
for p in &cases {
|
||||
let Some(o) = p.as_object() else { continue };
|
||||
@@ -485,8 +508,9 @@ fn sweep_cases_send_the_file_keys_of_the_command_catalog() {
|
||||
/// Every command that runs at once while the active tool computes an edit on another thread (a
|
||||
/// Shape Builder merge), rather than applying the edit first (`waits_for_tool_edit`), leaves the
|
||||
/// documents' revisions and selections, the active document and the current paint as they were,
|
||||
/// with `{}`, junk params and params that turn its options on and off: the edit, computed for the
|
||||
/// document as it was, still applies after it.
|
||||
/// with params that turn its options on and off ([`option_cases`]; `every_command_with_junk_params`
|
||||
/// checks the same with the junk cases): the edit, computed for the document as it was, still
|
||||
/// applies after it.
|
||||
#[test]
|
||||
fn commands_that_do_not_wait_for_a_tool_edit_change_no_document() {
|
||||
let dir = vectorcraft_testkit::TempDir::new("sweep");
|
||||
@@ -494,7 +518,7 @@ fn commands_that_do_not_wait_for_a_tool_edit_change_no_document() {
|
||||
let mut failures = vec![];
|
||||
for fx in [Fixture::Single, Fixture::Multi] {
|
||||
for c in command_specs().iter().filter(|c| !vectorcraft_engine::waits_for_tool_edit(c.id)) {
|
||||
let cases = tool_edit_cases(c, &path);
|
||||
let cases = option_cases(c, &path);
|
||||
for p in &cases {
|
||||
let mut s = fx.session();
|
||||
let before = tool_edit_state(&s);
|
||||
@@ -538,6 +562,8 @@ fn structured_junk() {
|
||||
("addon.select.byLinkStatus", json!({"status": "embedded", "ids": {"a": 1}, "add": [1], "zoom": "yes"})),
|
||||
("addon.select.byLinkStatus", json!({"status": ["modified", "embedded"], "ids": [], "add": true, "zoom": true})),
|
||||
("addon.select.byLinkStatus", json!({"status": [[["linked"]]], "ids": null})),
|
||||
("addon.select.editPointsOnly", json!({"segmentEnds": "yes"})),
|
||||
("addon.select.editPointsOnly", json!({"segmentEnds": [true], "ids": [2, u64::MAX]})),
|
||||
("links.relink", json!({"scope": "each", "paths": [{"ids": [2, u64::MAX, -1, "x"], "path": ""}, null, 7, {"path": [1]}]})),
|
||||
("links.relink", json!({"scope": ["all"], "path": "/no/such/file.png", "ids": {"a": 1}})),
|
||||
("links.relink", json!({"scope": "missingInFolder", "path": "", "folder": [], "paths": "x"})),
|
||||
|
||||
@@ -170,7 +170,8 @@ fn effect_params_no_longer_taken_still_replay_and_open() {
|
||||
}
|
||||
|
||||
/// An effect's `color` that the effect can't read (a string `Color::from_hex` doesn't read, an
|
||||
/// `[r, g, b]` without three numbers, an object that isn't a color, `null`) is refused by
|
||||
/// `[r, g, b]` without three numbers, an object that isn't a color, `null`, a color with a component
|
||||
/// too large to store) is refused by
|
||||
/// `effect.apply`, `appearance.addEffect` and `effect.setParams` themselves, not only by the check,
|
||||
/// and the document and its undo history stay as they were. The forms the effect reads pass. A
|
||||
/// document saved with an unreadable color still opens with it.
|
||||
@@ -186,7 +187,16 @@ fn an_effect_color_it_cannot_draw_is_refused() {
|
||||
};
|
||||
let before = state(&s);
|
||||
let why = "`color` must be a #rrggbb color";
|
||||
for bad in [json!("not-a-color"), json!("#ff00"), json!([1, 0]), json!(["#ff0000", 0, 0]), json!({"gray": 50}), json!(null)] {
|
||||
for bad in [
|
||||
json!("not-a-color"),
|
||||
json!("#ff00"),
|
||||
json!([1, 0]),
|
||||
json!(["#ff0000", 0, 0]),
|
||||
json!({"gray": 50}),
|
||||
json!(null),
|
||||
json!([1e300, 0, 0]),
|
||||
json!({"model": "rgb", "r": 0, "g": 1e300, "b": 0}),
|
||||
] {
|
||||
for (cmd, params) in [
|
||||
("effect.setParams", json!({"index": 0, "params": {"color": bad}})),
|
||||
("effect.apply", json!({"effect": "stylize.outerGlow", "params": {"color": bad}})),
|
||||
|
||||
@@ -533,7 +533,8 @@ fn seams_against_supersampled(d: &Document, image: &vectorcraft_render::Rendered
|
||||
/// opacity once over the surface. Inflate seen straight on, one layer of facets, has no alpha off, and
|
||||
/// in opaque fills no RGB channel more than 3 levels off. Inflate turned so facets narrow to slivers
|
||||
/// at the edges, and Revolve with a cap over its body, draw facets over other facets, and have no
|
||||
/// alpha off.
|
||||
/// alpha off. In the turned Inflate's opaque solid fill, each facet and its seam cover an edge pixel
|
||||
/// once together, so at most one RGB channel is more than 3 levels off, by no more than 4.
|
||||
#[test]
|
||||
fn colored_light_surfaces_match_supersampling_at_internal_facet_edges() {
|
||||
let lights = json!([
|
||||
@@ -556,20 +557,21 @@ fn colored_light_surfaces_match_supersampling_at_internal_facet_edges() {
|
||||
let (mut s, _) = setup("threeD.inflate");
|
||||
let change = json!({"index":0,"item":null,"params":{"ambient":10,"lights":lights,"rotationX":rotation.0,"rotationY":rotation.1}});
|
||||
s.execute("effect.setParams", &change).unwrap();
|
||||
cases.push((format!("inflate {rotation:?}"), s, fills([100, 150], [200, 150]), rotation == (0, 0)));
|
||||
cases.push((format!("inflate {rotation:?}"), s, fills([100, 150], [200, 150]), rotation == (0, 0), rotation == (50, 35)));
|
||||
}
|
||||
let (mut s, _) = capped_profile();
|
||||
s.execute("effect.setParams", &json!({"index":0,"item":null,"params":{"ambient":10,"lights":lights}})).unwrap();
|
||||
cases.push(("revolve".into(), s, fills([80, 200], [240, 200]), false));
|
||||
cases.push(("revolve".into(), s, fills([80, 200], [240, 200]), false, false));
|
||||
let mut failures = vec![];
|
||||
for (name, mut s, fills, one_layer) in cases {
|
||||
for (name, mut s, fills, one_layer, turned) in cases {
|
||||
for fill in fills {
|
||||
s.execute("paint.setFill", &fill).unwrap();
|
||||
let image = render(doc(&s));
|
||||
let (measured, color, max, holes, worst) = seams_against_supersampled(doc(&s), &image);
|
||||
assert!(measured > 2_000, "{name} {fill}: {measured} pixels inside");
|
||||
let opaque = !fill.to_string().contains("opacity");
|
||||
if holes > 0 || (one_layer && opaque && color > 0) {
|
||||
let edges_once = turned && fill.get("color").is_some();
|
||||
if holes > 0 || (one_layer && opaque && color > 0) || (edges_once && (color > 1 || max > 4)) {
|
||||
failures.push(format!(
|
||||
"{name} {fill}: of {measured} pixels, {color} channels off by more than 3 (at most {max}), {holes} alphas off: {worst:?}"
|
||||
));
|
||||
@@ -579,29 +581,6 @@ fn colored_light_surfaces_match_supersampling_at_internal_facet_edges() {
|
||||
assert!(failures.is_empty(), "{failures:#?}");
|
||||
}
|
||||
|
||||
/// Inflate turned so its facets narrow to slivers at the edges, in an opaque solid fill under two
|
||||
/// colored lights, against 3x averaged down ([`seams_against_supersampled`]): each facet and its
|
||||
/// seam cover an edge pixel once together, so at most one RGB channel is more than 3 levels off, by
|
||||
/// no more than 4, and no alpha is off.
|
||||
#[test]
|
||||
fn turned_colored_inflate_facets_and_seams_cover_their_edges_once() {
|
||||
let lights = json!([
|
||||
{"color":"#ff0000","rotation":135,"height":35,"intensity":70},
|
||||
{"color":"#0000ff","rotation":-35,"height":25,"intensity":65}
|
||||
]);
|
||||
let (mut s, _) = setup("threeD.inflate");
|
||||
let change = json!({"index":0,"item":null,"params":{"ambient":10,"lights":lights,"rotationX":50,"rotationY":35}});
|
||||
s.execute("effect.setParams", &change).unwrap();
|
||||
s.execute("paint.setFill", &json!({"color":"#ffcc66"})).unwrap();
|
||||
let image = render(doc(&s));
|
||||
let (measured, color, max, holes, worst) = seams_against_supersampled(doc(&s), &image);
|
||||
assert!(measured > 2_000, "{measured} pixels inside");
|
||||
assert!(
|
||||
holes == 0 && color <= 1 && max <= 4,
|
||||
"of {measured} pixels, {color} channels off by more than 3 (at most {max}), {holes} alphas off: {worst:?}"
|
||||
);
|
||||
}
|
||||
|
||||
/// The closed facet edges of colored-light surfaces survive SVG and PDF, read back and drawn at
|
||||
/// 1:1, and Expand Appearance: inside the art, every pixel stays opaque and within 6 levels of the
|
||||
/// live art.
|
||||
|
||||
@@ -33,3 +33,7 @@ craft-image-codecs = { workspace = true }
|
||||
vectorcraft-testkit = { workspace = true }
|
||||
proptest = { workspace = true }
|
||||
socket2 = { workspace = true }
|
||||
|
||||
# The files of other crates that this crate's tests compile, for CI's test selection.
|
||||
[package.metadata.craft]
|
||||
reads = ["crates/apischema/src/conformance.rs"]
|
||||
@@ -246,8 +246,13 @@ impl<'a> Device<'a> for Builder<'_> {
|
||||
// replaces DeviceCMYK, so it is cached apart from the same image drawn where one does.
|
||||
let intent = !white && self.intent_cmyk.is_some() && self.scan.cmyk_defaults.get(&r.stream().dict().obj_id()) == Some(&false);
|
||||
// Inside an alpha mask the same image is read again, white (its own cache key).
|
||||
let key = craft::pdf::interpret::CacheKey::cache_key(&r) ^ if white { WHITE_KEY } else { 0 } ^ if intent { INTENT_KEY } else { 0 };
|
||||
let st = r.stream();
|
||||
// An inline image (no object of its own) is keyed by its samples too: the
|
||||
// interpreter keys an image by its dictionary, the same for inline images of one
|
||||
// size and encoding (#9247).
|
||||
let inline = if st.dict().obj_id().is_none() { crate::import_scan::hash128(&*st.raw_data()) } else { 0 };
|
||||
let key =
|
||||
craft::pdf::interpret::CacheKey::cache_key(&r) ^ inline ^ if white { WHITE_KEY } else { 0 } ^ if intent { INTENT_KEY } else { 0 };
|
||||
let (w, h) = (r.width(), r.height());
|
||||
// CMYK images keep their samples (read once per image).
|
||||
let known = !white && self.cmyk_keys.contains(&key);
|
||||
@@ -370,6 +375,9 @@ impl<'a> Device<'a> for Builder<'_> {
|
||||
None,
|
||||
);
|
||||
let Some((px, w, h, sf)) = decoded else { return };
|
||||
// Keyed by its pixels too, as an inline raster image is by its samples: a stencil
|
||||
// doesn't show its stream, and inline ones of one size share a dictionary (#9247).
|
||||
let key = key ^ crate::import_scan::hash128(&px);
|
||||
let xf = transform * Affine::scale_non_uniform(sf.0 as f64, sf.1 as f64);
|
||||
match colorize {
|
||||
// Its own key: its pixels are the gray ones, whatever color paints it.
|
||||
|
||||
@@ -507,6 +507,39 @@ fn a_form_drawn_many_times_reads_its_font_resources_once() {
|
||||
assert_eq!(walk.fonts.len(), 1);
|
||||
}
|
||||
|
||||
/// Inline images with the same dictionary but other samples come in with their own pixels: the
|
||||
/// stencil glyphs of a Type 3 font (#9247) and raster images on the page.
|
||||
#[test]
|
||||
fn inline_images_with_the_same_dictionary_keep_their_own_pixels() {
|
||||
let n = first_extra(1);
|
||||
let glyph = |hex: &str| {
|
||||
stream("", &format!("1000 0 0 0 1000 1000 d1 q 1000 0 0 1000 0 0 cm BI /IM true /W 8 /H 8 /BPC 1 /D [1 0] /F /AHx ID\n{hex}>\nEI Q"))
|
||||
};
|
||||
let objects = [
|
||||
format!(
|
||||
"<< /Type /Font /Subtype /Type3 /FontBBox [0 0 1000 1000] /FontMatrix [0.001 0 0 0.001 0 0] /CharProcs << /a {} 0 R /b {} 0 R >> /Encoding << /Type /Encoding /Differences [97 /a /b] >> /FirstChar 97 /LastChar 98 /Widths [1000 1000] /Resources << >> >>",
|
||||
n + 1,
|
||||
n + 2
|
||||
),
|
||||
glyph("1818181818181818"),
|
||||
glyph("000000FFFF000000"),
|
||||
];
|
||||
let raster = |hex: &str| format!("q 10 0 0 10 0 0 cm BI /W 2 /H 1 /CS /RGB /BPC 8 /F /AHx ID\n{hex}>\nEI Q ");
|
||||
let content = format!("BT /T3 24 Tf 10 30 Td (ab) Tj ET {}{}", raster("FF000000FF00"), raster("0000FFFFFFFF"));
|
||||
let extra: Vec<&str> = objects.iter().map(String::as_str).collect();
|
||||
let d = open(&one_page(&content, &format!("/Font << /T3 {n} 0 R >>"), &extra));
|
||||
let blobs: Vec<Arc<Vec<u8>>> = all(&d)
|
||||
.iter()
|
||||
.filter_map(|n| match &n.kind {
|
||||
NodeKind::Image(im) => Some(d.images[&im.key].bytes.clone()),
|
||||
_ => None,
|
||||
})
|
||||
.collect();
|
||||
assert_eq!(blobs.len(), 4, "two glyphs and two raster images");
|
||||
let distinct: std::collections::HashSet<&Arc<Vec<u8>>> = blobs.iter().collect();
|
||||
assert_eq!(distinct.len(), blobs.len(), "each image has its own pixels");
|
||||
}
|
||||
|
||||
/// A Type 3 font that every page lists in a font dictionary of its own, and a form lists in its
|
||||
/// resources, has its glyph procedures read once for the document. Each page still maps the font's
|
||||
/// glyphs, and the font whose glyphs set their own color (`d0`) is told from the one whose glyphs
|
||||
|
||||
@@ -44,3 +44,7 @@ vectorcraft-plugins = { path = ".", features = ["test-steady"] }
|
||||
[features]
|
||||
# `vectorcraft_plugins::steady` for other crates' tests (dev-dependencies only).
|
||||
test-steady = []
|
||||
|
||||
# For CI's test selection: `tests/grant_sites.rs` reads the sources of every crate.
|
||||
[package.metadata.craft]
|
||||
reads-every-member = true
|
||||
@@ -110,3 +110,7 @@ wat = { workspace = true }
|
||||
[build-dependencies]
|
||||
serde_json = { workspace = true }
|
||||
toml = "1"
|
||||
|
||||
# The files of other crates that this crate's tests read, for CI's test selection.
|
||||
[package.metadata.craft]
|
||||
reads = ["crates/engine/src/cmd/addons/cutting/banner.rs", "crates/plugins/tests/fixtures/desaturate.wasm"]
|
||||
@@ -34,6 +34,7 @@ pub(crate) struct Spec {
|
||||
pub(crate) struct AddonDialogs {
|
||||
open: Option<Open>,
|
||||
preview: LivePreview,
|
||||
preview_error: Option<(u64, String)>,
|
||||
/// The open Tangent Circle Tool radius dialog.
|
||||
pub(crate) tangent_radius: Option<super::pathtools::tangent_circle_radius::Open>,
|
||||
}
|
||||
@@ -65,6 +66,7 @@ fn active_document(app: &VectorcraftApp) -> Option<(u64, u64)> {
|
||||
/// Closes the open add-on dialog without an answer and rolls its preview back.
|
||||
fn close_open(app: &mut VectorcraftApp) {
|
||||
let Some(open) = app.addon_dialogs.open.take() else { return };
|
||||
app.addon_dialogs.preview_error = None;
|
||||
let id = open.id;
|
||||
if let (Some(host), Some(ctx)) = (app.dialogs(), app.ui_ctx.clone()) {
|
||||
host.with(|h| {
|
||||
@@ -108,6 +110,7 @@ pub(crate) fn open_from_menu(app: &mut VectorcraftApp, id: &str) -> Option<Resul
|
||||
color::legend::COMMAND => color::legend::open,
|
||||
color::nearest::COMMAND => color::nearest::open,
|
||||
select::COMMAND => select::open,
|
||||
select::points_only::COMMAND => select::points_only::open,
|
||||
_ => return super::arrange::open(app, id),
|
||||
};
|
||||
Some(open(app))
|
||||
@@ -132,6 +135,7 @@ fn pump_commit(app: &mut VectorcraftApp) {
|
||||
if !on_document {
|
||||
// Switching drawings already ends the old preview. Discard its bookkeeping without touching the other drawing.
|
||||
app.addon_dialogs.preview = LivePreview::default();
|
||||
app.addon_dialogs.preview_error = None;
|
||||
}
|
||||
let live = host.with(|h| h.get_mut_by_id::<HostedParamDialog>(id).map(|d| (d.is_previewing(), (spec.params)(d.fields()))));
|
||||
if on_document && let Some((previewing, params)) = &live {
|
||||
@@ -139,6 +143,13 @@ fn pump_commit(app: &mut VectorcraftApp) {
|
||||
let label = vectorcraft_engine::find_command(spec.command).map_or(spec.command, |command| command.label);
|
||||
let answer = preview.run(app, *previewing, label, spec.command, params);
|
||||
app.addon_dialogs.preview = preview;
|
||||
if spec.command == super::select::points_only::COMMAND {
|
||||
match &answer {
|
||||
Some(Err(_)) => app.addon_dialogs.preview_error = Some((app.ui.status_sets, app.ui.status.clone())),
|
||||
Some(Ok(_)) => clear_preview_error(app),
|
||||
None => {}
|
||||
}
|
||||
}
|
||||
if let (Some(found), Some(answer)) = (spec.found, answer) {
|
||||
host.with(|h| {
|
||||
if let Some(d) = h.get_mut_by_id::<HostedParamDialog>(id) {
|
||||
@@ -156,18 +167,40 @@ fn pump_commit(app: &mut VectorcraftApp) {
|
||||
app.status("The document was reverted. Reopen this dialog to continue.");
|
||||
} else if !on_document {
|
||||
app.status("The add-on settings apply only to the drawing where the dialog opened.");
|
||||
} else if let Err(error) = preview.commit(app, spec.command, (spec.params)(&result.fields)) {
|
||||
app.status(error);
|
||||
} else {
|
||||
let params = (spec.params)(&result.fields);
|
||||
let answer = if spec.command == super::select::points_only::COMMAND {
|
||||
preview.commit_selection(app, spec.command, params)
|
||||
} else {
|
||||
preview.commit(app, spec.command, params)
|
||||
};
|
||||
if let Err(error) = answer {
|
||||
app.status(error);
|
||||
} else if spec.command == super::select::points_only::COMMAND {
|
||||
clear_preview_error(app);
|
||||
}
|
||||
}
|
||||
app.addon_dialogs.preview_error = None;
|
||||
}
|
||||
Some(None) => {
|
||||
app.addon_dialogs.open = None;
|
||||
app.addon_dialogs.preview_error = None;
|
||||
mem::take(&mut app.addon_dialogs.preview).cancel(app);
|
||||
}
|
||||
None if live.is_none() => {
|
||||
app.addon_dialogs.open = None;
|
||||
app.addon_dialogs.preview_error = None;
|
||||
mem::take(&mut app.addon_dialogs.preview).cancel(app);
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn clear_preview_error(app: &mut VectorcraftApp) {
|
||||
if let Some((sets, error)) = app.addon_dialogs.preview_error.take()
|
||||
&& app.ui.status_sets == sets
|
||||
&& app.ui.status == error
|
||||
{
|
||||
app.ui.status.clear();
|
||||
}
|
||||
}
|
||||
@@ -228,4 +228,27 @@ mod tests {
|
||||
let top: Vec<u64> = app.session.doc().unwrap().doc.layers[0].children().unwrap().iter().map(|n| n.id.0).collect();
|
||||
assert_eq!(top, [ids[2], ids[3]], "one shape in the topmost joined circle's place, and the far circle");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_status_line_says_why_an_ellipse_is_refused() {
|
||||
use crate::tests::panel_harness::Panel;
|
||||
|
||||
let mut app = crate::testing::windowed(VectorcraftApp::new(Session::new(), Default::default()));
|
||||
app.run("file.new", json!({"width": 400, "height": 300})).unwrap();
|
||||
let a = circle(&mut app, 100.0, 10.0);
|
||||
let oval = app.run("shape.ellipse", json!({"x": 130, "y": 90, "width": 20, "height": 21})).unwrap()["id"].as_u64().unwrap();
|
||||
app.run("select.set", json!({"ids": [a, oval]})).unwrap();
|
||||
let original = geometry(&app);
|
||||
let mut panel = Panel::new(app, crate::tests::picks::dialogs);
|
||||
let before = panel.app().session.doc().unwrap().history.undo.len();
|
||||
menus::invoke(&mut panel.app(), super::COMMAND, Value::Null);
|
||||
panel.frame();
|
||||
let why = "an ellipse whose width and height differ is not a circle";
|
||||
assert!(panel.app().ui.status.contains(why), "the preview's refusal: {}", panel.app().ui.status);
|
||||
panel.click("OK");
|
||||
panel.frame();
|
||||
assert!(panel.app().ui.status.contains(why), "OK's refusal: {}", panel.app().ui.status);
|
||||
assert_eq!(geometry(&panel.app()), original);
|
||||
assert_eq!(panel.app().session.doc().unwrap().history.undo.len(), before, "no undo step");
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Selection Tools in the interface: its submenu (Object › Plug-ins › Selection Tools) and the
|
||||
//! Select by Artboards dialog (#5548), which lists the artboards with their number, name and size,
|
||||
//! filters them by name, picks several, fits one in the window on double-click (#5549), and on OK
|
||||
//! runs `addon.select.byArtboards` with the relation chosen; and Select by Link Status
|
||||
//! ([`link_status`], #5526).
|
||||
//! runs `addon.select.byArtboards` with the relation chosen; Select by Link Status
|
||||
//! ([`link_status`], #5526); and Edit Points Only ([`points_only`]).
|
||||
|
||||
use craft::behavior::{Selection, keyed};
|
||||
use craft::i18n::Folder;
|
||||
@@ -27,6 +27,7 @@ use crate::VectorcraftApp;
|
||||
use crate::menus::{Sep, cp};
|
||||
|
||||
pub mod link_status;
|
||||
pub mod points_only;
|
||||
|
||||
/// Select by Artboards, and its dialog's kind.
|
||||
pub const COMMAND: &str = "addon.select.byArtboards";
|
||||
@@ -40,6 +41,8 @@ const LIST_ROWS: u16 = 9;
|
||||
pub fn menu() -> Vec<Node> {
|
||||
let mut v = vec![cp("Select by Artboards…", COMMAND, Value::Null), Sep];
|
||||
v.extend(link_status::menu());
|
||||
v.push(Sep);
|
||||
v.extend(points_only::menu());
|
||||
v
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
//! Edit Points Only in the interface: its item in Object › Plug-ins › Selection Tools and its
|
||||
//! dialog, which previews the narrowed selection on the canvas and runs
|
||||
//! `addon.select.editPointsOnly` on OK; Cancel puts the selection back.
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use craft::menu::Node;
|
||||
use craft::ui::contract::Bind;
|
||||
use craft::ui::patterns::form_dialogs::{DialogFields, Param, ParamDialog, ParamKind};
|
||||
use serde_json::{Map, Value, json};
|
||||
|
||||
use crate::VectorcraftApp;
|
||||
use crate::addons::dialogs::Spec;
|
||||
use crate::dialogs::form;
|
||||
use crate::menus::c;
|
||||
|
||||
/// Edit Points Only: the dialog's key and the command its OK runs.
|
||||
pub const COMMAND: &str = "addon.select.editPointsOnly";
|
||||
|
||||
static SPEC: Spec = Spec { command: COMMAND, params, found: None };
|
||||
|
||||
/// The menu item.
|
||||
pub fn menu() -> Vec<Node> {
|
||||
vec![c("Edit Points Only…", COMMAND)]
|
||||
}
|
||||
|
||||
/// The dialog's rows.
|
||||
fn rows() -> Vec<Param> {
|
||||
vec![Param::new("segmentEnds", tl!("Keep Ends of Selected Segments"), ParamKind::bool(false))]
|
||||
}
|
||||
|
||||
/// The command's params for the dialog's `fields`.
|
||||
fn params(fields: &DialogFields) -> Value {
|
||||
Value::Object(form::json_of(&rows(), fields))
|
||||
}
|
||||
|
||||
/// Opens the dialog on the active document, with the ends of selected segments left out.
|
||||
pub(crate) fn open(app: &mut VectorcraftApp) -> Result<Value, String> {
|
||||
if app.session.active().is_none() {
|
||||
return Err("no document".into());
|
||||
}
|
||||
let mut opening = Map::new();
|
||||
opening.insert("segmentEnds".into(), json!(false));
|
||||
let fields = form::fields_of(&rows(), &opening);
|
||||
crate::addons::dialogs::open(app, &SPEC, fields, |fields| {
|
||||
ParamDialog::new(COMMAND, tl!("Edit Points Only"), Cow::Owned(rows())).previews(true).values(Bind::bound(fields))
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
@@ -0,0 +1,175 @@
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
use serde_json::json;
|
||||
use vectorcraft_doc::NodeId;
|
||||
use vectorcraft_engine::Session;
|
||||
|
||||
use crate::VectorcraftApp;
|
||||
use crate::addons::dialogs::tests as host;
|
||||
use crate::tests::panel_harness::Panel as Harness;
|
||||
|
||||
/// An app with a window and two rectangles: anchors 0 and 1 of the first selected, and segment 1
|
||||
/// of the second (whose ends are its anchors 1 and 2) beside its anchor 3.
|
||||
fn app() -> (VectorcraftApp, NodeId, NodeId) {
|
||||
let mut app = crate::testing::windowed(VectorcraftApp::new(Session::new(), Default::default()));
|
||||
app.run("file.new", json!({"width": 400, "height": 300})).unwrap();
|
||||
let mut rect = |x| NodeId(app.run("shape.rectangle", json!({"x": x, "y": 10, "width": 50, "height": 50})).unwrap()["id"].as_u64().unwrap());
|
||||
let (a, b) = (rect(10), rect(100));
|
||||
let items = json!([{"id": a.0, "anchors": [[0, 0], [0, 1]]}, {"id": b.0, "anchors": [[0, 3]]}]);
|
||||
app.run("select.anchorsMany", json!({"items": items})).unwrap();
|
||||
app.run("select.segments", json!({"id": b.0, "segments": [[0, 1]], "mode": "add"})).unwrap();
|
||||
(app, a, b)
|
||||
}
|
||||
|
||||
fn refs(v: &[(usize, usize)]) -> BTreeSet<(usize, usize)> {
|
||||
v.iter().copied().collect()
|
||||
}
|
||||
|
||||
/// The selected anchors of `id`, and whether any segment is selected.
|
||||
fn points(app: &VectorcraftApp, id: NodeId) -> (Option<BTreeSet<(usize, usize)>>, bool) {
|
||||
let sel = &app.session.doc().unwrap().selection;
|
||||
(sel.anchors.get(&id).cloned(), !sel.segments.is_empty())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_dialog_previews_keeps_on_ok_and_takes_the_segment_ends_from_the_keyboard() {
|
||||
let (app, a, b) = app();
|
||||
let undo = app.session.doc().unwrap().history.undo.len();
|
||||
let mut panel = Harness::new(app, crate::tests::picks::dialogs);
|
||||
host::open_item(&mut panel.app(), "Selection Tools", "Edit Points Only…");
|
||||
panel.frame();
|
||||
let id = host::dialog_id(&panel.app());
|
||||
assert_eq!(host::read(&panel.app(), id, |f| f.bool("segmentEnds")), Some(false));
|
||||
assert_eq!(points(&panel.app(), b), (Some(refs(&[(0, 3)])), false), "the preview drops the segment and its ends");
|
||||
assert_eq!(points(&panel.app(), a).0, Some(refs(&[(0, 0), (0, 1)])));
|
||||
panel.focus("Keep Ends of Selected Segments");
|
||||
panel.key(egui::Key::Space, egui::Modifiers::NONE);
|
||||
panel.frame();
|
||||
assert_eq!(host::read(&panel.app(), id, |f| f.bool("segmentEnds")), Some(true));
|
||||
assert_eq!(points(&panel.app(), b), (Some(refs(&[(0, 1), (0, 2), (0, 3)])), false), "the ends are kept as anchor points");
|
||||
panel.click("OK");
|
||||
panel.frame();
|
||||
let app = panel.app();
|
||||
assert!(!app.any_dialog_open());
|
||||
assert_eq!(points(&app, b), (Some(refs(&[(0, 1), (0, 2), (0, 3)])), false));
|
||||
assert_eq!(app.session.doc().unwrap().history.undo.len(), undo, "a selection change is not an undo step");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ok_drops_puppet_pins_without_an_undo_step() {
|
||||
for previewing in [true, false] {
|
||||
let (mut app, a, b) = app();
|
||||
app.run("select.set", json!({"ids": [a.0, b.0]})).unwrap();
|
||||
app.run("object.group", json!({})).unwrap();
|
||||
app.run("object.puppetWarp", json!({"pins": [[35, 35]], "moved": [[35, 35]], "rest": true})).unwrap();
|
||||
assert!(app.session.doc().unwrap().doc.puppet.is_some());
|
||||
let undo = app.session.doc().unwrap().history.undo.len();
|
||||
host::open_item(&mut app, "Selection Tools", "Edit Points Only…");
|
||||
let id = host::dialog_id(&app);
|
||||
if previewing {
|
||||
host::frame(&mut app);
|
||||
assert!(app.session.doc().unwrap().doc.puppet.is_none());
|
||||
}
|
||||
assert!(host::confirm(&app, id));
|
||||
host::frame(&mut app);
|
||||
assert!(!app.any_dialog_open());
|
||||
let st = app.session.doc().unwrap();
|
||||
assert!(st.doc.puppet.is_none());
|
||||
assert_eq!(st.selection.objects, vec![a, b]);
|
||||
assert!(!app.session.in_interaction());
|
||||
assert_eq!(st.history.undo.len(), undo, "pin cleanup does not add an undo step");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cancel_puts_the_selection_back() {
|
||||
let (app, _, b) = app();
|
||||
let before = app.session.doc().unwrap().selection.clone();
|
||||
let mut panel = Harness::new(app, crate::tests::picks::dialogs);
|
||||
host::open_item(&mut panel.app(), "Selection Tools", "Edit Points Only…");
|
||||
panel.frame();
|
||||
assert_eq!(points(&panel.app(), b), (Some(refs(&[(0, 3)])), false));
|
||||
panel.click("Cancel");
|
||||
panel.frame();
|
||||
let app = panel.app();
|
||||
assert!(!app.any_dialog_open());
|
||||
assert_eq!(app.session.doc().unwrap().selection, before);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn successful_preview_and_confirmation_preserve_another_status() {
|
||||
for previewing in [true, false] {
|
||||
let (mut app, _, _) = app();
|
||||
host::open_item(&mut app, "Selection Tools", "Edit Points Only…");
|
||||
let id = host::dialog_id(&app);
|
||||
app.status("The active text edit reported a warning.");
|
||||
if previewing {
|
||||
host::frame(&mut app);
|
||||
assert_eq!(app.ui.status, "The active text edit reported a warning.");
|
||||
}
|
||||
assert!(host::confirm(&app, id));
|
||||
host::frame(&mut app);
|
||||
assert_eq!(app.ui.status, "The active text edit reported a warning.");
|
||||
assert!(!app.any_dialog_open());
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn recovering_from_a_preview_error_preserves_a_later_status() {
|
||||
for previewing in [true, false] {
|
||||
for same_text in [true, false] {
|
||||
let (mut app, a, _) = app();
|
||||
app.run("select.segments", json!({"id": a.0, "segments": [[0, 0]]})).unwrap();
|
||||
host::open_item(&mut app, "Selection Tools", "Edit Points Only…");
|
||||
let id = host::dialog_id(&app);
|
||||
host::frame(&mut app);
|
||||
assert!(app.ui.status.contains("no anchor points are selected"));
|
||||
let status = if same_text { app.ui.status.clone() } else { "Another command reported a warning.".to_owned() };
|
||||
app.status(status.clone());
|
||||
host::set(&app, id, "segmentEnds", json!(true));
|
||||
if previewing {
|
||||
host::frame(&mut app);
|
||||
assert_eq!(app.ui.status, status);
|
||||
}
|
||||
assert!(host::confirm(&app, id));
|
||||
host::frame(&mut app);
|
||||
assert_eq!(app.ui.status, status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn keeping_segment_ends_clears_the_preview_error() {
|
||||
for previewing in [true, false] {
|
||||
let (mut app, a, _) = app();
|
||||
app.run("select.segments", json!({"id": a.0, "segments": [[0, 0]]})).unwrap();
|
||||
host::open_item(&mut app, "Selection Tools", "Edit Points Only…");
|
||||
let id = host::dialog_id(&app);
|
||||
host::frame(&mut app);
|
||||
assert!(app.ui.status.contains("no anchor points are selected"), "{}", app.ui.status);
|
||||
host::set(&app, id, "segmentEnds", json!(true));
|
||||
if previewing {
|
||||
host::frame(&mut app);
|
||||
assert!(app.ui.status.is_empty(), "{}", app.ui.status);
|
||||
assert_eq!(points(&app, a), (Some(refs(&[(0, 0), (0, 1)])), false));
|
||||
}
|
||||
assert!(host::confirm(&app, id));
|
||||
host::frame(&mut app);
|
||||
assert!(app.ui.status.is_empty(), "{}", app.ui.status);
|
||||
assert!(!app.any_dialog_open());
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ok_with_nothing_to_keep_says_why_and_leaves_the_selection() {
|
||||
let (mut app, a, _) = app();
|
||||
app.run("select.segments", json!({"id": a.0, "segments": [[0, 0]]})).unwrap();
|
||||
let before = app.session.doc().unwrap().selection.clone();
|
||||
host::open_item(&mut app, "Selection Tools", "Edit Points Only…");
|
||||
let id = host::dialog_id(&app);
|
||||
assert!(host::confirm(&app, id));
|
||||
host::frame(&mut app);
|
||||
assert!(!app.any_dialog_open());
|
||||
assert_eq!(app.session.doc().unwrap().selection, before);
|
||||
assert!(app.ui.status.contains("no anchor points are selected"), "{}", app.ui.status);
|
||||
}
|
||||
@@ -18,7 +18,8 @@
|
||||
//! - `ui.find`: the controls of the window's access tree that match a name or role
|
||||
//! - `ui.set {brightness?, panel?, dockTab?, rulers?, outline?, …}`
|
||||
//! - `ui.dialog.set` / `ui.dialog.confirm` / `ui.dialog.cancel`: answered by
|
||||
//! `craft::automation::dialogs::dialog_method` for the dialog asked for (`dialog`, default `"top"`)
|
||||
//! `craft::automation::dialogs::dialog_method` for the dialog asked for (`dialog`, default `"top"`), and by
|
||||
//! `dialogs::simplify_slider::dialog_method` for the Simplify and Smooth sliders
|
||||
//! - `ui.resize {width, height}`, `ui.focus`, `ui.screenshot {path?, focus?}` (without a path the
|
||||
//! PNG comes back in the reply)
|
||||
//! - `ui.render {path?, scale?, artboard?, data?, traceViews?}`: render an artboard headlessly
|
||||
@@ -152,6 +153,10 @@ pub fn inspect(app: &VectorcraftApp, ctx: &egui::Context) -> Value {
|
||||
}
|
||||
let mut dialogs = app.dialogs().map_or_else(|| json!([]), |dialogs| dialogs.with(|host| craft::automation::dialogs::inspect(host)));
|
||||
crate::dialogs::javascript_files::show_selected(app, &mut dialogs);
|
||||
// The Simplify or Smooth slider over the canvas, listed first: `"top"` names a hosted dialog open with it.
|
||||
if let (Some(open), Some(strip)) = (dialogs.as_array_mut(), crate::dialogs::simplify_slider::inspected(app)) {
|
||||
open.insert(0, strip);
|
||||
}
|
||||
json!({
|
||||
"scriptRunning": app.session.script_running(),
|
||||
"scriptReport": app.session.shown_script_report(),
|
||||
@@ -1437,6 +1442,12 @@ fn dispatch(app: &mut VectorcraftApp, ctx: &egui::Context, method: &str, p: &Val
|
||||
if crate::prefs_dialog::is_open(app) && (p["dialog"] == "preferences" || (top && dialogs.with(|host| host.stack().is_empty()))) {
|
||||
return wrap(preferences_method(app, method, p));
|
||||
}
|
||||
// The Simplify and Smooth sliders are the app's own strip over the canvas, not hosted dialogs: they take a
|
||||
// request that names them, or the top dialog while no hosted dialog is open.
|
||||
let hosted_open = dialogs.with(|host| !host.stack().is_empty());
|
||||
if let Some(r) = crate::dialogs::simplify_slider::dialog_method(app, method, p, hosted_open) {
|
||||
return wrap(r);
|
||||
}
|
||||
// The dialog asked for is `dialog`, the top one when it is missing.
|
||||
let mut params = if p.is_object() { p.clone() } else { json!({}) };
|
||||
if params.get("dialog").is_none_or(Value::is_null) {
|
||||
|
||||
@@ -125,6 +125,12 @@ impl LivePreview {
|
||||
Ok(Value::Null)
|
||||
}
|
||||
|
||||
/// OK for a selection command: rolls its preview back and runs the command without an interaction.
|
||||
pub(crate) fn commit_selection(self, app: &mut VectorcraftApp, cmd: &str, params: Value) -> Result<Value, String> {
|
||||
self.cancel(app);
|
||||
Self::default().commit(app, cmd, params)
|
||||
}
|
||||
|
||||
/// Cancel: rolls a shown preview back, and leaves any other edit in progress as it is.
|
||||
pub(crate) fn cancel(self, app: &mut VectorcraftApp) {
|
||||
if self.previewed.is_some() && self.owns(app) {
|
||||
|
||||
@@ -13,11 +13,14 @@
|
||||
|
||||
// PLAN: the framework paths below (`craft_ui_widgets`, `craft_ui_contract`, `craft_behavior`) and
|
||||
// `LivePreview`'s module are assumed; no app file imports them yet.
|
||||
use craft::automation::dialogs::MAX_DIALOG_FIELDS;
|
||||
use craft::automation::protocol::Params;
|
||||
use craft::behavior::overlay::{Align, Side};
|
||||
use craft::behavior::{CanvasView, IconId};
|
||||
use craft::ui::buttons::IconButton;
|
||||
use craft::ui::contract::overlay::{Anchor, Dismiss, Outside, Place};
|
||||
use craft::ui::contract::{Bind, Props as _, Show as _, ShowContainer as _};
|
||||
use craft::ui::dialog::dialog_id;
|
||||
use craft::ui::layout_components::Row;
|
||||
use craft::ui::popover::Popover;
|
||||
use craft::ui::primitives::IconSpec;
|
||||
@@ -78,6 +81,20 @@ impl StripKind {
|
||||
StripKind::Smooth => SMOOTH_AUTO_LEVEL,
|
||||
}
|
||||
}
|
||||
|
||||
/// The dialog key `ui.inspect` lists the strip under, which `ui.dialog.set`, `ui.dialog.confirm` and
|
||||
/// `ui.dialog.cancel` take as `dialog`.
|
||||
pub(crate) fn key(self) -> &'static str {
|
||||
match self {
|
||||
StripKind::Simplify => "simplifySlider",
|
||||
StripKind::Smooth => "smoothSlider",
|
||||
}
|
||||
}
|
||||
|
||||
/// The id `ui.inspect` lists the strip under: the one a hosted dialog with the same key has, as a decimal string.
|
||||
fn id(self) -> String {
|
||||
dialog_id(self.key()).value().to_string()
|
||||
}
|
||||
}
|
||||
|
||||
/// An open slider strip: the level the canvas previews, the selection's bounds from before any
|
||||
@@ -210,6 +227,132 @@ pub(crate) fn more_options(app: &mut VectorcraftApp) -> Result<Value, String> {
|
||||
Ok(json!({ "tolerance": tolerance }))
|
||||
}
|
||||
|
||||
/// The open strip as `ui.inspect` lists a dialog, `{id, parent, key, fields: {level}}`; `None` when no strip shows.
|
||||
pub(crate) fn inspected(app: &VectorcraftApp) -> Option<Value> {
|
||||
let strip = app.object_dialogs.strip.as_ref().filter(|strip| strip.in_source(app))?;
|
||||
let kind = strip.kind;
|
||||
Some(json!({ "id": kind.id(), "parent": null, "key": kind.key(), "fields": { "level": strip.level() } }))
|
||||
}
|
||||
|
||||
/// The level a `ui.dialog.set` on a strip of `kind` asks for: field `level`, a number from 0 to 100, as `field` and
|
||||
/// `value` or as the last item of `fields`. `None` when it sets nothing.
|
||||
fn requested_level(kind: StripKind, params: &Value) -> Result<Option<f64>, String> {
|
||||
let level = |field: &Value, value: &Value| {
|
||||
let field = field.as_str().ok_or("`field` is not a string")?;
|
||||
if field != "level" {
|
||||
return Err(format!("the {} slider has no field `{field}`", kind.label()));
|
||||
}
|
||||
match value.as_f64() {
|
||||
Some(level) if (0.0..=100.0).contains(&level) => Ok(level),
|
||||
_ => Err("`level` must be a number from 0 to 100".to_string()),
|
||||
}
|
||||
};
|
||||
let Some(list) = params.get("fields") else {
|
||||
return match params.get("field") {
|
||||
Some(field) => level(field, params.get("value").unwrap_or(&Value::Null)).map(Some),
|
||||
None if params.get("value").is_some() => Err("missing `field`".into()),
|
||||
None => Ok(None),
|
||||
};
|
||||
};
|
||||
if params.get("field").is_some() || params.get("value").is_some() {
|
||||
return Err("`fields` takes the place of `field` and `value`".into());
|
||||
}
|
||||
let items = list.as_array().ok_or("`fields` is not a list")?;
|
||||
if items.len() > MAX_DIALOG_FIELDS {
|
||||
return Err(format!("`fields` holds {} items; at most {MAX_DIALOG_FIELDS}", items.len()));
|
||||
}
|
||||
let mut last = None;
|
||||
for item in items {
|
||||
last = Some(level(item.get("field").unwrap_or(&Value::Null), item.get("value").unwrap_or(&Value::Null))?);
|
||||
}
|
||||
Ok(last)
|
||||
}
|
||||
|
||||
/// `ui.dialog.set`, `ui.dialog.confirm` and `ui.dialog.cancel` (`method`) when `params.dialog` names the open strip:
|
||||
/// its key or the id [`inspected`] lists, or `"top"` (or no `dialog`) while `hosted_open` is false. `None` for any
|
||||
/// other dialog.
|
||||
///
|
||||
/// `ui.dialog.set {field: "level", value}` moves the slider and previews the level, then answers with `action`
|
||||
/// (`confirm` or `cancel`) when one is given; a set it refuses leaves the slider as it was. `ui.dialog.confirm` keeps
|
||||
/// the preview as one undo step, as Enter does, and `ui.dialog.cancel` puts the paths back, as Escape does.
|
||||
pub(crate) fn dialog_method(app: &mut VectorcraftApp, method: &str, params: &Value, hosted_open: bool) -> Option<Result<Value, String>> {
|
||||
let kind = app.object_dialogs.strip.as_ref().filter(|strip| strip.in_source(app))?.kind;
|
||||
let ours = match params.get("dialog") {
|
||||
None | Some(Value::Null) => !hosted_open,
|
||||
Some(Value::String(named)) if named == "top" => !hosted_open,
|
||||
Some(Value::String(named)) => named == kind.key() || *named == kind.id(),
|
||||
Some(named) => named.as_u64().is_some_and(|id| id.to_string() == kind.id()),
|
||||
};
|
||||
if !ours {
|
||||
return None;
|
||||
}
|
||||
let keys: &[&str] = match method {
|
||||
"ui.dialog.set" => &["dialog", "field", "value", "fields", "action"],
|
||||
"ui.dialog.confirm" | "ui.dialog.cancel" => &["dialog"],
|
||||
_ => return None,
|
||||
};
|
||||
if let Err(e) = Params(params).only(None, keys) {
|
||||
return Some(Err(e));
|
||||
}
|
||||
let answer = match (method, params.get("action")) {
|
||||
("ui.dialog.confirm", _) => Some(true),
|
||||
("ui.dialog.cancel", _) => Some(false),
|
||||
(_, None | Some(Value::Null)) => None,
|
||||
(_, Some(action)) if action == "confirm" => Some(true),
|
||||
(_, Some(action)) if action == "cancel" => Some(false),
|
||||
(_, Some(_)) => return Some(Err("`action` must be confirm or cancel".into())),
|
||||
};
|
||||
let level = if method == "ui.dialog.set" {
|
||||
match requested_level(kind, params) {
|
||||
Ok(None) if answer.is_none() => return Some(Err("missing `field`".into())),
|
||||
Ok(level) => level,
|
||||
Err(e) => return Some(Err(e)),
|
||||
}
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let mut strip = app.object_dialogs.strip.take()?;
|
||||
if let Some(level) = level {
|
||||
let before = strip.level;
|
||||
strip.level = level;
|
||||
let params = strip.params();
|
||||
let ran = strip.preview.run(app, true, kind.label(), kind.cmd(), ¶ms);
|
||||
// Nothing ran: the canvas already previews this level, or another edit holds the interaction.
|
||||
let shown = || {
|
||||
app.session
|
||||
.active()
|
||||
.and_then(|doc| doc.interaction.as_ref()?.preview.as_ref())
|
||||
.is_some_and(|(cmd, showing)| cmd == kind.cmd() && showing == ¶ms)
|
||||
};
|
||||
let error = match ran {
|
||||
Some(Err(e)) => Some(e),
|
||||
None if !shown() => Some(tl!("Finish the active edit first.").to_owned()),
|
||||
_ => None,
|
||||
};
|
||||
if let Some(e) = error {
|
||||
strip.level = before;
|
||||
app.object_dialogs.strip = Some(strip);
|
||||
return Some(Err(e));
|
||||
}
|
||||
}
|
||||
app.object_dialogs.strip = Some(strip);
|
||||
let set = inspected(app).unwrap_or(Value::Null);
|
||||
let Some(answer) = answer else { return Some(Ok(set)) };
|
||||
let strip = app.object_dialogs.strip.take()?;
|
||||
let result = if answer {
|
||||
let params = strip.params();
|
||||
strip.preview.commit(app, kind.cmd(), params).map(|_| Value::Null)
|
||||
} else {
|
||||
strip.cancel(app);
|
||||
Ok(Value::Null)
|
||||
};
|
||||
// A set with an `action` replies `{dialog, result}`: the slider as the set left it, and the answer's result.
|
||||
Some(match (method, result) {
|
||||
("ui.dialog.set", Ok(result)) => Ok(json!({ "dialog": set, "result": result })),
|
||||
(_, result) => result,
|
||||
})
|
||||
}
|
||||
|
||||
/// Where the strip hangs: a point under the lowest corner on screen of the selection's bounds from
|
||||
/// before the preview, centred on them, kept on the canvas.
|
||||
fn anchor_rect(view: &CanvasView, bounds: Option<Rect>) -> ScreenRect {
|
||||
|
||||
@@ -326,3 +326,149 @@ fn path_sliders_close_when_file_revert_restores_the_artwork() {
|
||||
assert!(app.session.in_interaction());
|
||||
}
|
||||
}
|
||||
|
||||
/// The two sliders: the dialog key `ui.inspect` lists, the menu command that opens it and its undo step's name.
|
||||
const PATH_SLIDERS: [(&str, &str, &str); 2] =
|
||||
[("simplifySlider", "object.path.simplify", "Simplify"), ("smoothSlider", "object.path.smooth", "Smooth")];
|
||||
|
||||
/// One control channel request, answered at once.
|
||||
fn control(app: &mut VectorcraftApp, method: &str, params: serde_json::Value) -> serde_json::Value {
|
||||
let ctx = app.ui_ctx.clone().unwrap();
|
||||
let (req, _) = craft::automation::ControlRequest::new(method, params);
|
||||
let craft::automation::Reply::Done(r) = crate::control::handle(app, &ctx, &req) else { panic!("{method} answered later") };
|
||||
r
|
||||
}
|
||||
|
||||
/// The open dialog `key` in `ui.inspect`'s `dialogs`.
|
||||
fn inspected_dialog(app: &mut VectorcraftApp, key: &str) -> Option<serde_json::Value> {
|
||||
let r = control(app, "ui.inspect", json!({}));
|
||||
r["result"]["dialogs"].as_array()?.iter().find(|d| d["key"] == key).cloned()
|
||||
}
|
||||
|
||||
/// Both sliders show in `ui.inspect` as the dialog their params text names, with field `level`. `ui.dialog.set`
|
||||
/// moves the slider and previews the level, and `ui.dialog.confirm` keeps the result as one undo step.
|
||||
#[test]
|
||||
fn path_sliders_show_in_ui_inspect_and_ui_dialog_confirm_keeps_the_level() {
|
||||
for (key, command, label) in PATH_SLIDERS {
|
||||
let mut app = app_with_dense_path();
|
||||
let undo_len = app.session.doc().unwrap().history.undo.len();
|
||||
crate::menus::invoke(&mut app, command, json!({}));
|
||||
settle(&mut app);
|
||||
let open = inspected_dialog(&mut app, key).unwrap_or_else(|| panic!("{key} in ui.inspect"));
|
||||
assert!(open["fields"]["level"].is_number(), "{open}");
|
||||
|
||||
let r = control(&mut app, "ui.dialog.set", json!({"dialog": key, "field": "level", "value": 20}));
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
assert_eq!(r["result"]["fields"]["level"], 20.0, "{r}");
|
||||
let preview = app.session.doc().unwrap().interaction.as_ref().and_then(|it| it.preview.clone()).map(|p| p.1);
|
||||
assert_eq!(preview, Some(json!({"level": 20.0})), "{key}");
|
||||
settle(&mut app);
|
||||
assert_eq!(inspected_dialog(&mut app, key).map(|d| d["fields"]["level"].clone()), Some(json!(20.0)), "{key}");
|
||||
|
||||
let r = control(&mut app, "ui.dialog.confirm", json!({"dialog": key}));
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
assert!(inspected_dialog(&mut app, key).is_none(), "{key}");
|
||||
assert!(!app.session.in_interaction(), "{key}");
|
||||
let history = &app.session.doc().unwrap().history;
|
||||
assert_eq!(history.undo.len(), undo_len + 1, "{key}");
|
||||
assert_eq!(history.undo.last().map(|step| step.label.as_str()), Some(label), "{key}");
|
||||
}
|
||||
}
|
||||
|
||||
/// A repeated level succeeds, but another active edit blocks a set and leaves the slider's level unchanged.
|
||||
#[test]
|
||||
fn path_sliders_refuse_a_set_when_another_edit_owns_the_interaction() {
|
||||
for (key, command, _) in PATH_SLIDERS {
|
||||
let mut app = app_with_dense_path();
|
||||
crate::menus::invoke(&mut app, command, json!({}));
|
||||
settle(&mut app);
|
||||
for _ in 0..2 {
|
||||
let r = control(&mut app, "ui.dialog.set", json!({"dialog": key, "field": "level", "value": 30}));
|
||||
assert_eq!(r["ok"], true, "{key}: {r}");
|
||||
}
|
||||
let level = inspected_dialog(&mut app, key).unwrap_or_else(|| panic!("{key} in ui.inspect"))["fields"]["level"].clone();
|
||||
app.session.cancel_interaction().unwrap();
|
||||
app.begin_interaction("Other").unwrap();
|
||||
|
||||
let r = control(&mut app, "ui.dialog.set", json!({"dialog": key, "field": "level", "value": 20}));
|
||||
assert_eq!(r["ok"], false, "{key}: {r}");
|
||||
assert_eq!(inspected_dialog(&mut app, key).map(|d| d["fields"]["level"].clone()), Some(level.clone()), "{key}");
|
||||
settle(&mut app);
|
||||
assert_eq!(inspected_dialog(&mut app, key).map(|d| d["fields"]["level"].clone()), Some(level), "{key}");
|
||||
}
|
||||
}
|
||||
|
||||
/// `ui.dialog.set` with `action` sets the level and answers in one request, replying `{dialog, result}` with the
|
||||
/// slider as the set left it: `confirm` keeps the level as one undo step, and `cancel` puts the paths back.
|
||||
#[test]
|
||||
fn path_sliders_answer_a_set_with_an_action_in_one_request() {
|
||||
for (key, command, label) in PATH_SLIDERS {
|
||||
for action in ["confirm", "cancel"] {
|
||||
let mut app = app_with_dense_path();
|
||||
let before = app.session.active().unwrap().doc.clone();
|
||||
let undo_len = app.session.doc().unwrap().history.undo.len();
|
||||
crate::menus::invoke(&mut app, command, json!({}));
|
||||
settle(&mut app);
|
||||
let r = control(&mut app, "ui.dialog.set", json!({"dialog": key, "fields": [{"field": "level", "value": 30}], "action": action}));
|
||||
assert_eq!(r["ok"], true, "{key} {action}: {r}");
|
||||
assert_eq!(r["result"]["dialog"]["key"], key, "{r}");
|
||||
assert_eq!(r["result"]["dialog"]["fields"]["level"], 30.0, "{r}");
|
||||
assert!(r["result"].get("result").is_some(), "{r}");
|
||||
assert!(inspected_dialog(&mut app, key).is_none(), "{key} {action}");
|
||||
assert!(!app.session.in_interaction(), "{key} {action}");
|
||||
let history = &app.session.doc().unwrap().history;
|
||||
if action == "confirm" {
|
||||
assert_eq!(history.undo.len(), undo_len + 1, "{key}");
|
||||
assert_eq!(history.undo.last().map(|step| step.label.as_str()), Some(label), "{key}");
|
||||
} else {
|
||||
assert_eq!(history.undo.len(), undo_len, "{key}");
|
||||
assert_eq!(app.session.active().unwrap().doc, before, "{key}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// With a hosted dialog open over a slider, `ui.inspect` lists the slider first, and `"top"` names the hosted dialog.
|
||||
#[test]
|
||||
fn path_sliders_list_below_a_hosted_dialog_that_top_names() {
|
||||
let mut app = app_with_dense_path();
|
||||
crate::menus::invoke(&mut app, "object.path.simplify", json!({}));
|
||||
settle(&mut app);
|
||||
app.run("ui.javascriptFilesDialog", json!({})).unwrap();
|
||||
let r = control(&mut app, "ui.inspect", json!({}));
|
||||
let open = r["result"]["dialogs"].as_array().cloned().unwrap_or_default();
|
||||
assert!(open.len() >= 2 && open[0]["key"] == "simplifySlider", "{open:?}");
|
||||
let r = control(&mut app, "ui.dialog.cancel", json!({"dialog": "top"}));
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
assert!(inspected_dialog(&mut app, "simplifySlider").is_some(), "the hosted dialog closed, the slider stays");
|
||||
let r = control(&mut app, "ui.inspect", json!({}));
|
||||
assert_eq!(r["result"]["dialogs"].as_array().map(Vec::len), Some(open.len() - 1), "{r}");
|
||||
}
|
||||
|
||||
/// `ui.dialog.cancel` on the top dialog puts the paths back, as Escape does. A level outside 0..100, a value that
|
||||
/// isn't a number and another field are refused, and the slider keeps its level.
|
||||
#[test]
|
||||
fn path_sliders_answer_ui_dialog_cancel_and_refuse_bad_fields() {
|
||||
for (key, command, _) in PATH_SLIDERS {
|
||||
let mut app = app_with_dense_path();
|
||||
let before = app.session.active().unwrap().doc.clone();
|
||||
let undo_len = app.session.doc().unwrap().history.undo.len();
|
||||
crate::menus::invoke(&mut app, command, json!({}));
|
||||
settle(&mut app);
|
||||
let level = inspected_dialog(&mut app, key).unwrap_or_else(|| panic!("{key} in ui.inspect"))["fields"]["level"].clone();
|
||||
for bad in [json!({"field": "level", "value": 101}), json!({"field": "level", "value": "20"}), json!({"field": "tolerance", "value": 2})] {
|
||||
let mut params = bad.clone();
|
||||
params["dialog"] = json!(key);
|
||||
let r = control(&mut app, "ui.dialog.set", params);
|
||||
assert_eq!(r["ok"], false, "{key} {bad}: {r}");
|
||||
assert_eq!(inspected_dialog(&mut app, key).map(|d| d["fields"]["level"].clone()), Some(level.clone()), "{key} {bad}");
|
||||
}
|
||||
|
||||
let r = control(&mut app, "ui.dialog.cancel", json!({}));
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
assert!(inspected_dialog(&mut app, key).is_none(), "{key}");
|
||||
assert!(!app.session.in_interaction(), "{key}");
|
||||
assert_eq!(app.session.active().unwrap().doc, before, "{key}");
|
||||
assert_eq!(app.session.doc().unwrap().history.undo.len(), undo_len, "{key}");
|
||||
}
|
||||
}
|
||||
@@ -334,9 +334,11 @@ fn deserialize_category<'de, D: serde::Deserializer<'de>>(d: D) -> Result<Catego
|
||||
}
|
||||
|
||||
/// A pinned background as saved (`{model, …}`) or as `ui.colorWheel` takes it (any color the
|
||||
/// paint commands take); anything else reads as no pin.
|
||||
/// paint commands take); anything else, a color with a component too large to store included,
|
||||
/// reads as no pin.
|
||||
fn background_value(v: &Value) -> Option<Color> {
|
||||
serde_json::from_value(v.clone()).ok().or_else(|| vectorcraft_engine::cmd::color_value(v))
|
||||
let saved = serde_json::from_value(v.clone()).ok().filter(vectorcraft_engine::cmd::color_is_finite);
|
||||
saved.or_else(|| vectorcraft_engine::cmd::color_value(v))
|
||||
}
|
||||
|
||||
fn deserialize_background<'de, D: serde::Deserializer<'de>>(d: D) -> Result<Option<Color>, D::Error> {
|
||||
|
||||
@@ -347,6 +347,8 @@ fn ui_color_wheel_sets_the_keys_given_and_refuses_bad_values() {
|
||||
(json!({"contrastFor": 3}), "`contrastFor` must be one of normalText, largeText, graphics"),
|
||||
(json!({"contrastBackground": "nope"}), "`contrastBackground` must be a color or null"),
|
||||
(json!({"contrast": false, "contrastBackground": 5}), "`contrastBackground` must be a color or null"),
|
||||
(json!({"contrastBackground": {"model": "rgb", "r": 1e300, "g": 0, "b": 0}}), "`contrastBackground` must be a color or null"),
|
||||
(json!({"contrastBackground": {"c": 0, "m": 0, "y": 0, "k": 1e300}}), "`contrastBackground` must be a color or null"),
|
||||
] {
|
||||
assert_eq!(app.run("ui.colorWheel", p.clone()).unwrap_err(), e, "{p}");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
//! A menu bar menu opens under its title when the window sits on a second monitor that does not start at a multiple
|
||||
//! of its own size (a landscape monitor beside a portrait one, their bottoms aligned).
|
||||
#![allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
|
||||
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use craft::behavior::{Monitor, MonitorKey};
|
||||
use craft::ui::testing::windows::FakeSystem;
|
||||
use egui::accesskit::Role;
|
||||
use egui::{Event, Pos2, RawInput, Rect, pos2, vec2};
|
||||
use serde_json::json;
|
||||
use vectorcraft_engine::Session;
|
||||
use vectorcraft_ui_egui::{VectorcraftApp, i18n};
|
||||
|
||||
// Integration tests link the production global shortcut mirror; each App owns it until its case ends.
|
||||
static INPUT: Mutex<()> = Mutex::new(());
|
||||
|
||||
/// The window's content size in pixels, below a 44 px title bar on the landscape monitor.
|
||||
const WINDOW_PX: [f32; 2] = [1920.0, 1156.0];
|
||||
/// Where the window's content starts on the desktop, in pixels.
|
||||
const WINDOW_AT_PX: [f32; 2] = [1200.0, 764.0];
|
||||
|
||||
/// A portrait monitor at the desktop's origin and a landscape one to its right, their bottoms aligned.
|
||||
fn monitors(scale: f32) -> Vec<Monitor> {
|
||||
let portrait = Monitor::new(MonitorKey::new("portrait", [1200, 1920]), [0, 0], [1200, 1920], scale);
|
||||
let landscape = Monitor::new(MonitorKey::new("landscape", [1920, 1200]), [1200, 720], [1920, 1200], scale);
|
||||
vec![portrait, landscape]
|
||||
}
|
||||
|
||||
struct Scene {
|
||||
app: VectorcraftApp,
|
||||
ctx: egui::Context,
|
||||
time: f64,
|
||||
scale: f32,
|
||||
}
|
||||
|
||||
impl Scene {
|
||||
fn new(scale: f32) -> Self {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
app.run("file.new", json!({"width": 400, "height": 300})).unwrap();
|
||||
let ctx = egui::Context::default();
|
||||
ctx.enable_accesskit();
|
||||
let system = FakeSystem::new();
|
||||
system.set_monitors(monitors(scale));
|
||||
let spec = craft::ui::InstallSpec::new(craft::host::target::ShellInfo::default(), Arc::new(system));
|
||||
craft::ui::shell::embed::install(&ctx, spec, &vectorcraft_ui_egui::ui_fonts()).unwrap();
|
||||
Self { app, ctx, time: 0.0, scale }
|
||||
}
|
||||
|
||||
/// One frame of the whole window; returns the accessibility nodes with their bounds.
|
||||
fn frame(&mut self, events: Vec<Event>) -> Vec<(Role, String, Rect)> {
|
||||
self.time += 1.0 / 30.0;
|
||||
let points = |[x, y]: [f32; 2]| pos2(x, y) / self.scale;
|
||||
let size = points(WINDOW_PX).to_vec2();
|
||||
let mut raw =
|
||||
RawInput { events, time: Some(self.time), focused: true, screen_rect: Some(Rect::from_min_size(Pos2::ZERO, size)), ..Default::default() };
|
||||
let viewport = raw.viewports.entry(egui::ViewportId::ROOT).or_default();
|
||||
viewport.native_pixels_per_point = Some(self.scale);
|
||||
viewport.monitor_size = Some(vec2(1920.0, 1200.0) / self.scale);
|
||||
viewport.inner_rect = Some(Rect::from_min_size(points(WINDOW_AT_PX), size));
|
||||
viewport.outer_rect = Some(Rect::from_min_size(points(WINDOW_AT_PX) - vec2(0.0, 44.0 / self.scale), size + vec2(0.0, 44.0 / self.scale)));
|
||||
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));
|
||||
let _ = self.app.frame_input(craft::ui::runtime::frame::take_output(&self.ctx));
|
||||
out.textures_delta.clear();
|
||||
let update = out.platform_output.accesskit_update.take().unwrap();
|
||||
update
|
||||
.nodes
|
||||
.into_iter()
|
||||
.filter_map(|(_, node)| {
|
||||
let b = node.bounds()?;
|
||||
let rect = Rect::from_min_max(pos2(b.x0 as f32, b.y0 as f32), pos2(b.x1 as f32, b.y1 as f32));
|
||||
Some((node.role(), node.label().unwrap_or_default().to_string(), rect))
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_file_menu_opens_under_its_title_on_a_monitor_beside_a_portrait_one() {
|
||||
let _input = INPUT.lock().unwrap_or_else(std::sync::PoisonError::into_inner);
|
||||
let previous = i18n::current();
|
||||
i18n::set_current(i18n::Lang::EN);
|
||||
for scale in [1.0, 1.5] {
|
||||
let mut scene = Scene::new(scale);
|
||||
for _ in 0..3 {
|
||||
scene.frame(vec![]);
|
||||
}
|
||||
let nodes = scene.frame(vec![]);
|
||||
let title = nodes.iter().find(|(role, label, _)| *role == Role::MenuItem && label == "File").map(|(_, _, rect)| *rect);
|
||||
let title = title.unwrap_or_else(|| panic!("no File title at {scale}x: {nodes:?}"));
|
||||
let at = title.center();
|
||||
let button = |pressed| Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE };
|
||||
scene.frame(vec![Event::PointerMoved(at)]);
|
||||
scene.frame(vec![button(true)]);
|
||||
scene.frame(vec![button(false)]);
|
||||
let nodes = scene.frame(vec![]);
|
||||
let menu = nodes.iter().filter(|(role, _, _)| *role == Role::Menu).map(|(_, _, rect)| *rect).next();
|
||||
let menu = menu.unwrap_or_else(|| panic!("the File menu did not open at {scale}x: {nodes:?}"));
|
||||
// The menu's list sits inside the popup's frame, a few points in from the title's corner.
|
||||
assert!(
|
||||
(menu.left() - title.left()).abs() <= 8.0 && (menu.top() - title.bottom()).abs() <= 8.0,
|
||||
"at {scale}x the File menu opens at {menu:?}, not under its title at {title:?}"
|
||||
);
|
||||
// The whole menu shows: the window's content lies on the landscape monitor, so nothing cuts its room.
|
||||
let items = nodes.iter().filter(|(role, _, rect)| *role == Role::MenuItem && menu.contains_rect(*rect)).count();
|
||||
assert!(items >= 15, "at {scale}x the File menu shows {items} items in {menu:?}");
|
||||
}
|
||||
i18n::set_current(previous);
|
||||
}
|
||||
+39
-5
@@ -642,7 +642,8 @@ Paint values (`fill`, `stroke`) accept `"#rrggbb"`, `"none"`, `[r,g,b]` (0..1),
|
||||
or a full `paint.setFill` params object (`{"gradient": …}`, `{"swatch": "name"}`).
|
||||
A color read this way (a fill or stroke color, a swatch's, an artboard's or new type's color, and the other colors
|
||||
commands read in these forms) that is given as a hex color with an alpha part (`#rrggbbaa` or `#rgba`, with or without
|
||||
the `#`) is an error and changes nothing, as VectorCraft's own rule. The `color` of Drop Shadow, Inner Glow, Outer Glow
|
||||
the `#`) is an error and changes nothing, as VectorCraft's own rule. So is a color with a component too large to store
|
||||
as a 32-bit float, such as `{"c": 1e300, "m": 0, "y": 0, "k": 0}`. The `color` of Drop Shadow, Inner Glow, Outer Glow
|
||||
and Shift to Color is read differently and takes `#rrggbbaa`, as described below.
|
||||
For `draw_shape` and `draw_path`, omitted paint fields inherit the current [new-art appearance](#new-art). Both
|
||||
also style the new object in the same call: `dash` (lengths, or null for solid), `cap`
|
||||
@@ -985,6 +986,8 @@ Cmd+Alt+/ runs `appearance.addStroke` (`press_key {key: "/", mods: {cmd: true, a
|
||||
`item` to edit one of them; `run_command appearance.setActiveItem {"index": n}` makes that row the target of later
|
||||
calls that omit `item` (as clicking the row in the Appearance panel does) until the selection changes; the proxy of
|
||||
its kind (`paint.proxies`) and the Gradient tool's annotator then show that row.
|
||||
An `appearance.setActiveItem` call made outside a drag's preview keeps its selected row, including an explicit
|
||||
`index: null`, when the preview is replaced or canceled.
|
||||
`inspect_document` reports it as `paint.appearanceItem`. `paint.setFill` and `paint.setStroke` also take `opacity`
|
||||
(0 to 100, a percentage as in `transparency.set`), which sets the opacity of the fill or stroke row they paint, with
|
||||
or without a new paint, as one undo step. An opacity that no target takes is an error and also leaves the paint
|
||||
@@ -2231,9 +2234,10 @@ in a replayed journal or action too, and nothing changes.
|
||||
|
||||
The `color` of Drop Shadow, Inner Glow, Outer Glow and Shift to Color must be one the effect can read: a hex color
|
||||
(`#rrggbb`, `#rgb` or `#rrggbbaa`, with or without the `#`), `black`, `white`, `red`, `green` or `blue`, `[r, g, b]`
|
||||
(three numbers, each read on a 0 to 1 scale), or a color object (`{"model": "rgb", "r": 1, "g": 0, "b": 0}`).
|
||||
`effect.apply` and `effect.setParams` refuse any other value themselves (where the parameter check runs first, a number
|
||||
or a boolean is refused as not a string), so the app's effect dialogs and Appearance panel, a step of
|
||||
(three numbers, each read on a 0 to 1 scale), or a color object (`{"model": "rgb", "r": 1, "g": 0, "b": 0}`), with no
|
||||
number too large to store as a 32-bit float (`[1e300, 0, 0]` is refused). `effect.apply` and `effect.setParams`
|
||||
refuse any other value themselves (where the parameter check runs first, a number or a boolean is refused as not a
|
||||
string), so the app's effect dialogs and Appearance panel, a step of
|
||||
`command.batch` and a replayed journal get the same error, and the document and its undo history stay as they were:
|
||||
|
||||
```json
|
||||
@@ -17013,7 +17017,12 @@ Commands:
|
||||
circle of the smaller circle's size about the arc's center. For equal circles that gap apart, that center is where a
|
||||
third circle the gap from both would sit, as in a triangular grid, so the channels around an empty place in such a
|
||||
grid are one width; in a square grid they are not. Giving both `radius` and `gap` is an error. Overlapping and
|
||||
touching circles are joined at every radius. One circle inside the other is an error, and so are circles too far apart
|
||||
touching circles are joined at every radius. An object that is not a circle is an error that says why: an ellipse whose
|
||||
width and height differ, a compound path, an object that is hidden or locked, or another object. More than 2,000
|
||||
objects (with each group other than a clipping group counted as the objects inside it, and a clipping group as one
|
||||
object, which is not a circle) are refused as more than 2,000 circles before any of them is
|
||||
checked, so that error does not say which object is not a circle. One circle inside the
|
||||
other is an error, and so are circles too far apart
|
||||
for the radius or gap: the arcs would not reach both circles, or would cross before they do. The error suggests a
|
||||
larger radius or gap only when the largest (1,000% or 1,000 pt) would bridge the circles. The outline replaces the two
|
||||
circles, painted as the upper one (a plain path), unless `keepOriginals` is true: then it goes directly above the
|
||||
@@ -17620,6 +17629,31 @@ locked". Select by Link Status… lists every image and placed document with its
|
||||
name and filters by status (Show), chooses rows with checkboxes (All / None act on the rows shown), and on Select
|
||||
selects the rows chosen, zooming to them when Zoom to Selection is on (the default).
|
||||
|
||||
`addon.select.editPointsOnly {segmentEnds?}` (Edit Points Only…) narrows the selection to paths and their selected
|
||||
anchor points. A path with selected anchor points keeps them.
|
||||
A path with selected segments drops the segments and keeps its other selected anchor points; the points at the ends of
|
||||
the segments leave the selection unless `segmentEnds` is `true` (default `false`), which keeps them as selected anchor
|
||||
points. A path selected whole stays selected whole and still receives object transforms, including stroke and effect
|
||||
scaling when enabled. A group or compound path selected whole is replaced by the paths
|
||||
inside it, each selected whole unless it has an explicit anchor pick. Explicit anchor picks take precedence regardless
|
||||
of selection order. The command leaves out hidden and locked paths, a Shaper Group's original shapes and, while
|
||||
guides are locked, paths made into guides. Type,
|
||||
images, symbols, meshes and other objects without anchor points, and ruler guides, leave the selection. The command
|
||||
does not add an undo step. It returns `{changed, count, points}`: `changed` is `false` when the
|
||||
selection already held only anchor points, `count` is the number of paths left selected and `points` the number of
|
||||
anchor points selected on them. Nothing selected, no anchor point left to keep ("no anchor points are selected"), or a
|
||||
`segmentEnds` that is not `true` or `false` (including `null`) is an error, and the selection is left as it was.
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"addon.select.editPointsOnly","params":{"segmentEnds":false}}}
|
||||
```
|
||||
|
||||
In the desktop app, Object › Plug-ins › Selection Tools › Edit Points Only… opens a dialog with Keep Ends of Selected
|
||||
Segments (off). With Preview on, the canvas shows the narrowed selection; OK keeps it and Cancel puts the selection
|
||||
back.
|
||||
After a failed preview, a successful preview or OK clears the dialog's error only if that error is still the current
|
||||
status message. Messages from other commands stay displayed.
|
||||
|
||||
### Vector Halftone (live)
|
||||
|
||||
`addon.color.halftone` (Effect › Color Effects › Vector Halftone…, also in Object › Plug-ins › Color Effects) draws its
|
||||
|
||||
@@ -1537,6 +1537,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
Polygonal Lasso selects anchor points (and gradient mesh points) inside a straight-edged loop, with the Lasso's rule for which points are inside, and is listed under Object › Plug-ins. Its tool is also in the Lasso tool's group in both shipped toolbars, after the Enclosing Lasso, and All Tools lists it there, under Select; a toolbar edited before it joined keeps its saved layout until Reset Toolbar (tests `polygonal_lasso_is_in_the_lasso_flyout`, `a_saved_toolbar_without_polygonal_lasso_keeps_its_layout` and `a_torn_off_lasso_group_shows_polygonal_lasso` in `edit_toolbar::tests`, `polygonal_lasso_is_in_the_lasso_group_once` in `addons::tests`, `headless_lists_the_lasso_group` in `vectorcraft-mcp`). It has no default shortcut. Each click sets a vertex. A double-click, Enter or a click on the first vertex closes the loop, Backspace or Delete removes the last vertex, Escape drops the loop, and Shift keeps the next segment to 45° steps. Shift or Alt held at the first click adds to or subtracts from the selection. This is a VectorCraft addition; scores and estimates are unchanged.
|
||||
Select by Artboards (Object › Plug-ins › Selection Tools, a VectorCraft addition: #5525, #5548, #5549) selects the objects overlapping, fully inside or fully outside one or more chosen artboards (`addon.select.byArtboards {artboards, relation}`). Overlapping is All on Active Artboard's test, shared as `select::on_artboard`; Fully inside means within one artboard, edges included; Fully outside means on none. It looks at what Select All takes, so hidden, locked and locked-artboard art stays out. Its dialog lists each artboard's number, name and size in the document's units, filters by name, chooses rows with click, Shift-click and Cmd/Ctrl-click, and fits a row's artboard in the window on double-click (`view.goToArtboard`). Tests: `crates/engine/src/cmd/addons/select/tests.rs`, `crates/ui-egui/src/addons/select/tests.rs`, `crates/engine/tests/command_sweep.rs`.
|
||||
Select by Link Status (Object › Plug-ins › Selection Tools and the Links panel menu, a VectorCraft addition: #5526) selects the image objects and placed documents whose link is linked (its file found unchanged), embedded, missing or modified, as `links.list` reports it (`addon.select.byLinkStatus {status, ids?, add?, zoom?}`); Select Linked, Embedded, Missing and Modified are off when no image has that status and add to the selection with Shift. Objects that are hidden or locked, inside a hidden or locked object or layer, on a template layer, on a locked artboard, or outside the isolated group are left out (the `select::is_selectable` test) and returned with the reason, and the status bar says how many, in plural forms of every catalog. Select by Link Status… lists each image and placed document with its name, status and format, searches by name, filters by status, picks rows with checkboxes and All / None, and zooms to the selection with the existing Zoom to Selection (`addon.arrange.zoomSelection`). Missing-link markers on the canvas are #5547. Tests: `crates/engine/src/cmd/addons/select/tests.rs` (`by_link_status`), `crates/ui-egui/src/addons/select/link_status/tests.rs`, `crates/engine/tests/command_sweep.rs`.
|
||||
Edit Points Only (Object › Plug-ins › Selection Tools, a VectorCraft addition) narrows a Direct Selection to its selected anchor points (`addon.select.editPointsOnly {segmentEnds?}`): selected segments leave the selection, and the points at their ends leave it too unless Keep Ends of Selected Segments is on; paths selected whole keep every point; a group or compound path selected whole gives way to the visible, unlocked paths inside it, leaving out a Shaper Group's original shapes and, while guides are locked, paths made into guides; type, images, symbols and other objects without anchor points leave the selection. Only the selection changes, so there is no undo step; with nothing left to keep it is an error and the selection stays as it was. The dialog previews the narrowed selection, and Cancel puts the selection back. Tests: `crates/engine/src/cmd/addons/select/tests.rs` (`edit_points_only`), `crates/ui-egui/src/addons/select/points_only/tests.rs`, `crates/engine/tests/command_sweep.rs`.
|
||||
The Links panel provides an item right-click context menu on link rows offering Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Separator, and Embed Image / Unembed…. Right-clicking an unselected row selects that row first; right-clicking a row that is already part of a multi-selection preserves the multi-selection. Tests: `panels::tests_links::right_click_context_menu_in_links_panel`.
|
||||
The Location row of the Links panel's Link Info has a folder button, Show in Folder, that opens the folder of the file Link Info shows in the system's file manager (`links.reveal {id}` with that image's id); the help page describes a folder icon on this row ([Links information](https://helpx.adobe.com/illustrator/using/links-info.html)). The button's name and its off state while the file is missing or no file manager is available (the web build) are VectorCraft's own. Tests: `panels::tests_links::link_infos_location_row_shows_the_file_in_its_folder`.
|
||||
A marquee selects a clip group, or an object on a layer with a clipping mask, only when it reaches the area inside the clipping path, and it measures the art only within that path's bounds. Within the bounds of a mask that is not a rectangle, it can still select art that the mask hides. Direct Selection's marquee still selects the hidden anchor points inside it (#2345).
|
||||
@@ -2903,7 +2904,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
|
||||
Evidence for the shared light Color: geometry tests in `tests_lighting`, effect paint tests, command/save/undo/expand and SVG/PDF checks in `three_d_light_color`, and headless picker/reset/preview tests in `tests_revolve`. Revolve keeps smooth colored vector ramps and continuous flat-lit caps. Inflate geometry tests check spherical lighting, shared vertex/edge continuity, concave cell coverage, puffed backs at perspective and legacy single-light/list equivalence; rendered command/export regressions cover smooth shading and editable expansion. Four legacy white-light PNGs matched main byte for byte when this was measured (2026-10-17); since every 3D seam took round joins (2026-11-12), white-light output is expected to differ from them at facet corners ([Seams](three-d.md#seams)); the four scenes were not exported again to measure it; [release measurements](3d-lighting-performance.md) record the colored solid-fill batch and the remaining source-gradient cost. Colored Inflate's facets lie over an underlay of themselves under one clip, so their shared edges show neither the black channel backdrop nor the background ([Seams](three-d.md#seams)); `three_d_light_color::colored_light_surfaces_match_supersampling_at_internal_facet_edges` compares 1:1 with 3x averaged down, and `colored_light_seams_stay_closed_in_svg_pdf_and_expansion` checks SVG, PDF and Expand Appearance. Colored Revolve's faces lie over an underlay of themselves the same way, run by run in a group and with mapped graphics kept after their faces; `colored_revolve_faces_leave_no_alpha_holes_at_one_to_one` checks that no pixel inside the art lets the background through at 1:1 where 3x averaged down is opaque, live, read back from SVG and PDF, and expanded.
|
||||
|
||||
Colored Inflate's composited facets that are simple polygons are each one filled path of the facet and its round seam, so a facet edge pixel is covered once instead of by a fill and then a same-color stroke ([Seams](three-d.md#seams)); `three_d_light_color::turned_colored_inflate_facets_and_seams_cover_their_edges_once` bounds the turned (X 50°, Y 35°) solid fill against 3x averaged down, and `lighting::tests::seamed_fill_covers_a_polygon_and_its_seam_once` checks the path's coverage and the facets that keep a fill and a stroke.
|
||||
Colored Inflate's composited facets that are simple polygons are each one filled path of the facet and its round seam, so a facet edge pixel is covered once instead of by a fill and then a same-color stroke ([Seams](three-d.md#seams)); `three_d_light_color::colored_light_surfaces_match_supersampling_at_internal_facet_edges` bounds the turned (X 50°, Y 35°) solid fill against 3x averaged down, and `lighting::tests::seamed_fill_covers_a_polygon_and_its_seam_once` checks the path's coverage and the facets that keep a fill and a stroke.
|
||||
|
||||
## Eyedropper character dimensions (2026-11-11)
|
||||
|
||||
|
||||
@@ -10,3 +10,7 @@ workspace = true
|
||||
|
||||
[dependencies]
|
||||
serde_json = { workspace = true }
|
||||
|
||||
# The files of other crates that this crate compiles, for CI's test selection.
|
||||
[package.metadata.craft]
|
||||
reads = ["crates/text/build/web_fonts.rs"]
|
||||
@@ -5,7 +5,7 @@ use std::process::Command;
|
||||
|
||||
use serde_json::Value;
|
||||
|
||||
const REV: &str = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d";
|
||||
const REV: &str = "a5669ed2f1ba62545a1f0d884ecbd0fd0fbd06e0";
|
||||
const PACKAGES: &[(&str, &str, &str)] = &[
|
||||
("craft-pdf", "0.1.0", REV),
|
||||
("krilla", "0.8.2", REV),
|
||||
|
||||
Reference in new issue
Block a user