Compare commits
11 Commits
v0.10.0-rc
...
main
| Author | SHA1 | Date |
|---|---|---|
|
|
c8dbf21e83 | |
|
|
cfbcfb0883 | |
|
|
a15bf92d7f | |
|
|
3a0592d093 | |
|
|
423d3fb99d | |
|
|
1b4f7377e9 | |
|
|
ec656f85cd | |
|
|
9940efd0ac | |
|
|
a42c4e93f6 | |
|
|
97df9bd164 | |
|
|
d55a105a92 |
|
|
@ -602,7 +602,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "canvas-pilot"
|
||||
version = "0.10.0-rc.18"
|
||||
version = "0.10.10"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"craft-dwg",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ default-members = ["crates/canvas-pilot"]
|
|||
resolver = "3"
|
||||
|
||||
[workspace.package]
|
||||
version = "0.10.0-rc.18"
|
||||
version = "0.10.10"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
repository = "https://proxy.dandaedre.com/gitea/idle-org/canvas-pilot"
|
||||
|
|
|
|||
|
|
@ -32,6 +32,13 @@ You can use the editor and file exchange without any connected equipment.
|
|||
*Slides + Presenter on a Full HD canvas. Screenshots predate the Canvas Pilot
|
||||
rename and still show the former “Midra Layout” name.*
|
||||
|
||||
## Open source and development
|
||||
|
||||
Canvas Pilot is open-source software under the [MIT license](LICENSE). Its
|
||||
development includes LLM-generated or LLM-assisted work, with human review.
|
||||
It is used in professional settings; supported workflows and current
|
||||
limitations are documented in this repository.
|
||||
|
||||
## From an idea to a screen layout
|
||||
|
||||
1. **Set the stage.** Choose a canvas size or import geometry. Add a reference
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@
|
|||
"ui.rows": "Rows",
|
||||
"ui.equal-divisions-of-the-output-visibility-and-snapping-are-independent": "Equal divisions of the output. Visibility and snapping are independent.",
|
||||
"ui.includes-contact-between-mirrored-opposite-resizing-layers": "Includes contact between mirrored/opposite resizing layers.",
|
||||
"ui.alt-invert-snapping-shift-10-px-ctrl-shift-100-px": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px",
|
||||
"ui.snapping-modifiers-help": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px · Shift+Space: force whole pixels",
|
||||
"ui.force-snapping-to-whole-pixels": "Force snapping to whole pixels",
|
||||
"ui.force-whole-pixels-help": "Always snap moved positions and resized edges to integer pixels. Ratio-locked resizing may slightly approximate the ratio.",
|
||||
"ui.snapping": "Snapping",
|
||||
"ui.example-backdrop-title-saved-in-project": "Example backdrop title (saved in project)",
|
||||
"ui.updates-immediately-leave-blank-to-hide-the-title": "Updates immediately. Leave blank to hide the title.",
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@
|
|||
"ui.rows": "Vicoj",
|
||||
"ui.equal-divisions-of-the-output-visibility-and-snapping-are-independent": "Egalaj dividoj de la eligo. Videbleco kaj algluiĝo estas sendependaj.",
|
||||
"ui.includes-contact-between-mirrored-opposite-resizing-layers": "Inkluzivas kontakton inter spegule aŭ kontraŭe regrandigataj tavoloj.",
|
||||
"ui.alt-invert-snapping-shift-10-px-ctrl-shift-100-px": "Alt: inversigi algluiĝon · Shift: 10 px · Ctrl+Shift: 100 px",
|
||||
"ui.snapping-modifiers-help": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px · Shift+Space: force whole pixels",
|
||||
"ui.force-snapping-to-whole-pixels": "Force snapping to whole pixels",
|
||||
"ui.force-whole-pixels-help": "Always snap moved positions and resized edges to integer pixels. Ratio-locked resizing may slightly approximate the ratio.",
|
||||
"ui.snapping": "Algluiĝo",
|
||||
"ui.example-backdrop-title-saved-in-project": "Titolo de ekzempla fono (konservita en projekto)",
|
||||
"ui.updates-immediately-leave-blank-to-hide-the-title": "Ĝisdatigas tuj. Lasu malplena por kaŝi la titolon.",
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@
|
|||
"ui.rows": "Filas",
|
||||
"ui.equal-divisions-of-the-output-visibility-and-snapping-are-independent": "Divisiones iguales de la salida. Visibilidad y ajuste son independientes.",
|
||||
"ui.includes-contact-between-mirrored-opposite-resizing-layers": "Incluye el contacto entre capas redimensionadas en espejo o en sentido opuesto.",
|
||||
"ui.alt-invert-snapping-shift-10-px-ctrl-shift-100-px": "Alt: invertir ajuste · Mayús: 10 px · Ctrl+Mayús: 100 px",
|
||||
"ui.snapping-modifiers-help": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px · Shift+Space: force whole pixels",
|
||||
"ui.force-snapping-to-whole-pixels": "Force snapping to whole pixels",
|
||||
"ui.force-whole-pixels-help": "Always snap moved positions and resized edges to integer pixels. Ratio-locked resizing may slightly approximate the ratio.",
|
||||
"ui.snapping": "Ajuste magnético",
|
||||
"ui.example-backdrop-title-saved-in-project": "Título del fondo de ejemplo (guardado en el proyecto)",
|
||||
"ui.updates-immediately-leave-blank-to-hide-the-title": "Se actualiza al instante. Déjelo vacío para ocultar el título.",
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@
|
|||
"ui.rows": "Lignes",
|
||||
"ui.equal-divisions-of-the-output-visibility-and-snapping-are-independent": "Divisions égales de la sortie. Visibilité et aimantation sont indépendantes.",
|
||||
"ui.includes-contact-between-mirrored-opposite-resizing-layers": "Inclut le contact entre les calques redimensionnés en miroir ou en opposition.",
|
||||
"ui.alt-invert-snapping-shift-10-px-ctrl-shift-100-px": "Alt : inverser l’aimantation · Maj : 10 px · Ctrl+Maj : 100 px",
|
||||
"ui.snapping-modifiers-help": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px · Shift+Space: force whole pixels",
|
||||
"ui.force-snapping-to-whole-pixels": "Force snapping to whole pixels",
|
||||
"ui.force-whole-pixels-help": "Always snap moved positions and resized edges to integer pixels. Ratio-locked resizing may slightly approximate the ratio.",
|
||||
"ui.snapping": "Aimantation",
|
||||
"ui.example-backdrop-title-saved-in-project": "Titre du fond d’exemple (enregistré dans le projet)",
|
||||
"ui.updates-immediately-leave-blank-to-hide-the-title": "Mise à jour immédiate. Laissez vide pour masquer le titre.",
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@
|
|||
"ui.rows": "Στίχοι",
|
||||
"ui.equal-divisions-of-the-output-visibility-and-snapping-are-independent": "Ἴσαι διαιρέσεις τῆς ἐξόδου. Ὁρατότης καὶ πρόσφυσις χωρισταί εἰσιν.",
|
||||
"ui.includes-contact-between-mirrored-opposite-resizing-layers": "Περιέχει καὶ τὴν ἐπαφὴν στρωμάτων κατοπτρικῶς ἢ ἐναντίως μεταβαλλομένων.",
|
||||
"ui.alt-invert-snapping-shift-10-px-ctrl-shift-100-px": "Alt: ἀντιστροφὴ προσφύσεως · Shift: 10 px · Ctrl+Shift: 100 px",
|
||||
"ui.snapping-modifiers-help": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px · Shift+Space: force whole pixels",
|
||||
"ui.force-snapping-to-whole-pixels": "Force snapping to whole pixels",
|
||||
"ui.force-whole-pixels-help": "Always snap moved positions and resized edges to integer pixels. Ratio-locked resizing may slightly approximate the ratio.",
|
||||
"ui.snapping": "Πρόσφυσις",
|
||||
"ui.example-backdrop-title-saved-in-project": "Τίτλος ὑποδείγματος βάθους (ἐν τῷ σχεδίῳ σῴζεται)",
|
||||
"ui.updates-immediately-leave-blank-to-hide-the-title": "Εὐθὺς μεταβάλλεται. Κενὸν ἔα ἵνα ὁ τίτλος κρύπτηται.",
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@
|
|||
"ui.rows": "पंक्तियाँ",
|
||||
"ui.equal-divisions-of-the-output-visibility-and-snapping-are-independent": "आउटपुट के बराबर भाग। दृश्यता और स्नैपिंग स्वतंत्र हैं।",
|
||||
"ui.includes-contact-between-mirrored-opposite-resizing-layers": "Includes contact between mirrored/opposite resizing layers.",
|
||||
"ui.alt-invert-snapping-shift-10-px-ctrl-shift-100-px": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px",
|
||||
"ui.snapping-modifiers-help": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px · Shift+Space: force whole pixels",
|
||||
"ui.force-snapping-to-whole-pixels": "Force snapping to whole pixels",
|
||||
"ui.force-whole-pixels-help": "Always snap moved positions and resized edges to integer pixels. Ratio-locked resizing may slightly approximate the ratio.",
|
||||
"ui.snapping": "स्नैपिंग",
|
||||
"ui.example-backdrop-title-saved-in-project": "उदाहरण पृष्ठभूमि शीर्षक (परियोजना में सहेजा जाता है)",
|
||||
"ui.updates-immediately-leave-blank-to-hide-the-title": "तुरंत अपडेट होता है। शीर्षक छिपाने के लिए खाली छोड़ें।",
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@
|
|||
"ui.rows": "行",
|
||||
"ui.equal-divisions-of-the-output-visibility-and-snapping-are-independent": "出力を等分します。表示とスナップは独立しています。",
|
||||
"ui.includes-contact-between-mirrored-opposite-resizing-layers": "対称・逆方向にサイズ変更するレイヤー同士の接触も含みます。",
|
||||
"ui.alt-invert-snapping-shift-10-px-ctrl-shift-100-px": "Alt:スナップ反転 · Shift:10 px · Ctrl+Shift:100 px",
|
||||
"ui.snapping-modifiers-help": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px · Shift+Space: force whole pixels",
|
||||
"ui.force-snapping-to-whole-pixels": "Force snapping to whole pixels",
|
||||
"ui.force-whole-pixels-help": "Always snap moved positions and resized edges to integer pixels. Ratio-locked resizing may slightly approximate the ratio.",
|
||||
"ui.snapping": "スナップ",
|
||||
"ui.example-backdrop-title-saved-in-project": "背景サンプルのタイトル(プロジェクトに保存)",
|
||||
"ui.updates-immediately-leave-blank-to-hide-the-title": "すぐに反映されます。空欄でタイトルを非表示にします。",
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@
|
|||
"ui.rows": "पङ्क्तिहरू",
|
||||
"ui.equal-divisions-of-the-output-visibility-and-snapping-are-independent": "आउटपुटका बराबर भागहरू। दृश्यता र स्न्यापिङ स्वतन्त्र छन्।",
|
||||
"ui.includes-contact-between-mirrored-opposite-resizing-layers": "Includes contact between mirrored/opposite resizing layers.",
|
||||
"ui.alt-invert-snapping-shift-10-px-ctrl-shift-100-px": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px",
|
||||
"ui.snapping-modifiers-help": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px · Shift+Space: force whole pixels",
|
||||
"ui.force-snapping-to-whole-pixels": "Force snapping to whole pixels",
|
||||
"ui.force-whole-pixels-help": "Always snap moved positions and resized edges to integer pixels. Ratio-locked resizing may slightly approximate the ratio.",
|
||||
"ui.snapping": "स्न्यापिङ",
|
||||
"ui.example-backdrop-title-saved-in-project": "उदाहरण पृष्ठभूमिको शीर्षक (परियोजनामा सेभ हुन्छ)",
|
||||
"ui.updates-immediately-leave-blank-to-hide-the-title": "तुरुन्त अद्यावधिक हुन्छ। शीर्षक लुकाउन खाली छोड्नुहोस्।",
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@
|
|||
"ui.rows": "Linhas",
|
||||
"ui.equal-divisions-of-the-output-visibility-and-snapping-are-independent": "Divisões iguais da saída. Visibilidade e encaixe são independentes.",
|
||||
"ui.includes-contact-between-mirrored-opposite-resizing-layers": "Includes contact between mirrored/opposite resizing layers.",
|
||||
"ui.alt-invert-snapping-shift-10-px-ctrl-shift-100-px": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px",
|
||||
"ui.snapping-modifiers-help": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px · Shift+Space: force whole pixels",
|
||||
"ui.force-snapping-to-whole-pixels": "Force snapping to whole pixels",
|
||||
"ui.force-whole-pixels-help": "Always snap moved positions and resized edges to integer pixels. Ratio-locked resizing may slightly approximate the ratio.",
|
||||
"ui.snapping": "Encaixe",
|
||||
"ui.example-backdrop-title-saved-in-project": "Título do fundo de exemplo (guardado no projeto)",
|
||||
"ui.updates-immediately-leave-blank-to-hide-the-title": "Atualiza de imediato. Deixe vazio para ocultar o título.",
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@
|
|||
"ui.rows": "แถว",
|
||||
"ui.equal-divisions-of-the-output-visibility-and-snapping-are-independent": "แบ่งเอาต์พุตเท่า ๆ กัน การมองเห็นและการดูดตำแหน่งแยกจากกัน",
|
||||
"ui.includes-contact-between-mirrored-opposite-resizing-layers": "Includes contact between mirrored/opposite resizing layers.",
|
||||
"ui.alt-invert-snapping-shift-10-px-ctrl-shift-100-px": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px",
|
||||
"ui.snapping-modifiers-help": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px · Shift+Space: force whole pixels",
|
||||
"ui.force-snapping-to-whole-pixels": "Force snapping to whole pixels",
|
||||
"ui.force-whole-pixels-help": "Always snap moved positions and resized edges to integer pixels. Ratio-locked resizing may slightly approximate the ratio.",
|
||||
"ui.snapping": "การดูดเข้าตำแหน่ง",
|
||||
"ui.example-backdrop-title-saved-in-project": "ชื่อพื้นหลังตัวอย่าง (บันทึกในโครงการ)",
|
||||
"ui.updates-immediately-leave-blank-to-hide-the-title": "อัปเดตทันที เว้นว่างเพื่อซ่อนชื่อ",
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@
|
|||
"ui.rows": "kulupu supa",
|
||||
"ui.equal-divisions-of-the-output-visibility-and-snapping-are-independent": "kipisi sama pi sitelen tawa. lukin en awen lon linja li wan ala.",
|
||||
"ui.includes-contact-between-mirrored-opposite-resizing-layers": "Includes contact between mirrored/opposite resizing layers.",
|
||||
"ui.alt-invert-snapping-shift-10-px-ctrl-shift-100-px": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px",
|
||||
"ui.snapping-modifiers-help": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px · Shift+Space: force whole pixels",
|
||||
"ui.force-snapping-to-whole-pixels": "Force snapping to whole pixels",
|
||||
"ui.force-whole-pixels-help": "Always snap moved positions and resized edges to integer pixels. Ratio-locked resizing may slightly approximate the ratio.",
|
||||
"ui.snapping": "awen lon linja",
|
||||
"ui.example-backdrop-title-saved-in-project": "nimi pi sitelen monsi (awen lon pali)",
|
||||
"ui.updates-immediately-leave-blank-to-hide-the-title": "ona li sin lon tenpo ni. nimi ala la nimi li len.",
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@
|
|||
"ui.rows": "行",
|
||||
"ui.equal-divisions-of-the-output-visibility-and-snapping-are-independent": "等分输出区域。显示与吸附互不影响。",
|
||||
"ui.includes-contact-between-mirrored-opposite-resizing-layers": "也包括镜像或反向缩放图层之间的接触。",
|
||||
"ui.alt-invert-snapping-shift-10-px-ctrl-shift-100-px": "Alt:反转吸附 · Shift:10 px · Ctrl+Shift:100 px",
|
||||
"ui.snapping-modifiers-help": "Alt: invert snapping · Shift: 10 px · Ctrl+Shift: 100 px · Shift+Space: force whole pixels",
|
||||
"ui.force-snapping-to-whole-pixels": "Force snapping to whole pixels",
|
||||
"ui.force-whole-pixels-help": "Always snap moved positions and resized edges to integer pixels. Ratio-locked resizing may slightly approximate the ratio.",
|
||||
"ui.snapping": "吸附",
|
||||
"ui.example-backdrop-title-saved-in-project": "示例背景标题(保存在项目中)",
|
||||
"ui.updates-immediately-leave-blank-to-hide-the-title": "立即更新。留空可隐藏标题。",
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ impl Editor {
|
|||
self.output_draft = Some(d);
|
||||
}
|
||||
}
|
||||
pub(super) fn finish_crop_edit(&mut self) {
|
||||
fn request_formats_close(&mut self) {
|
||||
if let Some(draft) = self
|
||||
.format_draft
|
||||
.as_mut()
|
||||
|
|
@ -294,6 +294,23 @@ impl Editor {
|
|||
} else {
|
||||
self.format_draft = None;
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn toggle_layer_properties(&mut self, layer: usize) {
|
||||
if self
|
||||
.format_draft
|
||||
.as_ref()
|
||||
.is_some_and(|draft| draft.is_for(layer))
|
||||
{
|
||||
self.request_formats_close();
|
||||
} else {
|
||||
self.property_tab = PropertyTab::Layer;
|
||||
self.format_draft = Some(FormatDraft::new(&self.layout, layer));
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn finish_crop_edit(&mut self) {
|
||||
self.request_formats_close();
|
||||
self.edit_content = false;
|
||||
self.edit_mask = false;
|
||||
self.alt_mask = false;
|
||||
|
|
@ -357,6 +374,7 @@ impl Editor {
|
|||
}
|
||||
if self.property_tab == PropertyTab::Layer {
|
||||
let before_size = d.size;
|
||||
self.keep_aspect_ratio = self.layout.layer_info(i).keep_aspect_ratio;
|
||||
ui.heading(tr(ui.ctx(), "ui.layer-resolution-final-visible-box"));
|
||||
ui.label(tr(ui.ctx(), "ui.resizing-automatically-adjusts-the-layer-crop-to-fit-the-new-dimensions"));
|
||||
ui.horizontal(|ui| {
|
||||
|
|
@ -373,7 +391,11 @@ impl Editor {
|
|||
match d.commit_ratio(self.keep_aspect_ratio) {Ok(())=>d.error.clear(),Err(error)=>d.error=error}
|
||||
}
|
||||
if !self.keep_aspect_ratio && d.ratio_edit.target.is_some() {ui.small(tr(ui.ctx(), "ui.ratio-ready-enable-the-lock-to-resize"));}
|
||||
if lock_changed {self.settings.save(&self.application_settings(ui.ctx()));}
|
||||
if lock_changed
|
||||
&& let Err(error) = self.layout.set_keep_aspect_ratio(i, self.keep_aspect_ratio)
|
||||
{
|
||||
d.error = error;
|
||||
}
|
||||
let old=d.size;
|
||||
dimensions(ui,&mut d.size,"Visible pixels");
|
||||
if self.keep_aspect_ratio {
|
||||
|
|
|
|||
|
|
@ -146,6 +146,7 @@ impl ImportScope {
|
|||
struct Paste {
|
||||
clipboard_entry: bool,
|
||||
scope: ImportScope,
|
||||
automatic_scopes: Vec<(ImportScope, Vec<usize>)>,
|
||||
pages: Vec<canvas_pilot::interchange::Page>,
|
||||
page_index: usize,
|
||||
import_job:
|
||||
|
|
@ -181,6 +182,7 @@ impl Paste {
|
|||
.collect()
|
||||
}
|
||||
fn set_scope(&mut self, scope: ImportScope, layout: &Layout) {
|
||||
self.automatic_scopes.clear();
|
||||
self.targets = match &scope {
|
||||
ImportScope::All => Vec::new(),
|
||||
ImportScope::Selected => layout.selected_indices(),
|
||||
|
|
@ -200,7 +202,7 @@ impl Paste {
|
|||
}
|
||||
}
|
||||
}
|
||||
fn set_document(&mut self, doc: ImportDocument) {
|
||||
fn set_document(&mut self, doc: ImportDocument, layout: &Layout) {
|
||||
self.shapes = doc.shapes;
|
||||
self.note = doc.note;
|
||||
self.ignored = self
|
||||
|
|
@ -208,6 +210,42 @@ impl Paste {
|
|||
.iter()
|
||||
.map(|shape| shape.background_only)
|
||||
.collect();
|
||||
let count = self.ignored.iter().filter(|ignored| !**ignored).count();
|
||||
if let Some((_, selected)) = self.automatic_scopes.first() {
|
||||
self.scope = if selected.is_empty() {
|
||||
ImportScope::All
|
||||
} else {
|
||||
ImportScope::Selected
|
||||
};
|
||||
self.targets = selected.clone();
|
||||
self.target_ids = self
|
||||
.targets
|
||||
.iter()
|
||||
.filter_map(|&i| self.available_ids.get(i).copied())
|
||||
.collect();
|
||||
}
|
||||
for (scope, indices) in &self.automatic_scopes {
|
||||
let candidates: Vec<_> = indices
|
||||
.iter()
|
||||
.copied()
|
||||
.filter(|&i| {
|
||||
i < layout.layers().len()
|
||||
&& self.available_ids.get(i) == Some(&layout.layer_info(i).id)
|
||||
&& layout.visible(i)
|
||||
&& !layout.locked(i)
|
||||
})
|
||||
.collect();
|
||||
if count > 0 && candidates.len() == count {
|
||||
self.scope = scope.clone();
|
||||
self.targets = candidates;
|
||||
self.target_ids = self
|
||||
.targets
|
||||
.iter()
|
||||
.map(|&i| layout.layer_info(i).id)
|
||||
.collect();
|
||||
break;
|
||||
}
|
||||
}
|
||||
self.reset_mapping();
|
||||
self.error.clear();
|
||||
}
|
||||
|
|
@ -225,11 +263,11 @@ impl Paste {
|
|||
})
|
||||
.collect();
|
||||
}
|
||||
fn parse(&mut self) {
|
||||
fn parse(&mut self, layout: &Layout) {
|
||||
self.import_job = None;
|
||||
self.pages.clear();
|
||||
match parse_values(&self.text) {
|
||||
Ok(doc) => self.set_document(doc),
|
||||
Ok(doc) => self.set_document(doc, layout),
|
||||
Err(e) => {
|
||||
self.shapes.clear();
|
||||
self.mapping.clear();
|
||||
|
|
@ -910,6 +948,7 @@ impl Editor {
|
|||
}
|
||||
self.fields_edited = false;
|
||||
if let Some(i) = self.layout.selected() {
|
||||
self.keep_aspect_ratio = self.layout.layer_info(i).keep_aspect_ratio;
|
||||
let g = self.layout.layers()[i];
|
||||
let [x, y] = self
|
||||
.position_reference()
|
||||
|
|
@ -939,7 +978,23 @@ impl Editor {
|
|||
|
||||
fn open_paste(&mut self, text: String) {
|
||||
let targets = self.layout.selected_indices();
|
||||
let mut automatic_scopes = vec![(ImportScope::Selected, targets.clone())];
|
||||
if let Some(&first) = targets.first() {
|
||||
let folder = &self.layout.layer_info(first).folder;
|
||||
if !folder.is_empty()
|
||||
&& targets
|
||||
.iter()
|
||||
.all(|&i| &self.layout.layer_info(i).folder == folder)
|
||||
{
|
||||
automatic_scopes.push((
|
||||
ImportScope::Folder(folder.clone()),
|
||||
self.layout.folder_members(folder),
|
||||
));
|
||||
}
|
||||
}
|
||||
automatic_scopes.push((ImportScope::All, (0..self.layout.layers().len()).collect()));
|
||||
let mut p = Paste {
|
||||
automatic_scopes,
|
||||
clipboard_entry: true,
|
||||
scope: if targets.is_empty() {
|
||||
ImportScope::All
|
||||
|
|
@ -973,7 +1028,7 @@ impl Editor {
|
|||
error: String::new(),
|
||||
};
|
||||
if !p.text.is_empty() {
|
||||
p.parse();
|
||||
p.parse(&self.layout);
|
||||
}
|
||||
self.paste = Some(p);
|
||||
}
|
||||
|
|
@ -1361,7 +1416,7 @@ impl Editor {
|
|||
match job.try_recv() {
|
||||
Ok(Ok(pages)) => {
|
||||
if let Some(first) = pages.first() {
|
||||
p.set_document(first.document.clone());
|
||||
p.set_document(first.document.clone(), &self.layout);
|
||||
}
|
||||
p.pages = pages;
|
||||
p.page_index = 0;
|
||||
|
|
@ -1385,12 +1440,12 @@ impl Editor {
|
|||
egui::ComboBox::new("File / page / frame / slide", tr(ui.ctx(), "ui.file-page-frame-slide")).selected_text(&p.pages[p.page_index].name).show_ui(ui, |ui| {
|
||||
for (index, page) in p.pages.iter().enumerate() { ui.stable_selectable_value(&mut p.page_index, index, &page.name); }
|
||||
});
|
||||
if previous != p.page_index { p.set_document(p.pages[p.page_index].document.clone()); }
|
||||
if previous != p.page_index { p.set_document(p.pages[p.page_index].document.clone(), &self.layout); }
|
||||
}
|
||||
if p.clipboard_entry && p.shapes.is_empty() && p.import_job.is_none() {
|
||||
ui.label(tr(ui.ctx(), "ui.paste-layer-values-to-review-their-geometry-and-destinations"));
|
||||
ui.add(egui::TextEdit::multiline(&mut p.text).desired_rows(4).desired_width(f32::INFINITY));
|
||||
if ui.button(tr(ui.ctx(), "ui.review-pasted-values")).clicked() { p.parse(); }
|
||||
if ui.button(tr(ui.ctx(), "ui.review-pasted-values")).clicked() { p.parse(&self.layout); }
|
||||
}
|
||||
egui::ScrollArea::vertical().id_salt("import-review").max_height((ctx.content_rect().height()-260.0).max(150.0)).show(ui,|ui| {
|
||||
if !p.error.is_empty() {ui.colored_label(palette.amber,&p.error);}
|
||||
|
|
@ -1571,9 +1626,14 @@ impl Editor {
|
|||
};
|
||||
let row_offset = (row_count as f32 - 2.0) * 44.0
|
||||
- input_reference_rows as f32 * (44.0 - capture_ui::INPUT_REFERENCE_ROW_HEIGHT);
|
||||
let details_height = match self.layout.selected_indices().len() {
|
||||
0 => 220.0,
|
||||
1 => 823.0,
|
||||
_ => 1071.0,
|
||||
};
|
||||
let palette = theme::palette(ui.ctx());
|
||||
let (r, _) = ui.allocate_exact_size(
|
||||
Vec2::new(ui.available_width(), 1071.0 + row_offset),
|
||||
Vec2::new(ui.available_width(), details_height + row_offset),
|
||||
egui::Sense::hover(),
|
||||
);
|
||||
let ink = Ink::new(ui, r);
|
||||
|
|
@ -1854,7 +1914,7 @@ impl Editor {
|
|||
ink.text(0.0, 150.0, &self.layout.layer_label(i), 25.0, palette.text);
|
||||
ink.text(
|
||||
0.0,
|
||||
191.0,
|
||||
184.0,
|
||||
&tr(
|
||||
ink.painter.ctx(),
|
||||
"ui.layer-resolution-click-for-layer-properties",
|
||||
|
|
@ -1862,10 +1922,10 @@ impl Editor {
|
|||
11.0,
|
||||
palette.muted,
|
||||
);
|
||||
ink.card(0.0, 214.0, w, 34.0, palette.field, palette.line);
|
||||
ink.card(0.0, 203.0, w, 34.0, palette.field, palette.line);
|
||||
ink.text(
|
||||
12.0,
|
||||
223.0,
|
||||
212.0,
|
||||
&format!(
|
||||
"{} × {} px / {}",
|
||||
number(g.width),
|
||||
|
|
@ -1875,14 +1935,13 @@ impl Editor {
|
|||
13.0,
|
||||
palette.text,
|
||||
);
|
||||
if click(ui, &ink, [0.0, 214.0, w, 34.0], "open-formats") {
|
||||
self.property_tab = PropertyTab::Layer;
|
||||
self.format_draft = Some(FormatDraft::new(&self.layout, i));
|
||||
if click(ui, &ink, [0.0, 203.0, w, 34.0], "open-formats") {
|
||||
self.toggle_layer_properties(i);
|
||||
}
|
||||
if let Some(mode) = self.layout.formats().layer_fit[i] {
|
||||
ink.text(
|
||||
0.0,
|
||||
251.0,
|
||||
240.0,
|
||||
&format!("{} · container bounds", mode.label()),
|
||||
11.0,
|
||||
palette.muted,
|
||||
|
|
@ -1890,7 +1949,7 @@ impl Editor {
|
|||
} else if let Ok(m) = self.layout.formats().mapping(i, g) {
|
||||
ink.text(
|
||||
0.0,
|
||||
251.0,
|
||||
240.0,
|
||||
&format!(
|
||||
"Input {} · content {:.1}% · offset {:.1}, {:.1}",
|
||||
self.layout.formats().source_for[i] + 1,
|
||||
|
|
@ -1913,7 +1972,7 @@ impl Editor {
|
|||
let edit_label_text = tr(ui.ctx(), edit_label);
|
||||
ink.button(
|
||||
0.0,
|
||||
275.0,
|
||||
263.0,
|
||||
edit_width,
|
||||
if self.layout.formats().layer_fit[i].is_some() && !self.edit_content {
|
||||
"Adjust edge crop"
|
||||
|
|
@ -1925,7 +1984,7 @@ impl Editor {
|
|||
if self.edit_content {
|
||||
ink.button(
|
||||
w - 108.0,
|
||||
275.0,
|
||||
263.0,
|
||||
108.0,
|
||||
if self.mask_editing() {
|
||||
"Reset mask"
|
||||
|
|
@ -1937,7 +1996,7 @@ impl Editor {
|
|||
if click(
|
||||
ui,
|
||||
&ink,
|
||||
[w - 108.0, 275.0, 108.0, 34.0],
|
||||
[w - 108.0, 263.0, 108.0, 34.0],
|
||||
"reset-visual-crop",
|
||||
) {
|
||||
let result = if self.mask_editing() {
|
||||
|
|
@ -1964,7 +2023,7 @@ impl Editor {
|
|||
if click(
|
||||
ui,
|
||||
&ink,
|
||||
[0.0, 275.0, edit_width, 34.0],
|
||||
[0.0, 263.0, edit_width, 34.0],
|
||||
"edit-layer-content",
|
||||
) {
|
||||
if self.mask_editing() {
|
||||
|
|
@ -1975,7 +2034,7 @@ impl Editor {
|
|||
}
|
||||
}
|
||||
ui.put(
|
||||
Rect::from_min_size(ink.point(0.0, 317.0), Vec2::new(w, 48.0)),
|
||||
Rect::from_min_size(ink.point(0.0, 305.0), Vec2::new(w, 48.0)),
|
||||
egui::Label::new(
|
||||
egui::RichText::new(tr(
|
||||
ui.ctx(),
|
||||
|
|
@ -1995,7 +2054,7 @@ impl Editor {
|
|||
);
|
||||
ink.text(
|
||||
0.0,
|
||||
375.0,
|
||||
357.0,
|
||||
&tr(ink.painter.ctx(), "ui.measure-position-from"),
|
||||
11.0,
|
||||
palette.muted,
|
||||
|
|
@ -2008,7 +2067,7 @@ impl Editor {
|
|||
)
|
||||
.into_owned();
|
||||
let button = ui.put(
|
||||
Rect::from_min_size(ink.point(0.0, 394.0), Vec2::new(w, 34.0)),
|
||||
Rect::from_min_size(ink.point(0.0, 376.0), Vec2::new(w, 34.0)),
|
||||
egui::Button::new(label),
|
||||
);
|
||||
let arrow = button.rect.right_center() - Vec2::new(13.0, 0.0);
|
||||
|
|
@ -2032,7 +2091,7 @@ impl Editor {
|
|||
PositionPoint::BottomLeft => ("position.left", "position.bottom"),
|
||||
PositionPoint::BottomRight => ("position.right", "position.bottom"),
|
||||
};
|
||||
let ink = Ink::new(ui, r.translate(Vec2::new(0.0, 88.0)));
|
||||
let ink = Ink::new(ui, r.translate(Vec2::new(0.0, 70.0)));
|
||||
let half = (w - 12.0) / 2.0;
|
||||
let mut enter = false;
|
||||
for (index, x, y, title) in [
|
||||
|
|
@ -2042,14 +2101,14 @@ impl Editor {
|
|||
(3, half + 12.0, 449.0, "position.height"),
|
||||
] {
|
||||
ink.text(x, y, &tr(ui.ctx(), title), 12.0, palette.muted);
|
||||
let rect = Rect::from_min_size(ink.point(x, y + 23.0), Vec2::new(half, 42.0));
|
||||
let rect = Rect::from_min_size(ink.point(x, y + 23.0), Vec2::new(half, 38.0));
|
||||
self.field_rects[index] = rect;
|
||||
let response = ui.put(
|
||||
rect,
|
||||
egui::TextEdit::singleline(&mut self.fields[index])
|
||||
.id(egui::Id::new(("geometry", index)))
|
||||
.font(egui::FontId::proportional(18.0))
|
||||
.margin(Vec2::new(12.0, 10.0)),
|
||||
.margin(Vec2::new(12.0, 8.0)),
|
||||
);
|
||||
if response.changed() {
|
||||
self.fields_edited = true;
|
||||
|
|
@ -2076,12 +2135,12 @@ impl Editor {
|
|||
}
|
||||
ui.scope_builder(
|
||||
egui::UiBuilder::new().max_rect(Rect::from_min_size(
|
||||
ink.point(0.0, 530.0),
|
||||
ink.point(0.0, 522.0),
|
||||
Vec2::new(w, 76.0),
|
||||
)),
|
||||
|ui| self.resize_ratio_option(ui),
|
||||
);
|
||||
let ink = Ink::new(ui, r.translate(Vec2::new(0.0, 140.0)));
|
||||
let ink = Ink::new(ui, r.translate(Vec2::new(0.0, 109.0)));
|
||||
let pending = self.fields_pending();
|
||||
if enter && pending {
|
||||
self.apply_fields();
|
||||
|
|
@ -2098,21 +2157,11 @@ impl Editor {
|
|||
.wrap(),
|
||||
);
|
||||
}
|
||||
let ink = Ink::new(ui, r.translate(Vec2::new(0.0, 119.0)));
|
||||
let ink = Ink::new(ui, r.translate(Vec2::new(0.0, 88.0)));
|
||||
ink.line([0.0, 640.0], [w, 640.0], palette.line);
|
||||
ink.text(
|
||||
0.0,
|
||||
663.0,
|
||||
&tr(ink.painter.ctx(), "ui.visible-box-center-position"),
|
||||
11.0,
|
||||
palette.cyan,
|
||||
);
|
||||
let [h, v] = g.center();
|
||||
ink.field(0.0, 693.0, half, "Horizontal · from left", &number(h));
|
||||
ink.field(half + 12.0, 693.0, half, "Vertical · from top", &number(v));
|
||||
ink.text(
|
||||
0.0,
|
||||
776.0,
|
||||
&tr(
|
||||
ink.painter.ctx(),
|
||||
"ui.layer-properties-crops-provisional-device-mapping",
|
||||
|
|
@ -2120,17 +2169,9 @@ impl Editor {
|
|||
12.0,
|
||||
palette.muted,
|
||||
);
|
||||
ink.button(0.0, 808.0, w, "Copy layer values", true);
|
||||
if click(ui, &ink, [0.0, 808.0, w, 34.0], "copy-values") {
|
||||
self.copy(ui.ctx());
|
||||
}
|
||||
ink.button(0.0, 857.0, w, "Paste layer(s) values", false);
|
||||
if click(ui, &ink, [0.0, 857.0, w, 34.0], "paste-button") {
|
||||
self.open_paste(String::new());
|
||||
}
|
||||
ink.text(
|
||||
0.0,
|
||||
912.0,
|
||||
695.0,
|
||||
&tr(
|
||||
ink.painter.ctx(),
|
||||
"ui.or-ctrl-cmd-v-with-the-viewport-focused",
|
||||
|
|
@ -2168,10 +2209,12 @@ impl Editor {
|
|||
}
|
||||
_ => default_name.to_owned(),
|
||||
};
|
||||
egui::ComboBox::from_id_salt("alignment-target")
|
||||
.width(210.0)
|
||||
.selected_text(target_name(self.align_target))
|
||||
.show_ui(ui, |ui| {
|
||||
egui::containers::menu::SubMenuButton::new(target_name(self.align_target))
|
||||
.config(
|
||||
egui::containers::menu::MenuConfig::new()
|
||||
.close_behavior(egui::PopupCloseBehavior::CloseOnClickOutside),
|
||||
)
|
||||
.ui(ui, |ui| {
|
||||
ui.stable_selectable_value(
|
||||
&mut self.align_target,
|
||||
AlignTarget::Selection,
|
||||
|
|
@ -2282,6 +2325,10 @@ impl Editor {
|
|||
Ok(())
|
||||
}
|
||||
fn resize_ratio_option(&mut self, ui: &mut egui::Ui) {
|
||||
let Some(i) = self.layout.selected() else {
|
||||
return;
|
||||
};
|
||||
self.keep_aspect_ratio = self.layout.layer_info(i).keep_aspect_ratio;
|
||||
let changed = ui
|
||||
.checkbox(
|
||||
&mut self.keep_aspect_ratio,
|
||||
|
|
@ -2307,9 +2354,9 @@ impl Editor {
|
|||
{
|
||||
self.ratio_edit.error = error;
|
||||
}
|
||||
if changed {
|
||||
let options = self.application_settings(ui.ctx());
|
||||
self.settings.save(&options);
|
||||
if changed && let Err(error) = self.layout.set_keep_aspect_ratio(i, self.keep_aspect_ratio)
|
||||
{
|
||||
self.error = error;
|
||||
}
|
||||
}
|
||||
fn measurement_points_menu(&mut self, ui: &mut egui::Ui) {
|
||||
|
|
@ -2677,10 +2724,6 @@ impl Editor {
|
|||
palette.text,
|
||||
);
|
||||
}
|
||||
ink.button(0.0, 552.0, w, "Copy selected layer values", true);
|
||||
if click(ui, ink, [0.0, 552.0, w, 34.0], "copy-selected") {
|
||||
self.copy(ui.ctx());
|
||||
}
|
||||
ink.text(
|
||||
0.0,
|
||||
609.0,
|
||||
|
|
@ -2806,9 +2849,13 @@ impl Editor {
|
|||
point: [f64; 2],
|
||||
modifiers: egui::Modifiers,
|
||||
scale: f32,
|
||||
force_pixels: bool,
|
||||
) {
|
||||
let mut options = self.snapping;
|
||||
if modifiers.alt {
|
||||
if force_pixels {
|
||||
options.enabled = true;
|
||||
options.force_pixels = true;
|
||||
} else if modifiers.alt {
|
||||
options.enabled = !options.enabled;
|
||||
}
|
||||
let (target, guides) = self.layout.snap_pivot(
|
||||
|
|
@ -2896,10 +2943,17 @@ impl Editor {
|
|||
point: [f64; 2],
|
||||
modifiers: egui::Modifiers,
|
||||
scale: f32,
|
||||
force_pixels: bool,
|
||||
) -> [Option<f64>; 2] {
|
||||
self.layout
|
||||
.use_resize_pivot(self.effective_pivot(modifiers));
|
||||
if let Some(spacing) = self.effective_grid(modifiers) {
|
||||
if force_pixels {
|
||||
let mut snapping = self.snapping;
|
||||
snapping.enabled = true;
|
||||
snapping.force_pixels = true;
|
||||
self.layout
|
||||
.drag_to_snapped(point, snapping, 6.0 / scale as f64)
|
||||
} else if let Some(spacing) = self.effective_grid(modifiers) {
|
||||
self.layout.drag_to_grid(point, spacing as f64)
|
||||
} else {
|
||||
let mut snapping = self.snapping;
|
||||
|
|
@ -3347,8 +3401,11 @@ impl Editor {
|
|||
let mut origin = area.center() - Vec2::new(sw / 2.0, sh / 2.0) * scale + self.pan * scale;
|
||||
let response = ui.interact(area, egui::Id::new("canvas"), egui::Sense::click_and_drag());
|
||||
let pointer = ui.input(|i| i.pointer.interact_pos());
|
||||
let force_pixels =
|
||||
ui.input(|i| i.key_down(egui::Key::Space) && i.modifiers.shift && !i.modifiers.alt);
|
||||
let temporary_pan = ui.input(|i| {
|
||||
i.key_down(egui::Key::Space) || i.pointer.button_down(egui::PointerButton::Middle)
|
||||
(i.key_down(egui::Key::Space) && !i.modifiers.shift)
|
||||
|| i.pointer.button_down(egui::PointerButton::Middle)
|
||||
});
|
||||
let edit_pointer = self.navigation_tool == NavigationTool::Select && !temporary_pan;
|
||||
let move_pointer = self.navigation_tool == NavigationTool::Move && !temporary_pan;
|
||||
|
|
@ -3505,7 +3562,7 @@ impl Editor {
|
|||
i,
|
||||
corner,
|
||||
point,
|
||||
self.keep_aspect_ratio,
|
||||
self.layout.layer_info(i).keep_aspect_ratio,
|
||||
self.active_resize_mode(),
|
||||
) {
|
||||
self.layout.gesture_error = Some(e);
|
||||
|
|
@ -3563,12 +3620,13 @@ impl Editor {
|
|||
let p = (p - origin) / scale;
|
||||
let point = [p.x as f64, p.y as f64];
|
||||
if let Some(i) = self.pivot_drag.as_ref().map(|(i, _)| *i) {
|
||||
self.move_pivot_snapped(i, point, modifiers, scale);
|
||||
self.move_pivot_snapped(i, point, modifiers, scale, force_pixels);
|
||||
} else if let Some(m) = self.marquee.as_mut() {
|
||||
m.end = point;
|
||||
self.layout.select_region(m.start, point, &m.base);
|
||||
} else {
|
||||
self.snap_guides = self.drag_with_modifiers(point, modifiers, scale);
|
||||
self.snap_guides =
|
||||
self.drag_with_modifiers(point, modifiers, scale, force_pixels);
|
||||
}
|
||||
self.sync();
|
||||
}
|
||||
|
|
@ -3580,12 +3638,13 @@ impl Editor {
|
|||
let p = (p - origin) / scale;
|
||||
let point = [p.x as f64, p.y as f64];
|
||||
if let Some(i) = self.pivot_drag.as_ref().map(|(i, _)| *i) {
|
||||
self.move_pivot_snapped(i, point, modifiers, scale);
|
||||
self.move_pivot_snapped(i, point, modifiers, scale, force_pixels);
|
||||
} else if let Some(m) = self.marquee.as_mut() {
|
||||
m.end = point;
|
||||
self.layout.select_region(m.start, point, &m.base);
|
||||
} else {
|
||||
self.snap_guides = self.drag_with_modifiers(point, modifiers, scale);
|
||||
self.snap_guides =
|
||||
self.drag_with_modifiers(point, modifiers, scale, force_pixels);
|
||||
}
|
||||
self.sync();
|
||||
}
|
||||
|
|
@ -4615,8 +4674,8 @@ fn toolbar_groups(width: f32, captions: bool) -> ([Rect; 19], Vec<Rect>, f32) {
|
|||
&[4, 5],
|
||||
&[6, 7, 8, 9],
|
||||
&[10, 11, 16, 12],
|
||||
&[13, 14],
|
||||
&[17],
|
||||
&[13, 14],
|
||||
] {
|
||||
let cell_width = |slot| match slot {
|
||||
0 | 15 => 68.0,
|
||||
|
|
@ -5338,11 +5397,11 @@ mod tests {
|
|||
app.layout.set_selection([true; 2]);
|
||||
app.sync();
|
||||
let before = app.layout.layers().clone();
|
||||
app.move_pivot_snapped(0, [122.0, 361.0], egui::Modifiers::NONE, 1.0);
|
||||
app.move_pivot_snapped(0, [122.0, 361.0], egui::Modifiers::NONE, 1.0, false);
|
||||
assert_eq!(app.pivot_for(0), [0.0, 0.5]);
|
||||
assert_eq!(app.pivot_for(1), [1.0, 0.5]);
|
||||
assert_eq!(app.snap_guides, [Some(120.0), Some(360.0)]);
|
||||
app.move_pivot_snapped(0, [833.0, 653.0], egui::Modifiers::NONE, 1.0);
|
||||
app.move_pivot_snapped(0, [833.0, 653.0], egui::Modifiers::NONE, 1.0, false);
|
||||
assert_eq!(app.snap_guides, [Some(800.0), Some(700.0)]);
|
||||
app.move_pivot_snapped(
|
||||
0,
|
||||
|
|
@ -5353,6 +5412,7 @@ mod tests {
|
|||
..Default::default()
|
||||
},
|
||||
1.0,
|
||||
false,
|
||||
);
|
||||
assert_eq!(app.snap_guides, [None; 2]);
|
||||
app.snapping.enabled = true;
|
||||
|
|
@ -5364,6 +5424,7 @@ mod tests {
|
|||
..Default::default()
|
||||
},
|
||||
1.0,
|
||||
false,
|
||||
);
|
||||
assert_eq!(app.snap_guides, [None; 2]);
|
||||
assert_ne!(app.pivot_for(0), [0.0, 0.5]);
|
||||
|
|
@ -5917,8 +5978,8 @@ mod tests {
|
|||
&[4, 5],
|
||||
&[6, 7, 8, 9],
|
||||
&[10, 11, 16, 12],
|
||||
&[13, 14],
|
||||
&[17],
|
||||
&[13, 14],
|
||||
] {
|
||||
assert!(
|
||||
slots
|
||||
|
|
@ -5927,6 +5988,12 @@ mod tests {
|
|||
&& buttons[pair[0]].right() < buttons[pair[1]].left())
|
||||
);
|
||||
}
|
||||
let precedes = |first: Rect, second: Rect| {
|
||||
first.top() < second.top()
|
||||
|| (first.top() == second.top() && first.left() < second.left())
|
||||
};
|
||||
assert!(precedes(buttons[17], buttons[13]));
|
||||
assert!(precedes(buttons[13], buttons[14]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6063,7 +6130,8 @@ mod tests {
|
|||
original.x + original.width * 0.25,
|
||||
original.y + original.height * 0.75,
|
||||
];
|
||||
let guides = app.drag_with_modifiers([1837.0, 360.0], egui::Modifiers::NONE, 1.0);
|
||||
let guides =
|
||||
app.drag_with_modifiers([1837.0, 360.0], egui::Modifiers::NONE, 1.0, false);
|
||||
let target = (1837.0 / spacing as f64).round() * spacing as f64;
|
||||
assert_eq!(guides[0], Some(target));
|
||||
let g = app.layout.layers()[1];
|
||||
|
|
@ -6077,9 +6145,9 @@ mod tests {
|
|||
ctrl: spacing == 100,
|
||||
..Default::default()
|
||||
};
|
||||
app.drag_with_modifiers([1173.0, 217.0], modifiers, 1.0);
|
||||
app.drag_with_modifiers([1173.0, 217.0], modifiers, 1.0, false);
|
||||
assert_eq!(app.layout.layers()[1].x, 1173.0);
|
||||
app.drag_with_modifiers([1173.0, 217.0], egui::Modifiers::NONE, 1.0);
|
||||
app.drag_with_modifiers([1173.0, 217.0], egui::Modifiers::NONE, 1.0, false);
|
||||
assert_eq!(
|
||||
app.layout.layers()[1].x,
|
||||
(1173.0 / spacing as f64).round() * spacing as f64
|
||||
|
|
@ -6233,13 +6301,15 @@ mod tests {
|
|||
..Default::default()
|
||||
},
|
||||
0.75,
|
||||
false,
|
||||
);
|
||||
assert_eq!(guides[0], if enabled { None } else { Some(1920.0) });
|
||||
let g = app.layout.layers()[1];
|
||||
assert_eq!(g.x + g.width, if enabled { 1918.0 } else { 1920.0 });
|
||||
assert_eq!(app.snapping, saved);
|
||||
// Releasing Alt restores the stored setting without a pointer move.
|
||||
let guides = app.drag_with_modifiers(point, egui::Modifiers::NONE, 0.75);
|
||||
let guides =
|
||||
app.drag_with_modifiers(point, egui::Modifiers::NONE, 0.75, false);
|
||||
assert_eq!(guides[0], if enabled { Some(1920.0) } else { None });
|
||||
let g = app.layout.layers()[1];
|
||||
assert_eq!(g.x + g.width, if enabled { 1920.0 } else { 1918.0 });
|
||||
|
|
@ -6253,6 +6323,27 @@ mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn shift_space_forces_pixels_instead_of_the_shift_grid() {
|
||||
let mut app = Editor::default();
|
||||
let saved = app.snapping;
|
||||
app.layout.start_drag([1160.0, 180.0]);
|
||||
app.drag_with_modifiers(
|
||||
[1163.6, 184.4],
|
||||
egui::Modifiers {
|
||||
shift: true,
|
||||
..Default::default()
|
||||
},
|
||||
1.0,
|
||||
true,
|
||||
);
|
||||
assert_eq!(
|
||||
[app.layout.layers()[1].x, app.layout.layers()[1].y],
|
||||
[1164.0, 184.0]
|
||||
);
|
||||
assert_eq!(app.snapping, saved);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn quick_and_context_snapping_menus_save_the_same_options_without_editing_layers() {
|
||||
for context in [false, true] {
|
||||
|
|
@ -7183,6 +7274,8 @@ mod tests {
|
|||
frame(&mut app, &ctx, vec![mouse(pos, false)]);
|
||||
}
|
||||
assert!(!app.keep_aspect_ratio);
|
||||
assert!(!app.layout.layer_info(1).keep_aspect_ratio);
|
||||
assert!(app.layout.layer_info(0).keep_aspect_ratio);
|
||||
assert!(app.show_pattern);
|
||||
assert!(app.show_toolbar_icon_names);
|
||||
assert_eq!(*app.layout.layers(), before);
|
||||
|
|
@ -8073,6 +8166,7 @@ mod tests {
|
|||
keep_aspect_ratio: false,
|
||||
..Default::default()
|
||||
};
|
||||
app.layout.set_keep_aspect_ratio(1, false).unwrap();
|
||||
let ctx = egui::Context::default();
|
||||
let output = frame(&mut app, &ctx, vec![]);
|
||||
let rect = layer_rects(&output)[1];
|
||||
|
|
@ -8122,6 +8216,9 @@ mod tests {
|
|||
keep_aspect_ratio,
|
||||
..Default::default()
|
||||
};
|
||||
app.layout
|
||||
.set_keep_aspect_ratio(1, keep_aspect_ratio)
|
||||
.unwrap();
|
||||
let ctx = egui::Context::default();
|
||||
let output = frame(&mut app, &ctx, vec![]);
|
||||
let before = app.layout.layers().clone();
|
||||
|
|
@ -8456,6 +8553,44 @@ mod tests {
|
|||
assert!(texts(&frame(&mut app, &ctx, vec![])).contains(&"Review pasted values".into()));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn import_count_falls_back_to_folder_then_all_and_respects_manual_scope() {
|
||||
for folder_match in [true, false] {
|
||||
let mut app = Editor::default();
|
||||
for i in 0..2 {
|
||||
let id = app.layout.layer_info(i).id;
|
||||
if folder_match || i == 1 {
|
||||
app.layout.move_layer_to_folder(id, "Group", i).unwrap();
|
||||
}
|
||||
}
|
||||
app.layout.select(Some(1));
|
||||
let selection = app.layout.selected_indices();
|
||||
let before = app.project();
|
||||
let mut doc =
|
||||
parse_values(include_str!("../tests/fixtures/drawio-rectangle.txt")).unwrap();
|
||||
doc.shapes.push(doc.shapes[0].clone());
|
||||
app.open_paste(String::new());
|
||||
let p = app.paste.as_mut().unwrap();
|
||||
p.set_document(doc.clone(), &app.layout);
|
||||
assert!(
|
||||
p.scope
|
||||
== if folder_match {
|
||||
ImportScope::Folder("Group".into())
|
||||
} else {
|
||||
ImportScope::All
|
||||
}
|
||||
);
|
||||
assert_eq!(p.mapping, vec![Some(0), Some(1)]);
|
||||
assert!(p.values(&app.layout).is_ok());
|
||||
p.set_scope(ImportScope::Selected, &app.layout);
|
||||
p.set_document(doc, &app.layout);
|
||||
assert!(p.scope == ImportScope::Selected);
|
||||
assert_eq!(p.mapping, vec![Some(1), None]);
|
||||
assert_eq!(app.layout.selected_indices(), selection);
|
||||
assert_eq!(app.project(), before);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn import_scope_filters_destinations_without_changing_selection() {
|
||||
let mut app = Editor::default();
|
||||
|
|
@ -8839,6 +8974,30 @@ mod tests {
|
|||
assert_eq!(app.project(), before);
|
||||
}
|
||||
#[test]
|
||||
fn selected_layer_resolution_row_toggles_layer_properties() {
|
||||
let ctx = egui::Context::default();
|
||||
let mut app = Editor::default();
|
||||
let i = app.layout.selected().unwrap();
|
||||
let geometry = app.layout.layers()[i];
|
||||
let label = format!(
|
||||
"{} × {} px / {}",
|
||||
number(geometry.width),
|
||||
number(geometry.height),
|
||||
ratio_ui::label(geometry.width / geometry.height)
|
||||
);
|
||||
|
||||
click_text(&mut app, &ctx, &label);
|
||||
assert!(
|
||||
app.format_draft
|
||||
.as_ref()
|
||||
.is_some_and(|draft| draft.is_for(i))
|
||||
);
|
||||
assert_eq!(app.property_tab, PropertyTab::Layer);
|
||||
|
||||
click_text(&mut app, &ctx, &label);
|
||||
assert!(app.format_draft.is_none());
|
||||
}
|
||||
#[test]
|
||||
fn snapped_move_and_resize_stay_snapped_on_release_and_undo_as_one_edit() {
|
||||
for resize in [false, true] {
|
||||
for zoom in [0.75, 1.0] {
|
||||
|
|
@ -9635,6 +9794,24 @@ mod tests {
|
|||
frame(app, ctx, vec![mouse(pos, false)]);
|
||||
frame(app, ctx, vec![])
|
||||
}
|
||||
fn open_context_alignment_test_menu(app: &mut Editor, ctx: &egui::Context) -> egui::FullOutput {
|
||||
let output = frame(app, ctx, vec![]);
|
||||
let pos = layer_rects(&output)[1].center();
|
||||
let secondary = |pressed| egui::Event::PointerButton {
|
||||
pos,
|
||||
button: egui::PointerButton::Secondary,
|
||||
pressed,
|
||||
modifiers: egui::Modifiers::NONE,
|
||||
};
|
||||
frame(
|
||||
app,
|
||||
ctx,
|
||||
vec![egui::Event::PointerMoved(pos), secondary(true)],
|
||||
);
|
||||
frame(app, ctx, vec![secondary(false)]);
|
||||
click_text(app, ctx, &tr(ctx, "ui.align"));
|
||||
frame(app, ctx, vec![])
|
||||
}
|
||||
fn alignment_test_position(output: &egui::FullOutput, title: &str) -> Pos2 {
|
||||
let rects: Vec<_> = output
|
||||
.shapes
|
||||
|
|
@ -9773,6 +9950,30 @@ mod tests {
|
|||
}
|
||||
}
|
||||
#[test]
|
||||
fn alignment_target_submenu_selects_a_target_without_closing_alignment() {
|
||||
for context_menu in [false, true] {
|
||||
let mut app = Editor::default();
|
||||
app.layout.set_selection([true; 2]);
|
||||
app.align_target = AlignTarget::Layer(0);
|
||||
let current_target = format!("Layer 1: {}", app.layout.layer_info(0).name);
|
||||
let ctx = egui::Context::default();
|
||||
|
||||
if context_menu {
|
||||
open_context_alignment_test_menu(&mut app, &ctx);
|
||||
} else {
|
||||
open_alignment_test_menu(&mut app, &ctx);
|
||||
}
|
||||
click_text(&mut app, &ctx, ¤t_target);
|
||||
click_text(&mut app, &ctx, "Selected layers");
|
||||
|
||||
assert_eq!(app.align_target, AlignTarget::Selection);
|
||||
let output = frame(&mut app, &ctx, vec![]);
|
||||
assert!(output.shapes.iter().any(
|
||||
|shape| matches!(&shape.shape, egui::Shape::Text(text) if text.galley.text() == "ALIGN TO")
|
||||
));
|
||||
}
|
||||
}
|
||||
#[test]
|
||||
fn top_and_bottom_buttons_align_rendered_edges_for_every_target() {
|
||||
for target in [
|
||||
AlignTarget::Selection,
|
||||
|
|
|
|||
|
|
@ -477,6 +477,7 @@ impl DeviceLink {
|
|||
#[serde(deny_unknown_fields)]
|
||||
pub struct LayerInfo {
|
||||
pub pivot: [f64; 2],
|
||||
pub keep_aspect_ratio: bool,
|
||||
pub load_mapping: Option<DeviceLink>,
|
||||
pub send_mapping: SendMapping,
|
||||
pub id: usize,
|
||||
|
|
@ -574,6 +575,7 @@ impl Default for Layout {
|
|||
info: vec![
|
||||
LayerInfo {
|
||||
pivot: [0.5; 2],
|
||||
keep_aspect_ratio: true,
|
||||
load_mapping: None,
|
||||
send_mapping: Default::default(),
|
||||
id: 2,
|
||||
|
|
@ -582,6 +584,7 @@ impl Default for Layout {
|
|||
},
|
||||
LayerInfo {
|
||||
pivot: [0.5; 2],
|
||||
keep_aspect_ratio: true,
|
||||
load_mapping: None,
|
||||
send_mapping: Default::default(),
|
||||
id: 1,
|
||||
|
|
@ -761,6 +764,7 @@ impl Layout {
|
|||
self.layers.push(g);
|
||||
self.info.push(LayerInfo {
|
||||
pivot: [0.5; 2],
|
||||
keep_aspect_ratio: true,
|
||||
load_mapping: None,
|
||||
send_mapping: Default::default(),
|
||||
id: self.next_id,
|
||||
|
|
@ -1292,6 +1296,22 @@ impl Layout {
|
|||
}
|
||||
self.remember(before);
|
||||
}
|
||||
/// Change the resize lock for one layer as an undoable layer property.
|
||||
pub fn set_keep_aspect_ratio(&mut self, index: usize, keep: bool) -> Result<(), String> {
|
||||
let current = self
|
||||
.info
|
||||
.get(index)
|
||||
.ok_or("Layer no longer exists.")?
|
||||
.keep_aspect_ratio;
|
||||
if current == keep {
|
||||
return Ok(());
|
||||
}
|
||||
self.finish_drag();
|
||||
let before = self.snapshot();
|
||||
self.info[index].keep_aspect_ratio = keep;
|
||||
self.remember(before);
|
||||
Ok(())
|
||||
}
|
||||
/// A single selected layer, or None for zero/multiple selections.
|
||||
pub fn selected(&self) -> Option<usize> {
|
||||
let indices = self.selected_indices();
|
||||
|
|
|
|||
|
|
@ -143,13 +143,6 @@ impl Ink {
|
|||
);
|
||||
self.text(x + 12.0, y + 9.0, label, 13.0, palette.text);
|
||||
}
|
||||
|
||||
fn field(&self, x: f32, y: f32, w: f32, label: &str, value: &str) {
|
||||
let palette = theme::palette(self.painter.ctx());
|
||||
self.text(x, y, label, 12.0, palette.muted);
|
||||
self.card(x, y + 23.0, w, 42.0, palette.field, palette.line);
|
||||
self.text(x + 12.0, y + 34.0, value, 18.0, palette.text);
|
||||
}
|
||||
}
|
||||
|
||||
const SCREEN_LABEL_TOP: f32 = 24.0;
|
||||
|
|
|
|||
|
|
@ -104,6 +104,14 @@ impl Editor {
|
|||
);
|
||||
ui.add_enabled_ui(self.snapping.enabled, |ui| {
|
||||
ui.checkbox(&mut self.snapping.pixels, tr(ui.ctx(), "ui.pixel-edges"));
|
||||
ui.checkbox(
|
||||
&mut self.snapping.force_pixels,
|
||||
tr(ui.ctx(), "ui.force-snapping-to-whole-pixels"),
|
||||
)
|
||||
.on_hover_text(tr(
|
||||
ui.ctx(),
|
||||
"ui.force-whole-pixels-help",
|
||||
));
|
||||
ui.checkbox(
|
||||
&mut self.snapping.screen_edges,
|
||||
tr(ui.ctx(), "ui.screen-edges-center-quarters"),
|
||||
|
|
@ -115,10 +123,7 @@ impl Editor {
|
|||
.on_hover_text("Snap moving outer borders and use other layers’ borders as targets. Independent of masks. Also controls mirrored/opposite resize contact; center and direct resize-handle snapping remain available.");
|
||||
ui.checkbox(&mut self.snapping.mask_edges, tr(ui.ctx(), "ui.mask-edges"));
|
||||
});
|
||||
ui.weak(tr(
|
||||
ui.ctx(),
|
||||
"ui.alt-invert-snapping-shift-10-px-ctrl-shift-100-px",
|
||||
));
|
||||
ui.weak(tr(ui.ctx(), "ui.snapping-modifiers-help"));
|
||||
}
|
||||
pub(super) fn snapping_menu(&mut self, ui: &mut egui::Ui) {
|
||||
ui.menu_button(tr(ui.ctx(), "ui.snapping"), |ui| {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ pub struct Input {
|
|||
#[serde(deny_unknown_fields)]
|
||||
pub struct Layer {
|
||||
pub pivot: [f64; 2],
|
||||
pub keep_aspect_ratio: bool,
|
||||
#[serde(deserialize_with = "deserialize_link")]
|
||||
pub load_mapping: Option<crate::DeviceLink>,
|
||||
pub send_mapping: crate::SendMapping,
|
||||
|
|
@ -103,7 +104,6 @@ pub struct EditorSettings {
|
|||
pub position_point: PositionPoint,
|
||||
#[serde(deserialize_with = "deserialize_layer_point")]
|
||||
pub position_layer_point: Option<PositionPoint>,
|
||||
pub keep_aspect_ratio: bool,
|
||||
pub viewport_zoom: f32,
|
||||
pub viewport_pan: [f32; 2],
|
||||
pub show_source_pattern: bool,
|
||||
|
|
@ -180,7 +180,7 @@ impl Project {
|
|||
folders: layout.folders.clone(),
|
||||
workspace: Workspace::default(),
|
||||
format: FORMAT.into(),
|
||||
version: 20,
|
||||
version: 22,
|
||||
next_layer_id: layout.next_id,
|
||||
output_resolution: layout.formats.output.into(),
|
||||
inputs: (0..layout.formats.sources.len())
|
||||
|
|
@ -196,6 +196,7 @@ impl Project {
|
|||
layers: (0..layout.layers.len())
|
||||
.map(|i| Layer {
|
||||
pivot: layout.info[i].pivot,
|
||||
keep_aspect_ratio: layout.info[i].keep_aspect_ratio,
|
||||
load_mapping: layout.info[i].load_mapping.clone(),
|
||||
send_mapping: layout.info[i].send_mapping.clone(),
|
||||
name: layout.info[i].name.clone(),
|
||||
|
|
@ -220,7 +221,6 @@ impl Project {
|
|||
.collect(),
|
||||
position_point: PositionPoint::TopLeft,
|
||||
position_layer_point: None,
|
||||
keep_aspect_ratio: true,
|
||||
viewport_zoom: 1.0,
|
||||
viewport_pan: [0.0; 2],
|
||||
show_source_pattern: false,
|
||||
|
|
@ -231,9 +231,9 @@ impl Project {
|
|||
}
|
||||
/// Build a fresh document only after validating the entire file. No history is restored.
|
||||
pub fn layout(&self) -> Result<Layout, String> {
|
||||
if self.format != FORMAT || self.version != 20 {
|
||||
if self.format != FORMAT || self.version != 22 {
|
||||
return Err(
|
||||
"Unsupported project format/version; expected beffroi.midra-layout version 20."
|
||||
"Unsupported project format/version; expected beffroi.midra-layout version 22."
|
||||
.into(),
|
||||
);
|
||||
}
|
||||
|
|
@ -323,6 +323,7 @@ impl Project {
|
|||
crate::validate_pivot(layer.pivot)?;
|
||||
layout.info.push(crate::LayerInfo {
|
||||
pivot: layer.pivot,
|
||||
keep_aspect_ratio: layer.keep_aspect_ratio,
|
||||
load_mapping: layer.load_mapping.clone(),
|
||||
send_mapping: layer.send_mapping.clone(),
|
||||
id: layer.id,
|
||||
|
|
@ -428,8 +429,8 @@ impl Project {
|
|||
}
|
||||
let header: Header =
|
||||
serde_json::from_str(text).map_err(|e| format!("Invalid project JSON: {e}"))?;
|
||||
if !(1..=20).contains(&header.version) {
|
||||
return Err("Unsupported project version; expected versions 1–20.".into());
|
||||
if !(1..=22).contains(&header.version) {
|
||||
return Err("Unsupported project version; expected versions 1–22.".into());
|
||||
}
|
||||
let mut migrated: serde_json::Value = if header.version == 1 || header.version == 2 {
|
||||
let mut value: serde_json::Value =
|
||||
|
|
@ -728,6 +729,33 @@ impl Project {
|
|||
}
|
||||
migrated["version"] = 20.into();
|
||||
}
|
||||
if header.version <= 20 {
|
||||
let keep = migrated["editor"]
|
||||
.as_object_mut()
|
||||
.ok_or("Missing editor settings")?
|
||||
.remove("keep_aspect_ratio")
|
||||
.ok_or("Missing aspect-ratio setting")?;
|
||||
let keep: bool = serde_json::from_value(keep)
|
||||
.map_err(|_| "Invalid aspect-ratio setting".to_string())?;
|
||||
for layer in migrated["layers"].as_array_mut().ok_or("Missing layers")? {
|
||||
let layer = layer.as_object_mut().ok_or("Invalid project layer")?;
|
||||
if layer.contains_key("keep_aspect_ratio") {
|
||||
return Err("Unexpected per-layer aspect-ratio setting in old project.".into());
|
||||
}
|
||||
layer.insert("keep_aspect_ratio".into(), keep.into());
|
||||
}
|
||||
migrated["version"] = 21.into();
|
||||
}
|
||||
if header.version <= 21 {
|
||||
let snapping = migrated["workspace"]["snapping"]
|
||||
.as_object_mut()
|
||||
.ok_or("Missing snapping")?;
|
||||
if header.version >= 11 && snapping.contains_key("force_pixels") {
|
||||
return Err("Unexpected force_pixels in old project.".into());
|
||||
}
|
||||
snapping.insert("force_pixels".into(), false.into());
|
||||
migrated["version"] = 22.into();
|
||||
}
|
||||
let p: Self =
|
||||
serde_json::from_value(migrated).map_err(|e| format!("Invalid project JSON: {e}"))?;
|
||||
p.layout()?;
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ pub fn from_json(text: &str) -> Result<LoadedProject, String> {
|
|||
}
|
||||
let version = raw["version"]
|
||||
.as_u64()
|
||||
.filter(|v| (1..=20).contains(v))
|
||||
.ok_or("Unsupported project version; expected versions 1–20.")?;
|
||||
.filter(|v| (1..=22).contains(v))
|
||||
.ok_or("Unsupported project version; expected versions 1–22.")?;
|
||||
let mut warnings = Vec::new();
|
||||
if let Some(proposals) = raw.as_object_mut().unwrap().remove("input_proposals") {
|
||||
if proposals != serde_json::json!([]) {
|
||||
|
|
@ -183,6 +183,7 @@ pub fn from_json(text: &str) -> Result<LoadedProject, String> {
|
|||
"name",
|
||||
"folder",
|
||||
"pivot",
|
||||
"keep_aspect_ratio",
|
||||
"visible",
|
||||
"locked",
|
||||
"load_mapping",
|
||||
|
|
|
|||
|
|
@ -131,7 +131,6 @@ impl Editor {
|
|||
p.editor.position_point = self.corner;
|
||||
p.editor.position_layer_point = self.position_layer_point;
|
||||
p.editor.backdrop_title = self.backdrop_title.clone();
|
||||
p.editor.keep_aspect_ratio = self.keep_aspect_ratio;
|
||||
p.editor.viewport_zoom = self.zoom;
|
||||
p.editor.viewport_pan = [self.pan.x, self.pan.y];
|
||||
p.editor.show_source_pattern = self.show_pattern;
|
||||
|
|
@ -218,7 +217,7 @@ impl Editor {
|
|||
corner: e.position_point,
|
||||
position_layer_point: e.position_layer_point,
|
||||
backdrop_title: e.backdrop_title,
|
||||
keep_aspect_ratio: e.keep_aspect_ratio,
|
||||
keep_aspect_ratio: true,
|
||||
zoom: e.viewport_zoom,
|
||||
pan: Vec2::from(e.viewport_pan),
|
||||
show_pattern: e.show_source_pattern,
|
||||
|
|
@ -1029,7 +1028,8 @@ mod tests {
|
|||
app.corner = PositionPoint::TopLeft;
|
||||
app.position_layer_point = Some(PositionPoint::Center);
|
||||
app.backdrop_title = "Conference 2027 · Main stage".into();
|
||||
app.keep_aspect_ratio = false;
|
||||
app.layout.set_keep_aspect_ratio(1, false).unwrap();
|
||||
app.sync();
|
||||
app.show_pattern = true;
|
||||
app.show_toolbar_icon_names = true;
|
||||
app.layout
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ pub struct Settings {
|
|||
impl Default for Settings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
version: 15,
|
||||
version: 16,
|
||||
ui_scale: 1.0,
|
||||
text_scale: None,
|
||||
language: Default::default(),
|
||||
|
|
@ -74,7 +74,13 @@ impl Settings {
|
|||
}
|
||||
value["snapping"] = serde_json::to_value(canvas_pilot::snapping::Snapping::default())
|
||||
.map_err(|e| e.to_string())?;
|
||||
for field in ["grid", "show_grid", "grid_divisions", "mask_edges"] {
|
||||
for field in [
|
||||
"grid",
|
||||
"show_grid",
|
||||
"grid_divisions",
|
||||
"mask_edges",
|
||||
"force_pixels",
|
||||
] {
|
||||
value["snapping"].as_object_mut().unwrap().remove(field);
|
||||
}
|
||||
value["version"] = 3.into();
|
||||
|
|
@ -181,18 +187,28 @@ impl Settings {
|
|||
snapping.insert("mask_edges".into(), false.into());
|
||||
value["version"] = 14.into();
|
||||
}
|
||||
if matches!(value["version"].as_u64(), Some(14 | 15)) && value.get("text_scale").is_none() {
|
||||
if matches!(value["version"].as_u64(), Some(14..=16)) && value.get("text_scale").is_none() {
|
||||
return Err("Missing text_scale in current settings".into());
|
||||
}
|
||||
if value["version"] == 14 {
|
||||
value["version"] = 15.into();
|
||||
}
|
||||
if value["version"] == 15 {
|
||||
let snapping = value["snapping"]
|
||||
.as_object_mut()
|
||||
.ok_or("Missing snapping")?;
|
||||
if snapping.contains_key("force_pixels") {
|
||||
return Err("Unexpected force_pixels in old settings".into());
|
||||
}
|
||||
snapping.insert("force_pixels".into(), false.into());
|
||||
value["version"] = 16.into();
|
||||
}
|
||||
let settings: Self = serde_json::from_value(value).map_err(|e| e.to_string())?;
|
||||
settings.validate()?;
|
||||
Ok(settings)
|
||||
}
|
||||
fn validate(&self) -> Result<(), String> {
|
||||
if self.version != 15 {
|
||||
if self.version != 16 {
|
||||
return Err(format!("unsupported settings version {}", self.version));
|
||||
}
|
||||
for theme in std::iter::once(&self.theme).chain(&self.recent_themes) {
|
||||
|
|
@ -346,7 +362,7 @@ mod tests {
|
|||
let legacy =
|
||||
include_str!("../../../docs/interfaces/canvas-pilot-settings-v14.example.json");
|
||||
let current =
|
||||
include_str!("../../../docs/interfaces/canvas-pilot-settings-v15.example.json");
|
||||
include_str!("../../../docs/interfaces/canvas-pilot-settings-v16.example.json");
|
||||
assert_eq!(
|
||||
Settings::parse(legacy).unwrap(),
|
||||
Settings::parse(current).unwrap()
|
||||
|
|
@ -359,7 +375,7 @@ mod tests {
|
|||
assert_eq!(serde_json::to_value(saved).unwrap(), value);
|
||||
value["version"] = 14.into();
|
||||
assert!(Settings::parse(&value.to_string()).is_err());
|
||||
value["version"] = 15.into();
|
||||
value["version"] = 16.into();
|
||||
for id in ["", "no-slash", "../theme", "pack/a/b", "pack/Upper"] {
|
||||
value["theme"] = serde_json::json!({"pack":id});
|
||||
value["recent_themes"][0] = value["theme"].clone();
|
||||
|
|
@ -372,7 +388,7 @@ mod tests {
|
|||
let legacy =
|
||||
include_str!("../../../docs/interfaces/canvas-pilot-settings-v13.example.json");
|
||||
let current =
|
||||
include_str!("../../../docs/interfaces/canvas-pilot-settings-v15.example.json");
|
||||
include_str!("../../../docs/interfaces/canvas-pilot-settings-v16.example.json");
|
||||
assert_eq!(
|
||||
Settings::parse(legacy).unwrap(),
|
||||
Settings::parse(current).unwrap()
|
||||
|
|
@ -392,6 +408,28 @@ mod tests {
|
|||
assert!(Settings::parse(&value.to_string()).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn forced_pixel_snapping_migrates_disabled_and_round_trips() {
|
||||
let legacy =
|
||||
include_str!("../../../docs/interfaces/canvas-pilot-settings-v15.example.json");
|
||||
let current =
|
||||
include_str!("../../../docs/interfaces/canvas-pilot-settings-v16.example.json");
|
||||
assert_eq!(
|
||||
Settings::parse(legacy).unwrap(),
|
||||
Settings::parse(current).unwrap()
|
||||
);
|
||||
let mut value: serde_json::Value = serde_json::from_str(current).unwrap();
|
||||
value["snapping"]["force_pixels"] = true.into();
|
||||
assert!(
|
||||
Settings::parse(&value.to_string())
|
||||
.unwrap()
|
||||
.snapping
|
||||
.force_pixels
|
||||
);
|
||||
value["version"] = 15.into();
|
||||
assert!(Settings::parse(&value.to_string()).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn scaling_migrates_and_round_trips_with_strict_limits() {
|
||||
let old = include_str!("../../../docs/interfaces/canvas-pilot-settings-v10.example.json");
|
||||
|
|
@ -461,7 +499,7 @@ mod tests {
|
|||
let old = include_str!("../../../docs/interfaces/canvas-pilot-settings-v8.example.json");
|
||||
let migrated = Settings::parse(old).unwrap();
|
||||
assert_eq!(migrated.language, Language::System);
|
||||
assert_eq!(migrated.version, 15);
|
||||
assert_eq!(migrated.version, 16);
|
||||
let current =
|
||||
include_str!("../../../docs/interfaces/canvas-pilot-settings-v10.example.json");
|
||||
assert_eq!(Settings::parse(current).unwrap(), migrated);
|
||||
|
|
@ -470,13 +508,14 @@ mod tests {
|
|||
let mut old: serde_json::Value = serde_json::from_str(v9).unwrap();
|
||||
old["language"] = old_language.into();
|
||||
let upgraded = Settings::parse(&old.to_string()).unwrap();
|
||||
assert_eq!(upgraded.version, 15);
|
||||
assert_eq!(upgraded.version, 16);
|
||||
assert_eq!(
|
||||
serde_json::to_value(&upgraded.language).unwrap(),
|
||||
old["language"]
|
||||
);
|
||||
old["version"] = 15.into();
|
||||
old["version"] = 16.into();
|
||||
old["snapping"]["mask_edges"] = false.into();
|
||||
old["snapping"]["force_pixels"] = false.into();
|
||||
old["ui_scale"] = serde_json::json!(1.0);
|
||||
old["text_scale"] = serde_json::Value::Null;
|
||||
assert_eq!(serde_json::to_value(upgraded).unwrap(), old);
|
||||
|
|
@ -518,8 +557,9 @@ mod tests {
|
|||
assert!(Settings::parse(&value.to_string()).is_err());
|
||||
value["version"] = 13.into();
|
||||
let saved = Settings::parse(&value.to_string()).unwrap();
|
||||
value["version"] = 15.into();
|
||||
value["version"] = 16.into();
|
||||
value["snapping"]["mask_edges"] = false.into();
|
||||
value["snapping"]["force_pixels"] = false.into();
|
||||
assert_eq!(serde_json::to_value(saved).unwrap(), value);
|
||||
for id in ["", "../uk", "uk_UA"] {
|
||||
value["language"] = serde_json::json!({"pack":id});
|
||||
|
|
@ -554,8 +594,9 @@ mod tests {
|
|||
value["ui_scale"] = 1.5.into();
|
||||
value["text_scale"] = 1.25.into();
|
||||
let saved = Settings::parse(&value.to_string()).unwrap();
|
||||
value["version"] = 15.into();
|
||||
value["version"] = 16.into();
|
||||
value["snapping"]["mask_edges"] = false.into();
|
||||
value["snapping"]["force_pixels"] = false.into();
|
||||
assert_eq!(serde_json::to_value(saved).unwrap(), value);
|
||||
}
|
||||
}
|
||||
|
|
@ -628,7 +669,7 @@ mod tests {
|
|||
for text in [
|
||||
"broken".to_string(),
|
||||
serde_json::to_string(&Settings {
|
||||
version: 16,
|
||||
version: 17,
|
||||
..Default::default()
|
||||
})
|
||||
.unwrap(),
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ fn pixel_magnet(value: f64) -> Option<f64> {
|
|||
pub struct Snapping {
|
||||
pub enabled: bool,
|
||||
pub pixels: bool,
|
||||
pub force_pixels: bool,
|
||||
pub screen_edges: bool,
|
||||
pub layer_edges: bool,
|
||||
pub mask_edges: bool,
|
||||
|
|
@ -27,6 +28,7 @@ impl Default for Snapping {
|
|||
Self {
|
||||
enabled: false,
|
||||
pixels: true,
|
||||
force_pixels: false,
|
||||
screen_edges: true,
|
||||
layer_edges: true,
|
||||
mask_edges: false,
|
||||
|
|
@ -151,6 +153,9 @@ impl Layout {
|
|||
if !options.enabled {
|
||||
return (point, [None; 2]);
|
||||
}
|
||||
if options.force_pixels {
|
||||
return (point.map(f64::round), [None; 2]);
|
||||
}
|
||||
let mut target = point;
|
||||
let mut guides = [None; 2];
|
||||
for axis in 0..2 {
|
||||
|
|
@ -216,6 +221,13 @@ impl Layout {
|
|||
}
|
||||
};
|
||||
for axis in 0..2 {
|
||||
if options.force_pixels {
|
||||
if let Some(i) = selected.iter().position(|v| *v) {
|
||||
let coordinate = edge(before.layers[i], axis)[0] + delta[axis];
|
||||
delta[axis] += coordinate.round() - coordinate;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
let mut targets = Vec::new();
|
||||
if options.screen_edges {
|
||||
targets.extend(screen_guides(self.formats.output[axis]));
|
||||
|
|
@ -417,18 +429,22 @@ impl Layout {
|
|||
}
|
||||
}
|
||||
}
|
||||
if let Some(target) = targets
|
||||
.into_iter()
|
||||
.filter(|t| (*t - current[axis]).abs() <= tolerance)
|
||||
.min_by(|a, b| {
|
||||
(a - current[axis])
|
||||
.abs()
|
||||
.total_cmp(&(b - current[axis]).abs())
|
||||
})
|
||||
if !options.force_pixels
|
||||
&& let Some(target) = targets
|
||||
.into_iter()
|
||||
.filter(|t| (*t - current[axis]).abs() <= tolerance)
|
||||
.min_by(|a, b| {
|
||||
(a - current[axis])
|
||||
.abs()
|
||||
.total_cmp(&(b - current[axis]).abs())
|
||||
})
|
||||
{
|
||||
candidates.push((1, (target - current[axis]).abs(), axis, target, None));
|
||||
}
|
||||
if options.layer_edges && matches!(r.mode, ResizeMode::Mirror | ResizeMode::Opposite) {
|
||||
if !options.force_pixels
|
||||
&& options.layer_edges
|
||||
&& matches!(r.mode, ResizeMode::Mirror | ResizeMode::Opposite)
|
||||
{
|
||||
let original = r.before.layers[r.index];
|
||||
let moving = handle_point(original)[axis];
|
||||
let anchor = r.anchor(r.index)[axis];
|
||||
|
|
@ -464,11 +480,12 @@ impl Layout {
|
|||
}
|
||||
}
|
||||
}
|
||||
if options.pixels {
|
||||
if options.pixels || options.force_pixels {
|
||||
let spacing = grid.unwrap_or(1.0);
|
||||
let target = (current[axis] / spacing).round() * spacing;
|
||||
if grid.is_some() || pixel_magnet(current[axis]).is_some() {
|
||||
candidates.push((2, (target - current[axis]).abs(), axis, target, None));
|
||||
if grid.is_some() || options.force_pixels || pixel_magnet(current[axis]).is_some() {
|
||||
let priority = if options.force_pixels { 0 } else { 2 };
|
||||
candidates.push((priority, (target - current[axis]).abs(), axis, target, None));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -517,6 +534,26 @@ impl Layout {
|
|||
&& touching
|
||||
&& (handle_point(self.layers[r.index])[axis] - target).abs() < 1e-6
|
||||
{
|
||||
if options.force_pixels {
|
||||
let mut rounded = self.layers.clone();
|
||||
for (i, geometry) in rounded.iter_mut().enumerate() {
|
||||
if !r.targets[i] {
|
||||
continue;
|
||||
}
|
||||
let right = (geometry.x + geometry.width).round();
|
||||
let bottom = (geometry.y + geometry.height).round();
|
||||
geometry.x = geometry.x.round();
|
||||
geometry.y = geometry.y.round();
|
||||
geometry.width = right - geometry.x;
|
||||
geometry.height = bottom - geometry.y;
|
||||
}
|
||||
if rounded.iter().all(|geometry| geometry.validate().is_ok()) {
|
||||
self.layers = rounded;
|
||||
} else {
|
||||
self.restore(base.clone());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
let mut guides = [None; 2];
|
||||
if priority < 2 || grid.is_some() {
|
||||
guides[axis] = Some(target);
|
||||
|
|
@ -556,4 +593,47 @@ mod tests {
|
|||
layout.drag_to_snapped([1800.4, 360.0], pixels_only(), 6.0);
|
||||
assert!((layout.layers()[1].x + layout.layers()[1].width - 1800.4).abs() < 1e-9);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn forced_pixels_round_moves_and_resize_handles_outside_the_soft_magnet() {
|
||||
let options = Snapping {
|
||||
enabled: true,
|
||||
force_pixels: true,
|
||||
screen_edges: false,
|
||||
layer_edges: false,
|
||||
..Default::default()
|
||||
};
|
||||
let mut layout = Layout::default();
|
||||
layout.start_drag([1160.0, 180.0]);
|
||||
layout.drag_to_snapped([1163.6, 184.4], options, 6.0);
|
||||
assert_eq!(
|
||||
[layout.layers()[1].x, layout.layers()[1].y],
|
||||
[1164.0, 184.0]
|
||||
);
|
||||
layout.finish_drag();
|
||||
|
||||
layout.start_handle_resize(1, ResizeHandle::Right, [1804.0, 364.0], false);
|
||||
layout.drag_to_snapped([1804.6, 364.0], options, 6.0);
|
||||
assert_eq!(layout.layers()[1].x + layout.layers()[1].width, 1805.0);
|
||||
|
||||
let mut ratio_layout = Layout::default();
|
||||
let original_ratio = ratio_layout.layers()[1].width / ratio_layout.layers()[1].height;
|
||||
ratio_layout.start_handle_resize(
|
||||
1,
|
||||
ResizeHandle::Corner(crate::Corner::BottomRight),
|
||||
[1800.0, 540.0],
|
||||
true,
|
||||
);
|
||||
ratio_layout.drag_to_snapped([1801.4, 540.8], options, 6.0);
|
||||
let resized = ratio_layout.layers()[1];
|
||||
for edge in [
|
||||
resized.x,
|
||||
resized.y,
|
||||
resized.x + resized.width,
|
||||
resized.y + resized.height,
|
||||
] {
|
||||
assert_eq!(edge.fract(), 0.0);
|
||||
}
|
||||
assert!((resized.width / resized.height - original_ratio).abs() > 1e-9);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ fn family_links_save_migrate_recover_and_validate() {
|
|||
let mut old: Value = serde_json::from_str(old).unwrap();
|
||||
old["layers"][0]["midra_link"] = json!({"screen":"001","layer":"02"});
|
||||
let p = Project::from_json(&old.to_string()).unwrap();
|
||||
assert_eq!(p.version, 20);
|
||||
assert_eq!(p.version, 22);
|
||||
assert_eq!(
|
||||
p.layers[0].load_mapping.as_ref().unwrap().family,
|
||||
Family::Midra4k
|
||||
|
|
@ -300,7 +300,7 @@ fn documented_v13_example_contains_native_aquilon_link() {
|
|||
"../../../docs/interfaces/canvas-pilot-v13.example.json"
|
||||
))
|
||||
.unwrap();
|
||||
assert_eq!(p.version, 20);
|
||||
assert_eq!(p.version, 22);
|
||||
let link = p.layers[0].load_mapping.as_ref().unwrap();
|
||||
assert_eq!(link.family, Family::Aquilon);
|
||||
assert_eq!(link.screen, "S1");
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ fn v18_migration_synchronizes_links_and_v19_requires_both_directions() {
|
|||
let project = canvas_pilot::project_recovery::from_json(old)
|
||||
.unwrap()
|
||||
.project;
|
||||
assert_eq!(project.version, 20);
|
||||
assert_eq!(project.version, 22);
|
||||
for layer in &project.layers {
|
||||
assert_eq!(
|
||||
layer.send_mapping,
|
||||
|
|
@ -64,7 +64,7 @@ fn v18_migration_synchronizes_links_and_v19_requires_both_directions() {
|
|||
assert_eq!(
|
||||
project,
|
||||
Project::from_json(include_str!(
|
||||
"../../../docs/interfaces/canvas-pilot-v20.example.json"
|
||||
"../../../docs/interfaces/canvas-pilot-v22.example.json"
|
||||
))
|
||||
.unwrap()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ fn every_snapshot_codec_roundtrips_all_fit_modes_masks_sources_links_and_workspa
|
|||
p.editor.show_source_pattern = true;
|
||||
p.editor.viewport_zoom = 1.75;
|
||||
p.editor.backdrop_title = "Round trip".into();
|
||||
p.editor.keep_aspect_ratio = false;
|
||||
p.layers[0].keep_aspect_ratio = false;
|
||||
p.editor.outline_layers = true;
|
||||
p.editor.show_toolbar_icon_names = true;
|
||||
p.workspace.resize_mode = canvas_pilot::ResizeMode::Mirror;
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ fn explicit_empty_folders_survive_history_save_rename_and_membership_changes() {
|
|||
fn version_12_explicit_folder_validation_and_v11_migration() {
|
||||
let old = include_str!("../../../docs/interfaces/canvas-pilot-v11.example.json");
|
||||
let p = Project::from_json(old).unwrap();
|
||||
assert_eq!(p.version, 20);
|
||||
assert_eq!(p.version, 22);
|
||||
assert!(p.folders.is_empty());
|
||||
let example = include_str!("../../../docs/interfaces/canvas-pilot-v12.example.json");
|
||||
assert_eq!(
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ fn explicit_fit_survives_resize_undo_reordering_and_project_roundtrip() {
|
|||
layout.apply(0, box_geometry()).unwrap();
|
||||
assert_eq!(layout.formats().advanced[0], crop);
|
||||
let before = Project::from_layout(&layout);
|
||||
assert_eq!(before.version, 20);
|
||||
assert_eq!(before.version, 22);
|
||||
let loaded = Project::from_json(&before.to_json().unwrap()).unwrap();
|
||||
assert_eq!(loaded, before);
|
||||
assert_eq!(
|
||||
|
|
@ -107,7 +107,7 @@ fn explicit_fit_survives_resize_undo_reordering_and_project_roundtrip() {
|
|||
fn v13_migration_defaults_to_normal_crop_and_v14_requires_valid_fit() {
|
||||
let text = include_str!("../../../docs/interfaces/canvas-pilot-v13.example.json");
|
||||
let migrated = Project::from_json(text).unwrap();
|
||||
assert_eq!(migrated.version, 20);
|
||||
assert_eq!(migrated.version, 22);
|
||||
assert!(migrated.layers.iter().all(|l| l.layer_fit.is_none()));
|
||||
let mut json = serde_json::to_value(&migrated).unwrap();
|
||||
json["layers"][0]
|
||||
|
|
@ -125,7 +125,7 @@ fn current_documented_example_is_valid() {
|
|||
"../../../docs/interfaces/canvas-pilot-v14.example.json"
|
||||
))
|
||||
.unwrap();
|
||||
assert_eq!(p.version, 20);
|
||||
assert_eq!(p.version, 22);
|
||||
p.layout().unwrap();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ fn mask_schema_migration_validation_reorder_resize_and_atomic_import() {
|
|||
let migrated = canvas_pilot::project_recovery::from_json(old)
|
||||
.unwrap()
|
||||
.project;
|
||||
assert_eq!(migrated.version, 20);
|
||||
assert_eq!(migrated.version, 22);
|
||||
assert!(migrated.layers.iter().all(|l| l.mask == Mask::default()));
|
||||
let mut json = serde_json::to_value(&p).unwrap();
|
||||
json["layers"][0].as_object_mut().unwrap().remove("mask");
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ fn persistent_device_links_roundtrip_migrate_and_undo() {
|
|||
include_str!("../../../docs/interfaces/canvas-pilot-v5.example.json"),
|
||||
] {
|
||||
let p = Project::from_json(text).unwrap();
|
||||
assert_eq!(p.version, 20);
|
||||
assert_eq!(p.version, 22);
|
||||
assert!(p.layers.iter().all(|l| l.load_mapping.is_none()));
|
||||
}
|
||||
let mut value = serde_json::to_value(&project).unwrap();
|
||||
|
|
@ -304,7 +304,7 @@ fn position_point_schema_migrates_corners_and_rejects_mislabeled_files() {
|
|||
.unwrap();
|
||||
old["editor"]["position_corner"] = name.into();
|
||||
let loaded = Project::from_json(&old.to_string()).unwrap();
|
||||
assert_eq!(loaded.version, 20);
|
||||
assert_eq!(loaded.version, 22);
|
||||
assert_eq!(loaded.editor.position_point, expected);
|
||||
old["editor"]["position_corner"] = "center".into();
|
||||
assert!(Project::from_json(&old.to_string()).is_err());
|
||||
|
|
@ -313,7 +313,7 @@ fn position_point_schema_migrates_corners_and_rejects_mislabeled_files() {
|
|||
assert!(Project::from_json(&old.to_string()).is_err());
|
||||
}
|
||||
let value: serde_json::Value = serde_json::from_str(¤t.to_json().unwrap()).unwrap();
|
||||
for version in [0, 21] {
|
||||
for version in [0, 23] {
|
||||
let mut invalid = value.clone();
|
||||
invalid["version"] = version.into();
|
||||
assert!(
|
||||
|
|
@ -354,7 +354,7 @@ fn backdrop_title_roundtrips_and_older_projects_gain_the_default() {
|
|||
}
|
||||
let old = include_str!("../../../docs/interfaces/canvas-pilot-v6.example.json");
|
||||
let migrated = Project::from_json(old).unwrap();
|
||||
assert_eq!(migrated.version, 20);
|
||||
assert_eq!(migrated.version, 22);
|
||||
assert_eq!(migrated.editor.backdrop_title, DEFAULT_BACKDROP_TITLE);
|
||||
let mut invalid: serde_json::Value = serde_json::from_str(old).unwrap();
|
||||
invalid["editor"]["backdrop_title"] = "Unexpected".into();
|
||||
|
|
@ -425,7 +425,7 @@ fn saved_pivots_roundtrip_and_old_projects_default_to_center() {
|
|||
assert_eq!(loaded.layer_info(0).pivot, custom);
|
||||
assert_eq!(loaded.layer_info(1).pivot, [0.5; 2]);
|
||||
let example = include_str!("../../../docs/interfaces/canvas-pilot-v9.example.json");
|
||||
assert_eq!(Project::from_json(example).unwrap().version, 20);
|
||||
assert_eq!(Project::from_json(example).unwrap().version, 22);
|
||||
let old = include_str!("../../../docs/interfaces/canvas-pilot-v8.example.json");
|
||||
let migrated = Project::from_json(old).unwrap();
|
||||
assert!(migrated.layers.iter().all(|l| l.pivot == [0.5; 2]));
|
||||
|
|
@ -447,6 +447,65 @@ fn saved_pivots_roundtrip_and_old_projects_default_to_center() {
|
|||
assert!(Project::from_json(&value.to_string()).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn aspect_ratio_lock_is_per_layer_undoable_and_migrates_from_v20() {
|
||||
let mut layout = Layout::default();
|
||||
layout.set_keep_aspect_ratio(0, false).unwrap();
|
||||
assert!(!layout.layer_info(0).keep_aspect_ratio);
|
||||
assert!(layout.layer_info(1).keep_aspect_ratio);
|
||||
layout.undo();
|
||||
assert!(layout.layer_info(0).keep_aspect_ratio);
|
||||
layout.redo();
|
||||
assert!(!layout.layer_info(0).keep_aspect_ratio);
|
||||
|
||||
let project = Project::from_json(&Project::from_layout(&layout).to_json().unwrap()).unwrap();
|
||||
assert!(!project.layers[0].keep_aspect_ratio);
|
||||
assert!(project.layers[1].keep_aspect_ratio);
|
||||
assert_eq!(
|
||||
Project::from_json(include_str!(
|
||||
"../../../docs/interfaces/canvas-pilot-v22.example.json"
|
||||
))
|
||||
.unwrap()
|
||||
.version,
|
||||
22
|
||||
);
|
||||
|
||||
let mut old: serde_json::Value = serde_json::from_str(include_str!(
|
||||
"../../../docs/interfaces/canvas-pilot-v20.example.json"
|
||||
))
|
||||
.unwrap();
|
||||
old["editor"]["keep_aspect_ratio"] = false.into();
|
||||
let migrated = Project::from_json(&old.to_string()).unwrap();
|
||||
assert!(migrated.layers.iter().all(|layer| !layer.keep_aspect_ratio));
|
||||
|
||||
let mut missing = serde_json::to_value(project).unwrap();
|
||||
missing["layers"][0]
|
||||
.as_object_mut()
|
||||
.unwrap()
|
||||
.remove("keep_aspect_ratio");
|
||||
assert!(Project::from_json(&missing.to_string()).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn forced_pixel_snapping_migrates_from_v21_and_is_strict() {
|
||||
let old = include_str!("../../../docs/interfaces/canvas-pilot-v21.example.json");
|
||||
let current = include_str!("../../../docs/interfaces/canvas-pilot-v22.example.json");
|
||||
assert_eq!(
|
||||
Project::from_json(old).unwrap(),
|
||||
Project::from_json(current).unwrap()
|
||||
);
|
||||
|
||||
let mut project = Project::from_json(current).unwrap();
|
||||
project.workspace.snapping.force_pixels = true;
|
||||
assert_eq!(
|
||||
Project::from_json(&project.to_json().unwrap()).unwrap(),
|
||||
project
|
||||
);
|
||||
let mut mislabeled = serde_json::to_value(project).unwrap();
|
||||
mislabeled["version"] = 21.into();
|
||||
assert!(Project::from_json(&mislabeled.to_string()).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reference_collection_migrates_single_images_and_rejects_mislabeled_or_oversized_collections() {
|
||||
use base64::{Engine, engine::general_purpose::STANDARD};
|
||||
|
|
@ -457,7 +516,7 @@ fn reference_collection_migrates_single_images_and_rejects_mislabeled_or_oversiz
|
|||
let reference = serde_json::json!({"name":"guide.png","image_base64":STANDARD.encode(b"image bytes"),"visible":false,"opacity":0.4,"preserve_ratio":true,"native_size":false,"offset":[0.0,0.0]});
|
||||
old["reference"] = reference.clone();
|
||||
let migrated = Project::from_json(&old.to_string()).unwrap();
|
||||
assert_eq!(migrated.version, 20);
|
||||
assert_eq!(migrated.version, 22);
|
||||
assert_eq!(migrated.references.len(), 1);
|
||||
assert!(!migrated.references[0].visible);
|
||||
assert_eq!(migrated.references[0].opacity, 0.4);
|
||||
|
|
@ -477,7 +536,7 @@ fn reference_collection_migrates_single_images_and_rejects_mislabeled_or_oversiz
|
|||
gallery.references = vec![migrated.references[0].clone(); 33];
|
||||
assert!(gallery.to_json().unwrap_err().contains("32 reference"));
|
||||
let example = include_str!("../../../docs/interfaces/canvas-pilot-v10.example.json");
|
||||
assert_eq!(Project::from_json(example).unwrap().version, 20);
|
||||
assert_eq!(Project::from_json(example).unwrap().version, 22);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ fn valid_project_round_trip_is_exact_without_warnings_or_retired_fields() {
|
|||
let loaded = from_json(&text).unwrap();
|
||||
assert!(loaded.warnings.is_empty());
|
||||
assert_eq!(loaded.project, project);
|
||||
assert_eq!(loaded.project.version, 20);
|
||||
assert_eq!(loaded.project.version, 22);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ fn resize_can_bypass_snapping_and_cancel() {
|
|||
let options = Snapping {
|
||||
enabled: true,
|
||||
pixels: false,
|
||||
force_pixels: false,
|
||||
screen_edges: true,
|
||||
layer_edges: false,
|
||||
..Default::default()
|
||||
|
|
@ -649,6 +650,7 @@ fn overlay_grid_snaps_moves_resizes_and_pivots_with_fractional_divisions() {
|
|||
let options = Snapping {
|
||||
enabled: true,
|
||||
pixels: false,
|
||||
force_pixels: false,
|
||||
screen_edges: false,
|
||||
layer_edges: true,
|
||||
grid: true,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,63 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
### v0.10.10
|
||||
|
||||
- Disclose the project's MIT license, LLM-generated or LLM-assisted development,
|
||||
human review and professional use in the public README.
|
||||
- The pinned mdBook build passes, validating 25 HTML pages and 1,660 local
|
||||
links/assets.
|
||||
|
||||
### v0.10.9
|
||||
|
||||
- Add optional forced whole-pixel snapping for moves, resizes and pivots, with a
|
||||
temporary Shift+Space modifier. The existing soft pixel magnet remains the default.
|
||||
|
||||
### v0.10.8
|
||||
|
||||
- Remove inspector Copy/Paste buttons, including the multi-selection Copy button,
|
||||
while retaining clipboard shortcuts and context-menu actions.
|
||||
|
||||
### v0.10.7
|
||||
|
||||
- Pre-map geometry imports by exact included-item count: selected layers, their
|
||||
shared folder, then all available layers. Manual scope and mapping remain available.
|
||||
|
||||
### v0.10.6
|
||||
|
||||
- Keep the alignment menu open while choosing its target, making **Selected
|
||||
layers** and individual layer targets usable from both the toolbar and canvas
|
||||
context menu.
|
||||
|
||||
### v0.10.5
|
||||
|
||||
- Place **Size presets** before **Output format** and **Viewport options** in the
|
||||
canvas toolbar, including when toolbar groups wrap onto another row.
|
||||
|
||||
### v0.10.4
|
||||
|
||||
- Make the selected layer's resolution row toggle its Layer properties window:
|
||||
click once to open it and again to close it, preserving the existing review
|
||||
prompt when the window contains unapplied edits.
|
||||
|
||||
### v0.10.3
|
||||
|
||||
- Tighten the selected-layer inspector spacing around crop, measurement, geometry
|
||||
and ratio controls, keeping the same controls visible in less vertical space.
|
||||
|
||||
### v0.10.2
|
||||
|
||||
- Store **Keep aspect ratio when resizing** on each layer, so layers can use
|
||||
different resize behavior. The choice is undoable, survives reordering and
|
||||
project round trips, and old project-wide choices migrate to every layer.
|
||||
|
||||
### v0.10.1
|
||||
|
||||
- Size the right inspector to its visible empty/reference message when no layer is
|
||||
selected, removing the long blank scroll range while retaining scrolling for
|
||||
layer properties and long layer/reference lists. Remove the duplicated read-only
|
||||
**Visible box / center position** block and pull the copy/paste actions upward.
|
||||
|
||||
## v0.10.0-rc.18 — 2026-11-19
|
||||
|
||||
Published release candidate collecting the extreme-zoom performance fix and
|
||||
|
|
|
|||
|
|
@ -108,8 +108,12 @@ to 16 MiB; a failed document leaves the batch unapplied and reports its filename
|
|||
no additional file/paste buttons inside the review. Multiple documents/pages
|
||||
retain their page chooser.
|
||||
3. Under **Destination layers**, choose **All layers**, **Selected layers**, or
|
||||
**Folder: …**. Existing selection initially scopes and pre-maps the import;
|
||||
with no selection, choose destinations individually from All layers. Changing
|
||||
**Folder: …**. Imports try exact included-item counts against the selection, then all
|
||||
available layers in its shared folder, then all available layers. Background
|
||||
items and hidden/locked destinations do not count. Selections spanning folders
|
||||
skip the folder fallback. Matches map in layer order; review before applying.
|
||||
If no count matches, the initial scope remains available for manual mapping.
|
||||
Choosing a scope manually disables automatic scope changes for that review. Changing
|
||||
the scope never changes canvas selection and preserves mappings still in scope.
|
||||
Hidden/locked layers are excluded. Each source item has a prominent destination
|
||||
dropdown and collapsed **Geometry · before / after** details. Uncheck **Include
|
||||
|
|
|
|||
|
|
@ -1,5 +1,49 @@
|
|||
# Release preparation
|
||||
|
||||
## Published prerelease: v0.10.0-rc.18
|
||||
|
||||
[Download v0.10.0-rc.18](https://proxy.dandaedre.com/gitea/idle-org/canvas-pilot/releases/tag/v0.10.0-rc.18)
|
||||
was published on 2026-11-19 from annotated tag `v0.10.0-rc.18`, source commit
|
||||
`171a9198b693fcce4111f3d88726984691c92754`. See the
|
||||
[release notes](release-notes/v0.10.0-rc.18.md). This publication record does not
|
||||
move the tag.
|
||||
|
||||
The prerelease contains 18 assets: four portable bundles, four canonical
|
||||
cargo-binstall archives, four raw binaries, the artifact manifest and primary
|
||||
checksums, `classic-themes.zip`, `video-game-themes.zip`, `language-pack.zip`, and
|
||||
`EXTRAS-SHA256SUMS.txt`. The release fixes decorative canvas text at extreme zoom,
|
||||
keeps precise canvas zoom responsive, and gives mouse positioning and scaling a
|
||||
soft preference for quarter-pixel positions that place edges on whole pixels. Its
|
||||
lockfile also replaces three yanked transitive package versions.
|
||||
|
||||
Every draft asset was downloaded before publication. Both checksum files verified
|
||||
all generated payloads and supplemental packs, every archive passed an integrity
|
||||
check, and the raw binaries were identified as ELF x86-64, PE x86-64, Mach-O arm64
|
||||
and Mach-O x86-64. After publication, anonymous API access resolved the annotated
|
||||
tag to the source commit above and all 18 public asset URLs returned HTTP 200. An
|
||||
isolated cargo-binstall fetched the public Linux archive and installed a binary
|
||||
identical to the published raw executable
|
||||
(`b1fce938eb4a9ea0b6b9a760652f1c662c10f1c6a0456ca680d2e86a1d2fda84`).
|
||||
|
||||
rust_realease 0.1.6-rc.3 built Linux and Windows with Cross and both Apple targets
|
||||
with the validated local Rust 1.100.0 image. The checked-in Apple image still has
|
||||
Rust 1.93, which is too old for the locked CAD dependencies. Linux, Windows and
|
||||
Apple ARM outputs were retained after the release command detached while the Apple
|
||||
ARM container completed; Apple Intel was then built separately. The four output
|
||||
hashes were registered against the same tagged commit and the release tool reused
|
||||
them for its normal packaging, manifest and validation stages. Portable tree,
|
||||
embedded-file hash and architecture checks passed for every target; both macOS
|
||||
binaries also passed macOS 13.0 deployment-minimum, system-library, archive-layout
|
||||
and checksum validation. Native Windows and macOS runtime acceptance remains
|
||||
outstanding.
|
||||
|
||||
Formatting, both Clippy configurations, all required Rust test configurations,
|
||||
rustdoc, all 33 Python checks, the theme-pack consistency check and the pinned
|
||||
manual build passed before tagging. Whole-application line coverage is 91.69%.
|
||||
The exact locked `cargo install` path also passed without yanked-package warnings.
|
||||
No device writes were performed. Generated archives, credentials and build caches
|
||||
are not committed to Git.
|
||||
|
||||
## Published prerelease: v0.10.0-rc.16
|
||||
|
||||
[Download v0.10.0-rc.16](https://proxy.dandaedre.com/gitea/idle-org/canvas-pilot/releases/tag/v0.10.0-rc.16)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ not a named project export. Headless/default editors never access this path.
|
|||
| Field | Meaning |
|
||||
| --- | --- |
|
||||
| `version` | Integer `1`; other versions rejected |
|
||||
| `project` | Complete [project v20](canvas-pilot.md), including embedded reference bytes; its units, precision and validation apply without display rounding |
|
||||
| `project` | Complete [project v22](canvas-pilot.md), including embedded reference bytes; its units, precision and validation apply without display rounding |
|
||||
| `project_path` | Last opened/successfully saved named JSON path, or null; geometry exports do not change it |
|
||||
| `manual_saved_at` | Unix UTC seconds of the last successful explicit project save, or null when unknown; recovery and measurement-point autosaves do not update it |
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ last successful writer wins.
|
|||
Recovery retains applied values only: no undo history, pending text/format/import
|
||||
drafts, transient tools, or credentials. A normal exit cancels unfinished canvas
|
||||
gestures before the final checkpoint. The schema does not replace named project
|
||||
JSON: Save continues to emit a bare project v20 document. Opening/New replaces the
|
||||
JSON: Save continues to emit a bare project v22 document. Opening/New replaces the
|
||||
single recovery slot; New warns with the manual-save age and Save/Discard/Cancel.
|
||||
A failed or cancelled manual save never completes Save-and-create-new.
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"version": 16,
|
||||
"theme": "midra",
|
||||
"recent_themes": [
|
||||
"midra"
|
||||
],
|
||||
"show_toolbar_icon_names": false,
|
||||
"keep_aspect_ratio": true,
|
||||
"show_source_pattern": false,
|
||||
"snapping": {
|
||||
"enabled": false,
|
||||
"pixels": true,
|
||||
"force_pixels": false,
|
||||
"screen_edges": true,
|
||||
"layer_edges": true,
|
||||
"grid": false,
|
||||
"show_grid": true,
|
||||
"grid_divisions": [
|
||||
8,
|
||||
6
|
||||
],
|
||||
"mask_edges": false
|
||||
},
|
||||
"midra_host": "",
|
||||
"allow_sending_to_program": false,
|
||||
"autoconnect_at_startup": false,
|
||||
"recent_midra_hosts": [],
|
||||
"language": "system",
|
||||
"ui_scale": 1.0,
|
||||
"text_scale": null
|
||||
}
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
# Canvas Pilot application settings, version 15
|
||||
# Canvas Pilot application settings, version 16
|
||||
|
||||
Canvas Pilot was formerly named Midra Layout. The rename preserves existing wire-format identifiers, `.midra.json` projects, settings/recovery locations and `MIDRA_VECTORCRAFT_CLI` configuration. No schema version changes are needed. New exports use Canvas Pilot in human-readable titles; legacy files remain readable.
|
||||
|
||||
Implementation: `crates/canvas-pilot/src/settings.rs`. This per-user JSON file is
|
||||
independent of the [project JSON and SVG contracts](canvas-pilot.md).
|
||||
[Complete default example](canvas-pilot-settings-v15.example.json).
|
||||
[Complete default example](canvas-pilot-settings-v16.example.json).
|
||||
Version 1 files migrate automatically: the saved theme becomes the only entry in
|
||||
`recent_themes`, with all other preferences preserved. The [version 1 example](canvas-pilot-settings-v1.example.json)
|
||||
remains a migration fixture. Version 2 files then migrate by adding disabled
|
||||
snapping with all target types enabled. The [version 2 example](canvas-pilot-settings-v2.example.json)
|
||||
remains a migration fixture too. Version 3 files migrate by adding an empty `midra_host`; the [version 3 example](canvas-pilot-settings-v3.example.json) remains a migration fixture. Version 4 files migrate by adding `allow_sending_to_program: false`; the [version 4 example](canvas-pilot-settings-v4.example.json) remains a migration fixture. Version 5 files migrate with `autoconnect_at_startup: false`; the [version 5 example](canvas-pilot-settings-v5.example.json) remains a migration fixture. Version 6 files migrate with the overlay grid visible, snapping to it disabled, and `grid_divisions: [8, 6]`; the [version 6 example](canvas-pilot-settings-v6.example.json) remains a migration fixture. Version 7 migrates with an empty `recent_midra_hosts` list; the [version 7 example](canvas-pilot-settings-v7.example.json) remains a migration fixture. Version 8 migrates with `language: "system"`; the [version 8 example](canvas-pilot-settings-v8.example.json) remains a migration fixture. Version 9 migrates without changing any preferences; its `system`, `en` and `fr` values remain valid. The [version 9 example](canvas-pilot-settings-v9.example.json) remains a migration fixture. Version 10 adds language choices. Version 11 adds `ui_scale` and `text_scale`; v1–v10 settings migrate to 100% interface scale with separate text scaling disabled, preserving all existing preferences. The [version 10 example](canvas-pilot-settings-v10.example.json) remains a migration fixture. Version 12 adds `pt-PT`, `ne`, `th`, `hi` and `tok`; v1–v11 settings migrate without changing existing preferences. Values outside each old version’s language set are rejected before migration. The [version 11 example](canvas-pilot-settings-v11.example.json) remains a migration fixture. Version 13 adds installed language choices; v12 preferences migrate unchanged. The [version 12 example](canvas-pilot-settings-v12.example.json) remains a fixture. Version 14 adds required `snapping.mask_edges` (false). Versions 1–13 migrate with mask snapping disabled; supplying the field under an older version is rejected. The [version 13 example](canvas-pilot-settings-v13.example.json) remains a migration fixture. Version 15 adds installed theme choices and migrates v1–v14 without changing other preferences. The [version 14 example](canvas-pilot-settings-v14.example.json) remains a migration fixture. Saving writes version 15, which older applications reject.
|
||||
remains a migration fixture too. Version 3 files migrate by adding an empty `midra_host`; the [version 3 example](canvas-pilot-settings-v3.example.json) remains a migration fixture. Version 4 files migrate by adding `allow_sending_to_program: false`; the [version 4 example](canvas-pilot-settings-v4.example.json) remains a migration fixture. Version 5 files migrate with `autoconnect_at_startup: false`; the [version 5 example](canvas-pilot-settings-v5.example.json) remains a migration fixture. Version 6 files migrate with the overlay grid visible, snapping to it disabled, and `grid_divisions: [8, 6]`; the [version 6 example](canvas-pilot-settings-v6.example.json) remains a migration fixture. Version 7 migrates with an empty `recent_midra_hosts` list; the [version 7 example](canvas-pilot-settings-v7.example.json) remains a migration fixture. Version 8 migrates with `language: "system"`; the [version 8 example](canvas-pilot-settings-v8.example.json) remains a migration fixture. Version 9 migrates without changing any preferences; its `system`, `en` and `fr` values remain valid. The [version 9 example](canvas-pilot-settings-v9.example.json) remains a migration fixture. Version 10 adds language choices. Version 11 adds `ui_scale` and `text_scale`; v1–v10 settings migrate to 100% interface scale with separate text scaling disabled, preserving all existing preferences. The [version 10 example](canvas-pilot-settings-v10.example.json) remains a migration fixture. Version 12 adds `pt-PT`, `ne`, `th`, `hi` and `tok`; v1–v11 settings migrate without changing existing preferences. Values outside each old version’s language set are rejected before migration. The [version 11 example](canvas-pilot-settings-v11.example.json) remains a migration fixture. Version 13 adds installed language choices; v12 preferences migrate unchanged. The [version 12 example](canvas-pilot-settings-v12.example.json) remains a fixture. Version 14 adds required `snapping.mask_edges` (false). Versions 1–13 migrate with mask snapping disabled; supplying the field under an older version is rejected. The [version 13 example](canvas-pilot-settings-v13.example.json) remains a migration fixture. Version 15 adds installed theme choices and migrates v1–v14 without changing other preferences. The [version 14 example](canvas-pilot-settings-v14.example.json) remains a migration fixture. Version 16 adds required `snapping.force_pixels` (false). Versions 1–15 migrate with forced whole-pixel snapping disabled; supplying the field under an older version is rejected. The [version 15 example](canvas-pilot-settings-v15.example.json) remains a migration fixture. Saving writes version 16, which older applications reject.
|
||||
|
||||
The `directories` 6 crate resolves `ProjectDirs::from("org", "beffroi", "midra-layout")`.
|
||||
The filename is `settings.json` beneath `config_dir()`:
|
||||
|
|
@ -26,7 +26,7 @@ unknown theme names are rejected. There are no numeric coordinates or units.
|
|||
|
||||
| Field | Values / default |
|
||||
| --- | --- |
|
||||
| `version` | Integer `15` |
|
||||
| `version` | Integer `16` |
|
||||
| `ui_scale` | Finite number, 0.5–4.0 inclusive; default 1.0. egui interface zoom relative to the OS display scale. |
|
||||
| `text_scale` | `null` (default, disabled) or finite number 0.5–2.0 inclusive. Additional standard-widget text multiplier. |
|
||||
| `language` | `"system"` (default), `"en"`, `"fr"`, `"ja"`, `"zh-CN"`, `"es"`, `"grc"`, `"eo"`, `"pt-PT"`, `"ne"`, `"th"`, `"hi"`, `"tok"`, or `{"pack":"uk"}` for an installed language. Pack identifiers use 1–63 lowercase ASCII letters, digits and hyphens, without a leading/trailing hyphen. Unknown built-in string values are rejected. |
|
||||
|
|
@ -36,9 +36,9 @@ unknown theme names are rejected. There are no numeric coordinates or units.
|
|||
| `theme` | Built-in theme ID below or `{"pack":"pack-id/theme-id"}`; default `"midra"` |
|
||||
| `recent_themes` | 1–3 unique built-in IDs or pack references, newest first; first must equal `theme`; default `["midra"]` |
|
||||
| `show_toolbar_icon_names` | Boolean; default false |
|
||||
| `keep_aspect_ratio` | Boolean; default true |
|
||||
| `keep_aspect_ratio` | Legacy compatibility value; current projects store the required resize lock on each layer and new layers default to true |
|
||||
| `show_source_pattern` | Boolean; default false. Shows source patterns on other layers only during crop editing; normal editing always hides patterns. |
|
||||
| `snapping` | Object with required boolean fields `enabled` (false), `pixels` (true), `screen_edges` (true; screen edges plus 25%, 50% and 75% guides on both axes), `layer_edges` (true), `mask_edges` (false), `grid` (false), `show_grid` (true), and `grid_divisions` ([8, 6]); unknown fields rejected |
|
||||
| `snapping` | Object with required boolean fields `enabled` (false), `pixels` (true), `force_pixels` (false), `screen_edges` (true; screen edges plus 25%, 50% and 75% guides on both axes), `layer_edges` (true), `mask_edges` (false), `grid` (false), `show_grid` (true), and `grid_divisions` ([8, 6]); unknown fields rejected |
|
||||
|
||||
Scale preferences apply on startup. Slider drafts apply and save on pointer
|
||||
release; typed values wait until text entry ends. UI controls
|
||||
|
|
@ -156,6 +156,8 @@ mask centers. This extends the existing `mask_edges` flag without changing its
|
|||
serialized name, default or schema version. Mirrored
|
||||
contact uses outer edges. The option defaults to false.
|
||||
|
||||
`force_pixels` makes integer pixel coordinates take priority over other snap targets for moves, resize handles and pivots. It defaults to false because rounding every resized edge can slightly approximate a locked aspect ratio. Shift+Space temporarily enables this mode during a gesture, even when regular snapping is disabled; it takes precedence over Shift’s 10 px grid. Space without Shift retains temporary canvas panning.
|
||||
|
||||
The session-only toolbar grid tools select 10 or 100 screen pixels (mutually exclusive). Shift temporarily selects the 10 px grid; Ctrl+Shift selects 100 px. If that same grid tool is selected, the matching shortcut temporarily disables it instead. Alt overrides both grids and temporarily inverts the saved snapping-enabled value (off becomes on; on becomes off), including on release. The chosen pixel/screen/layer-edge targets still apply. These modifiers do not change the saved options or settings version.
|
||||
|
||||
**Settings → Midra integration → Allow sending to Program** saves immediately. Restore default settings disables it. Projects do not override this application preference; the Preview/Program destination itself remains session-only.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,157 @@
|
|||
{
|
||||
"format": "beffroi.midra-layout",
|
||||
"version": 21,
|
||||
"output_resolution": {
|
||||
"width": 1920,
|
||||
"height": 1080
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"id": 1,
|
||||
"source_format": "sixteen_nine",
|
||||
"native_resolution": {
|
||||
"width": 1920,
|
||||
"height": 1080
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"source_format": "sixteen_nine",
|
||||
"native_resolution": {
|
||||
"width": 1920,
|
||||
"height": 1080
|
||||
}
|
||||
}
|
||||
],
|
||||
"layers": [
|
||||
{
|
||||
"id": 2,
|
||||
"source_id": 1,
|
||||
"bounds": {
|
||||
"x": 120.0,
|
||||
"y": 180.0,
|
||||
"width": 640.0,
|
||||
"height": 360.0
|
||||
},
|
||||
"advanced_crop": {
|
||||
"left": 0.0,
|
||||
"right": 0.0,
|
||||
"top": 0.0,
|
||||
"bottom": 0.0
|
||||
},
|
||||
"visible": true,
|
||||
"locked": false,
|
||||
"name": "Slides",
|
||||
"folder": "",
|
||||
"pivot": [
|
||||
0.5,
|
||||
0.5
|
||||
],
|
||||
"layer_fit": null,
|
||||
"mask": {
|
||||
"left": 0.0,
|
||||
"right": 0.0,
|
||||
"top": 0.0,
|
||||
"bottom": 0.0,
|
||||
"origin": "source"
|
||||
},
|
||||
"load_mapping": {
|
||||
"family": "midra4k",
|
||||
"screen": "1",
|
||||
"layer": "1"
|
||||
},
|
||||
"send_mapping": {
|
||||
"destinations": [
|
||||
{
|
||||
"connection": "current",
|
||||
"layer": {
|
||||
"family": "midra4k",
|
||||
"screen": "1",
|
||||
"layer": "1"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"keep_aspect_ratio": true
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"source_id": 2,
|
||||
"bounds": {
|
||||
"x": 1160.0,
|
||||
"y": 180.0,
|
||||
"width": 640.0,
|
||||
"height": 360.0
|
||||
},
|
||||
"advanced_crop": {
|
||||
"left": 0.0,
|
||||
"right": 0.0,
|
||||
"top": 0.0,
|
||||
"bottom": 0.0
|
||||
},
|
||||
"visible": true,
|
||||
"locked": false,
|
||||
"name": "Presenter",
|
||||
"folder": "",
|
||||
"pivot": [
|
||||
0.5,
|
||||
0.5
|
||||
],
|
||||
"layer_fit": "fullscreen",
|
||||
"mask": {
|
||||
"left": 0.1,
|
||||
"right": 0.0,
|
||||
"top": 0.0,
|
||||
"bottom": 0.0,
|
||||
"origin": "layer"
|
||||
},
|
||||
"load_mapping": null,
|
||||
"send_mapping": {
|
||||
"destinations": []
|
||||
},
|
||||
"keep_aspect_ratio": true
|
||||
}
|
||||
],
|
||||
"editor": {
|
||||
"backdrop_title": "Example Conference Name",
|
||||
"selected_layer_ids": [
|
||||
1
|
||||
],
|
||||
"position_point": "top_left",
|
||||
"viewport_zoom": 1.0,
|
||||
"viewport_pan": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"show_source_pattern": false,
|
||||
"show_toolbar_icon_names": false,
|
||||
"outline_layers": false,
|
||||
"position_layer_point": null
|
||||
},
|
||||
"next_layer_id": 3,
|
||||
"references": [],
|
||||
"workspace": {
|
||||
"snapping": {
|
||||
"enabled": false,
|
||||
"pixels": true,
|
||||
"screen_edges": true,
|
||||
"layer_edges": true,
|
||||
"grid": false,
|
||||
"show_grid": true,
|
||||
"grid_divisions": [
|
||||
8,
|
||||
6
|
||||
],
|
||||
"mask_edges": false
|
||||
},
|
||||
"resize_mode": "individual",
|
||||
"grid_spacing": null,
|
||||
"collapsed_folders": [],
|
||||
"capture_interval_seconds": 10,
|
||||
"show_empty_inputs": false,
|
||||
"previews": []
|
||||
},
|
||||
"folders": [
|
||||
"Memory A"
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,158 @@
|
|||
{
|
||||
"format": "beffroi.midra-layout",
|
||||
"version": 22,
|
||||
"output_resolution": {
|
||||
"width": 1920,
|
||||
"height": 1080
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"id": 1,
|
||||
"source_format": "sixteen_nine",
|
||||
"native_resolution": {
|
||||
"width": 1920,
|
||||
"height": 1080
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"source_format": "sixteen_nine",
|
||||
"native_resolution": {
|
||||
"width": 1920,
|
||||
"height": 1080
|
||||
}
|
||||
}
|
||||
],
|
||||
"layers": [
|
||||
{
|
||||
"id": 2,
|
||||
"source_id": 1,
|
||||
"bounds": {
|
||||
"x": 120.0,
|
||||
"y": 180.0,
|
||||
"width": 640.0,
|
||||
"height": 360.0
|
||||
},
|
||||
"advanced_crop": {
|
||||
"left": 0.0,
|
||||
"right": 0.0,
|
||||
"top": 0.0,
|
||||
"bottom": 0.0
|
||||
},
|
||||
"visible": true,
|
||||
"locked": false,
|
||||
"name": "Slides",
|
||||
"folder": "",
|
||||
"pivot": [
|
||||
0.5,
|
||||
0.5
|
||||
],
|
||||
"layer_fit": null,
|
||||
"mask": {
|
||||
"left": 0.0,
|
||||
"right": 0.0,
|
||||
"top": 0.0,
|
||||
"bottom": 0.0,
|
||||
"origin": "source"
|
||||
},
|
||||
"load_mapping": {
|
||||
"family": "midra4k",
|
||||
"screen": "1",
|
||||
"layer": "1"
|
||||
},
|
||||
"send_mapping": {
|
||||
"destinations": [
|
||||
{
|
||||
"connection": "current",
|
||||
"layer": {
|
||||
"family": "midra4k",
|
||||
"screen": "1",
|
||||
"layer": "1"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"keep_aspect_ratio": true
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"source_id": 2,
|
||||
"bounds": {
|
||||
"x": 1160.0,
|
||||
"y": 180.0,
|
||||
"width": 640.0,
|
||||
"height": 360.0
|
||||
},
|
||||
"advanced_crop": {
|
||||
"left": 0.0,
|
||||
"right": 0.0,
|
||||
"top": 0.0,
|
||||
"bottom": 0.0
|
||||
},
|
||||
"visible": true,
|
||||
"locked": false,
|
||||
"name": "Presenter",
|
||||
"folder": "",
|
||||
"pivot": [
|
||||
0.5,
|
||||
0.5
|
||||
],
|
||||
"layer_fit": "fullscreen",
|
||||
"mask": {
|
||||
"left": 0.1,
|
||||
"right": 0.0,
|
||||
"top": 0.0,
|
||||
"bottom": 0.0,
|
||||
"origin": "layer"
|
||||
},
|
||||
"load_mapping": null,
|
||||
"send_mapping": {
|
||||
"destinations": []
|
||||
},
|
||||
"keep_aspect_ratio": true
|
||||
}
|
||||
],
|
||||
"editor": {
|
||||
"backdrop_title": "Example Conference Name",
|
||||
"selected_layer_ids": [
|
||||
1
|
||||
],
|
||||
"position_point": "top_left",
|
||||
"viewport_zoom": 1.0,
|
||||
"viewport_pan": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"show_source_pattern": false,
|
||||
"show_toolbar_icon_names": false,
|
||||
"outline_layers": false,
|
||||
"position_layer_point": null
|
||||
},
|
||||
"next_layer_id": 3,
|
||||
"references": [],
|
||||
"workspace": {
|
||||
"snapping": {
|
||||
"enabled": false,
|
||||
"pixels": true,
|
||||
"force_pixels": false,
|
||||
"screen_edges": true,
|
||||
"layer_edges": true,
|
||||
"grid": false,
|
||||
"show_grid": true,
|
||||
"grid_divisions": [
|
||||
8,
|
||||
6
|
||||
],
|
||||
"mask_edges": false
|
||||
},
|
||||
"resize_mode": "individual",
|
||||
"grid_spacing": null,
|
||||
"collapsed_folders": [],
|
||||
"capture_interval_seconds": 10,
|
||||
"show_empty_inputs": false,
|
||||
"previews": []
|
||||
},
|
||||
"folders": [
|
||||
"Memory A"
|
||||
]
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ These are offline editor formats, not Analog Way REST payloads. Implementation:
|
|||
[`project.rs`](../../crates/canvas-pilot/tests/project.rs). Update this contract,
|
||||
examples and tests in the same change as any save/export schema change.
|
||||
|
||||
## Project JSON, version 20
|
||||
## Project JSON, version 22
|
||||
|
||||
Suggested filename: `layout.pilot.json`. **Open project** accepts any `.json`
|
||||
filename, including legacy `.midra.json` projects, and validates the project
|
||||
|
|
@ -27,7 +27,7 @@ and `next_layer_id: 3`; other values are preserved.
|
|||
The [version 1 example](canvas-pilot-v1.example.json) remains a migration fixture.
|
||||
Version 4 adds `editor.outline_layers: false`, and reference `native_size: false`
|
||||
and `offset: [0, 0]` when migrating versions 1–3. Old fitting behavior is preserved.
|
||||
Version 5 adds required `midra_link` to every layer. Versions 1–4 migrate with null links; links cannot be supplied under an older version. Version 6 renames `editor.position_corner` to `editor.position_point` and adds `center`. Versions 1–5 retain their original corner; center and the new field are rejected in those older schemas. Version 7 adds `editor.backdrop_title`; versions 1–6 gain `"Example Conference Name"` and cannot supply this field under the old schema. Version 8 adds required `editor.position_layer_point`: null keeps matched points; a point enables independent measurement. Versions 1–7 migrate to null and cannot supply this field. Version 9 adds required `layers[].pivot`; versions 1–8 migrate to `[0.5, 0.5]` and cannot supply this field. Version 10 replaces `reference` with the required ordered `references` array. Versions 1–9 migrate null to `[]` and a single image to a one-element array, preserving all image settings. Version 11 adds required `workspace` settings and embedded layer previews. Versions 1–10 gain the documented workspace defaults, with no captures or collapsed folders; supplying `workspace` in an older schema is rejected. Version 12 adds required `folders`, the explicit folder names that survive without members. Versions 1–11 gain `folders: []`, preserving their existing implicit layer grouping; supplying this field under an older version is rejected. Version 13 replaces `midra_link` with required `device_link`, adding the explicit device family. Versions 1–12 migrate numeric links to `family: "midra4k"`; null remains null, and legacy decimal IDs with leading zeros are canonicalized. Unknown legacy fields are rejected. Version 14 adds required `layers[].layer_fit`: versions 1–13 migrate to null, preserving normal crop/zoom behavior; supplying this field under an older schema is rejected. Version 15 adds required `layers[].mask`; versions 1–14 migrate with four zero edges and reject masks supplied under an older version. Version 16 adds required root `input_proposals`; versions 1–15 migrate to an empty array and reject this field if supplied under an older version. Version 17 adds required `mask.origin` (`layer` or `source`). Versions 1–16 migrate to `layer`; older versions containing `origin` are rejected. See the [version 17 example](canvas-pilot-v17.example.json); v16 remains a migration fixture. Version 18 adds required `workspace.snapping.mask_edges` (default false). Versions 1–17 migrate with this option disabled; supplying it under an older schema is rejected. See the [version 18 example](canvas-pilot-v18.example.json). Version 19 replaces each layer’s `device_link` with required `load_mapping` and `send_mapping`. Versions 1–18 migrate the old link to the load source and a single send destination on the current connection (or null and an empty destination list when unlinked). Older schemas containing the new fields are rejected. Saving now writes version 20; older applications reject it.
|
||||
Version 5 adds required `midra_link` to every layer. Versions 1–4 migrate with null links; links cannot be supplied under an older version. Version 6 renames `editor.position_corner` to `editor.position_point` and adds `center`. Versions 1–5 retain their original corner; center and the new field are rejected in those older schemas. Version 7 adds `editor.backdrop_title`; versions 1–6 gain `"Example Conference Name"` and cannot supply this field under the old schema. Version 8 adds required `editor.position_layer_point`: null keeps matched points; a point enables independent measurement. Versions 1–7 migrate to null and cannot supply this field. Version 9 adds required `layers[].pivot`; versions 1–8 migrate to `[0.5, 0.5]` and cannot supply this field. Version 10 replaces `reference` with the required ordered `references` array. Versions 1–9 migrate null to `[]` and a single image to a one-element array, preserving all image settings. Version 11 adds required `workspace` settings and embedded layer previews. Versions 1–10 gain the documented workspace defaults, with no captures or collapsed folders; supplying `workspace` in an older schema is rejected. Version 12 adds required `folders`, the explicit folder names that survive without members. Versions 1–11 gain `folders: []`, preserving their existing implicit layer grouping; supplying this field under an older version is rejected. Version 13 replaces `midra_link` with required `device_link`, adding the explicit device family. Versions 1–12 migrate numeric links to `family: "midra4k"`; null remains null, and legacy decimal IDs with leading zeros are canonicalized. Unknown legacy fields are rejected. Version 14 adds required `layers[].layer_fit`: versions 1–13 migrate to null, preserving normal crop/zoom behavior; supplying this field under an older schema is rejected. Version 15 adds required `layers[].mask`; versions 1–14 migrate with four zero edges and reject masks supplied under an older version. Version 16 adds required root `input_proposals`; versions 1–15 migrate to an empty array and reject this field if supplied under an older version. Version 17 adds required `mask.origin` (`layer` or `source`). Versions 1–16 migrate to `layer`; older versions containing `origin` are rejected. See the [version 17 example](canvas-pilot-v17.example.json); v16 remains a migration fixture. Version 18 adds required `workspace.snapping.mask_edges` (default false). Versions 1–17 migrate with this option disabled; supplying it under an older schema is rejected. See the [version 18 example](canvas-pilot-v18.example.json). Version 19 replaces each layer’s `device_link` with required `load_mapping` and `send_mapping`. Versions 1–18 migrate the old link to the load source and a single send destination on the current connection (or null and an empty destination list when unlinked). Older schemas containing the new fields are rejected. Saving version 19 migrates into version 20 before the version 21 migration below.
|
||||
Version 20 removes root `input_proposals` and `inputs[].input_crop`. Source dimensions
|
||||
now describe the processed image used by layers. No second local pre-crop is stored,
|
||||
rendered or added to device layer crops. Shared device Input settings drafts remain
|
||||
|
|
@ -35,11 +35,13 @@ session-only and are not project data. Strict migration accepts older projects o
|
|||
when the retired proposal list is empty and all retired input crop edges are zero;
|
||||
otherwise it directs the caller to explicit best-effort Open project.
|
||||
|
||||
Version 21 moves `editor.keep_aspect_ratio` to required `layers[].keep_aspect_ratio`. Versions 1–20 copy the former project-wide value to every layer, preserving their resize behavior. Version 22 adds required `workspace.snapping.force_pixels` (false). Versions 1–21 migrate with forced whole-pixel snapping disabled and reject the field under an older version. Saving now writes version 22; older applications reject it.
|
||||
|
||||
### Best-effort Open project
|
||||
|
||||
The native-project opening path uses `project_recovery::from_json`. It first tries
|
||||
known migrations and strict validation, then recovers supported fields independently.
|
||||
Only valid UTF-8 JSON with the Canvas Pilot format and a known version (1–20) is
|
||||
Only valid UTF-8 JSON with the Canvas Pilot format and a known version (1–22) is
|
||||
accepted, within the 96 MiB limit. Invalid JSON and unknown future versions are errors.
|
||||
Retired proposals and local input crops are discarded with a report; old appearance
|
||||
is not guaranteed. Reload affected layers from the device after input preprocessing.
|
||||
|
|
@ -55,7 +57,7 @@ projects open as unsaved copies, with no automatic overwrite target. Loading nev
|
|||
writes to the source or sends device commands. Strict exchange imports and automatic
|
||||
recovery envelopes retain their separate validation rules.
|
||||
|
||||
[Complete example](canvas-pilot-v20.example.json) is a valid project with an empty `Memory A` folder and a Midra link,
|
||||
[Complete example](canvas-pilot-v22.example.json) is a valid project with an empty `Memory A` folder and a Midra link,
|
||||
with an unlinked Fullscreen example layer and no reference image. New projects label the lower layer `02 / Slides` and
|
||||
the upper layer `01 / Presenter`; existing projects retain their saved IDs/names.
|
||||
It is loaded by the regression tests.
|
||||
|
|
@ -63,7 +65,7 @@ It is loaded by the regression tests.
|
|||
| Root field | Representation / meaning |
|
||||
| --- | --- |
|
||||
| `format` | Exactly `"beffroi.midra-layout"` |
|
||||
| `version` | Integer `20` |
|
||||
| `version` | Integer `22` |
|
||||
| `folders` | Required array of 0–256 unique explicit folder names, each trimmed and 1–128 characters. Explicit folders remain even with no members; layer folder labels also form implicit groups. |
|
||||
| `next_layer_id` | Positive integer strictly greater than every layer ID; not rewound by undo |
|
||||
| `output_resolution` | `{ "width": integer, "height": integer }`, screen pixels |
|
||||
|
|
@ -95,6 +97,7 @@ Layer objects:
|
|||
| `send_mapping` | Required `{ "destinations": [...] }`; each destination has exactly `{ "connection": "current", "layer": <DeviceLink> }`, where the link uses the same family/screen/layer representation as `load_mapping`. Empty means no send destination; exact duplicate destinations within a layer are rejected. Only the current connection is supported; unknown connection kinds are rejected. |
|
||||
| `load_mapping` | Required: null (unlinked) or `{ "family": "midra4k", "screen": "2", "layer": "1" }` / `{ "family": "aquilon", "screen": "S1", "layer": "1" }`. Family is required; unknown fields/families rejected. Layer IDs and Midra screen IDs are canonical positive decimal strings, at most 16 digits; Aquilon screens require `S` (screen) or `A` (auxiliary) plus that numeric ID. This is the load source. No host, bank, credentials or unit identity: linked Aquilon systems are unsupported. |
|
||||
| `pivot` | Required `[x, y]` gravity point relative to the layer top-left, in fractions of width/height. Center is `[0.5, 0.5]`; outside points are allowed. Finite doubles within ±1,000,000, preserved without rounding. Placement/reset is undoable; follows layer movement/reordering. Omitted from SVG and device writes. |
|
||||
| `keep_aspect_ratio` | Required Boolean. Controls proportional handle and numeric resizing for this layer; changing it is undoable and follows the layer through reorder/save/load. |
|
||||
| `folder` | Local folder name, at most 128 characters; empty means ungrouped |
|
||||
| `source_id` | Existing input slot ID; multiple layers may share an input |
|
||||
| `bounds` | `{ "x": number, "y": number, "width": number, "height": number }`, visible box for normal crop/zoom, container for explicit `layer_fit`, in screen pixels; x/y are its top-left position |
|
||||
|
|
@ -153,7 +156,6 @@ Editor object:
|
|||
| `backdrop_title` | Required string, 0–128 Unicode characters, no control characters. Example backdrop title; empty hides the text. Preserved exactly, including spaces; omitted from SVG/device output. |
|
||||
| `position_point` | Screen measurement origin: `"top_left"`, `"top_right"`, `"bottom_left"`, `"bottom_right"`, `"center"` |
|
||||
| `position_layer_point` | Required: null for the matching layer point (advanced toggle off), or one of the same five point strings for an independent layer endpoint (toggle on) |
|
||||
| `keep_aspect_ratio` | Boolean for layer resizing |
|
||||
| `viewport_zoom` | Positive fit-relative scale, 0.0001–256 |
|
||||
| `viewport_pan` | `[x, y]`, viewport pan in screen-coordinate pixels; finite, absolute value at most 1e9 |
|
||||
| `show_source_pattern` | Boolean: show source patterns on other layers during crop editing; normal editing always hides patterns |
|
||||
|
|
@ -260,7 +262,7 @@ and `viewBox="0 0 W H"` equal to the output screen. The root carries
|
|||
|
||||
## Compatibility changes
|
||||
|
||||
Project version 20 and the versioned geometry exchanges are strict contracts. A breaking project field/meaning change must bump
|
||||
Project version 22 and the versioned geometry exchanges are strict contracts. A breaking project field/meaning change must bump
|
||||
`version` and either implement a tested migration or clearly reject older/newer
|
||||
files. Changing rectangle/marker semantics requires a corresponding documented
|
||||
exchange-interface revision and importer tests. Update this document and its example
|
||||
|
|
@ -278,7 +280,7 @@ retarget existing links; choosing a destination there explicitly replaces that
|
|||
layer's saved link. Direct send/load actions use each layer's saved screen,
|
||||
independently of the screen currently displayed in the configuration window.
|
||||
|
||||
Automatic session recovery wraps this project representation in a separate [recovery file](canvas-pilot-recovery.md); named project JSON is version 20.
|
||||
Automatic session recovery wraps this project representation in a separate [recovery file](canvas-pilot-recovery.md); named project JSON is version 22.
|
||||
|
||||
## Folder-scoped Midra transfers
|
||||
|
||||
|
|
@ -304,7 +306,7 @@ device preprocessing to refresh the source dimensions used for layer geometry.
|
|||
|
||||
| Field | Representation / validation / migration default |
|
||||
| --- | --- |
|
||||
| `snapping` | Required booleans `enabled` (false), `pixels` (true), `screen_edges` (true), `layer_edges` (true), `mask_edges` (false), `grid` (false), `show_grid` (true), and `grid_divisions` (two integers 1–64, default `[8,6]`). These override application defaults for the opened project. |
|
||||
| `snapping` | Required booleans `enabled` (false), `pixels` (true), `force_pixels` (false), `screen_edges` (true), `layer_edges` (true), `mask_edges` (false), `grid` (false), `show_grid` (true), and `grid_divisions` (two integers 1–64, default `[8,6]`). These override application defaults for the opened project. |
|
||||
| `resize_mode` | `individual` (default), `same`, `mirror`, or `opposite` |
|
||||
| `grid_spacing` | null (default), 10 or 100, in output pixels |
|
||||
| `collapsed_folders` | Unique existing nonempty folder names (including empty explicit folders); default `[]`. Deleted/renamed stale entries are omitted when saving. |
|
||||
|
|
@ -349,7 +351,7 @@ background export behavior.
|
|||
For the complete persistence audit and the reasons for keeping other controls
|
||||
out of project files, see [Project persistence audit](canvas-pilot-persistence-audit.md).
|
||||
|
||||
Device links distinguish family, screen/auxiliary and layer. A link from another family cannot be used on the current device without explicit remapping. Multiple editor layers may share one destination; a send scope containing duplicates is rejected with the conflicting layer names. Device state and physical bank roles are never saved in the project. Geometry-only exports omit these links; embedded editor snapshots retain version 20 and use the same migration on import.
|
||||
Device links distinguish family, screen/auxiliary and layer. A link from another family cannot be used on the current device without explicit remapping. Multiple editor layers may share one destination; a send scope containing duplicates is rejected with the conflicting layer names. Device state and physical bank roles are never saved in the project. Geometry-only exports omit these links; embedded editor snapshots retain version 22 and use the same migration on import.
|
||||
|
||||
### Explicit layer fit (v14)
|
||||
|
||||
|
|
|
|||
|
|
@ -78,11 +78,11 @@ changes to installed files take effect after restart.
|
|||
|
||||
## Settings, missing packs and round trips
|
||||
|
||||
[Settings version 15](canvas-pilot-settings.md) stores a packed theme as
|
||||
[Settings version 16](canvas-pilot-settings.md) stores a packed theme as
|
||||
`{"pack":"tokyo-night/night"}` in `theme` and `recent_themes`; built-in string IDs
|
||||
are unchanged. Versions 1–14 migrate preserving preferences and history, but pack
|
||||
choices under a legacy version are rejected. Older applications reject version 15.
|
||||
The [default fixture](canvas-pilot-settings-v15.example.json) is the migration target.
|
||||
choices under a legacy version are rejected. Older applications reject version 16.
|
||||
The [default fixture](canvas-pilot-settings-v16.example.json) is the current target.
|
||||
|
||||
Missing/invalid packs preserve the saved theme choice and show an unavailable
|
||||
label, rendering with Midra Dark until the pack is installed again or the user
|
||||
|
|
|
|||
Loading…
Reference in New Issue