Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified demo-artwork/changing-seasons.graphite
Binary file not shown.
Binary file modified demo-artwork/isometric-fountain.graphite
Binary file not shown.
Binary file modified demo-artwork/marbled-mandelbrot.graphite
Binary file not shown.
Binary file modified demo-artwork/painted-dreams.graphite
Binary file not shown.
Binary file modified demo-artwork/parametric-dunescape.graphite
Binary file not shown.
Binary file modified demo-artwork/procedural-string-lights.graphite
Binary file not shown.
Binary file modified demo-artwork/red-dress.graphite
Binary file not shown.
Binary file modified demo-artwork/valley-of-spires.graphite
Binary file not shown.
2 changes: 1 addition & 1 deletion document/format/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{DEFAULT_HISTORY_CODEC, DEFAULT_HOT_LOG_CODEC, DEFAULT_REGISTRY_CODEC
pub const FORMAT_MAGIC: &str = "gdd";

/// Newest format version this build can open, which older documents migrate to. `cargo run migration snapshot` bumps it when the stored types change.
pub const SUPPORTED_FORMAT_VERSION: u32 = 4;
pub const SUPPORTED_FORMAT_VERSION: u32 = 5;

/// The on-disk codec for each working-copy payload, recorded so reads/writes never have to probe
/// the filesystem to discover it. The manifest itself is excluded: it is always JSON, since it must
Expand Down
8 changes: 4 additions & 4 deletions document/graph-storage/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ use std::collections::{BTreeMap, btree_map};
/// keys live on `Node.inputs_attributes[i]`; per-network keys live on `Network.attributes`.
pub mod attr;

/// Unified storage-side position. The valid variants depend on `attr::node::ui::IS_LAYER`:
/// layers use `Absolute` or `Stack`; non-layer nodes use `Absolute` or `Chain`.
/// Where a node or layer is stored, in grid cells.
#[derive(Copy, Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum Position {
/// A position of its own, starting a tree of its own.
Absolute([i32; 2]),
Chain,
Stack(u32),
/// An offset from the top left corner of the bounding box of the positions of the nodes reading this one.
Relative([i32; 2]),
}

impl AttributeValue {
Expand Down
8 changes: 4 additions & 4 deletions document/graph-storage/src/tests/round_trip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ fn test_ui_metadata_round_trip() {
None,
NodeId(1),
UiState {
position: Some(Position::Chain),
position: Some(Position::Relative([-7, 0])),
..Default::default()
},
);
Expand All @@ -454,7 +454,7 @@ fn test_ui_metadata_round_trip() {
Some(NESTED),
NodeId(10),
UiState {
position: Some(Position::Stack(7)),
position: Some(Position::Relative([0, 10])),
is_layer: true,
..Default::default()
},
Expand Down Expand Up @@ -484,14 +484,14 @@ fn test_ui_metadata_round_trip() {
assert!(!root_layer.pinned);

let root_node = lookup.get(&(NetworkLocation::default(), NodeId(1))).expect("entry for root-network chain node missing");
assert_eq!(root_node.position, Some(Position::Chain));
assert_eq!(root_node.position, Some(Position::Relative([-7, 0])));
assert!(!root_node.is_layer);

let DocumentNodeImplementation::Definition(nested) = converted.nodes[&NodeId(0)].implementation else {
panic!("the nested network converts back as a table entry")
};
let nested_layer = lookup.get(&(Some(nested), NodeId(10))).expect("entry for nested layer-in-stack missing");
assert_eq!(nested_layer.position, Some(Position::Stack(7)));
assert_eq!(nested_layer.position, Some(Position::Relative([0, 10])));
assert!(nested_layer.is_layer);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ mod tests {
use crate::CompilerHost;
use document_graph_storage::attr::node::ui::POSITION;
use document_graph_storage::{NodeId, Position, TimeStamp, Value, to_value};
use migration_core::Declaration;
use migration_core::{CHAIN_WIDTH, Declaration, FEEDER_ROW_HEIGHT};
use migration_runner::testing::{Fixture, Random, SourceContract, check_commutation_with, check_undo_with};

const COPY_TO_POINTS: Declaration = decl!("core_types::vector::CopyToPointsNode"@1);
Expand Down Expand Up @@ -318,8 +318,8 @@ mod tests {
panic!("the repeat reads the group")
};

assert_eq!(stages, [-1, 6, 13].map(|x| Some(Position::Absolute([x, 10]))));
assert_eq!(position_of(group), Some(Position::Absolute([-8, 13])));
assert_eq!(stages, [Some(Position::Relative([-CHAIN_WIDTH, 0])); 3]);
assert_eq!(position_of(group), Some(Position::Relative([-CHAIN_WIDTH, FEEDER_ROW_HEIGHT])));
}

#[test]
Expand Down
3 changes: 2 additions & 1 deletion document/migrations/formats/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub mod v1;
pub mod v2;
pub mod v3;
pub mod v4;
pub use v4 as latest;
pub mod v5;
pub use v5 as latest;

mod steps;
1 change: 1 addition & 0 deletions document/migrations/formats/src/steps/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
mod v1_to_v2;
mod v2_to_v3;
mod v3_to_v4;
mod v4_to_v5;
Loading
Loading