Skip to content

Commit a0ce56d

Browse files
authored
Rename Instances<T> to Table<T> and the "instance" terminology to "TableRow" and "element" (#2981)
* Instances -> Table * instances.rs -> table.rs * Rename occurrances of the word "instances" * .instance -> .element * Instance* -> TableRow* * Rename Table and TableRow methods to not say "instance" * Remove presumed unused serde defaults now that tables default to length 0 not 1 * Rename occurences of the word "instance" * Un-alias the RasterDataTable<Storage>, VectorDataTable, GraphicGroupTable, ArtboardGroupTable typedefs * Move artboard type and node code out of graphic_element.rs to a new artboard.rs * Organize the TaggedValues * Fix tests * Fix prior regression with Image Value node not upgrading
1 parent 67123f5 commit a0ce56d

File tree

66 files changed

+1895
-2050
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1895
-2050
lines changed

demo-artwork/changing-seasons.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/isometric-fountain.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/marbled-mandelbrot.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/painted-dreams.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/parametric-dunescape.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/procedural-string-lights.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/red-dress.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo-artwork/valley-of-spires.graphite

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

editor/src/messages/portfolio/document/document_message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ pub enum DocumentMessage {
182182
UpdateUpstreamTransforms {
183183
upstream_footprints: HashMap<NodeId, Footprint>,
184184
local_transforms: HashMap<NodeId, DAffine2>,
185-
first_instance_source_id: HashMap<NodeId, Option<NodeId>>,
185+
first_element_source_id: HashMap<NodeId, Option<NodeId>>,
186186
},
187187
UpdateClickTargets {
188188
click_targets: HashMap<NodeId, Vec<ClickTarget>>,

editor/src/messages/portfolio/document/document_message_handler.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ use graph_craft::document::{NodeId, NodeInput, NodeNetwork, OldNodeNetwork};
3232
use graphene_std::math::quad::Quad;
3333
use graphene_std::path_bool::{boolean_intersect, path_bool_lib};
3434
use graphene_std::raster::BlendMode;
35-
use graphene_std::raster_types::{Raster, RasterDataTable};
35+
use graphene_std::raster_types::Raster;
36+
use graphene_std::table::Table;
3637
use graphene_std::vector::PointId;
3738
use graphene_std::vector::click_target::{ClickTarget, ClickTargetType};
3839
use graphene_std::vector::style::ViewMode;
@@ -837,7 +838,7 @@ impl MessageHandler<DocumentMessage, DocumentMessageContext<'_>> for DocumentMes
837838

838839
responses.add(DocumentMessage::AddTransaction);
839840

840-
let layer = graph_modification_utils::new_image_layer(RasterDataTable::new(Raster::new_cpu(image)), layer_node_id, self.new_layer_parent(true), responses);
841+
let layer = graph_modification_utils::new_image_layer(Table::new_from_element(Raster::new_cpu(image)), layer_node_id, self.new_layer_parent(true), responses);
841842

842843
if let Some(name) = name {
843844
responses.add(NodeGraphMessage::SetDisplayName {
@@ -1302,10 +1303,10 @@ impl MessageHandler<DocumentMessage, DocumentMessageContext<'_>> for DocumentMes
13021303
DocumentMessage::UpdateUpstreamTransforms {
13031304
upstream_footprints,
13041305
local_transforms,
1305-
first_instance_source_id,
1306+
first_element_source_id,
13061307
} => {
13071308
self.network_interface.update_transforms(upstream_footprints, local_transforms);
1308-
self.network_interface.update_first_instance_source_id(first_instance_source_id);
1309+
self.network_interface.update_first_element_source_id(first_element_source_id);
13091310
}
13101311
DocumentMessage::UpdateClickTargets { click_targets } => {
13111312
// TODO: Allow non layer nodes to have click targets
@@ -2920,7 +2921,7 @@ impl DocumentMessageHandler {
29202921
/// Create a network interface with a single export
29212922
fn default_document_network_interface() -> NodeNetworkInterface {
29222923
let mut network_interface = NodeNetworkInterface::default();
2923-
network_interface.add_export(TaggedValue::ArtboardGroup(graphene_std::ArtboardGroupTable::default()), -1, "", &[]);
2924+
network_interface.add_export(TaggedValue::ArtboardGroup(Default::default()), -1, "", &[]);
29242925
network_interface
29252926
}
29262927

0 commit comments

Comments
 (0)