Skip to content

Commit e9d33e5

Browse files
committed
More fixes
1 parent 3e3c07b commit e9d33e5

4 files changed

Lines changed: 20 additions & 13 deletions

File tree

editor/src/messages/portfolio/document_migration.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,20 @@ fn migrate_node(node_id: &NodeId, node: &DocumentNode, network_path: &[NodeId],
16321632
}
16331633
}
16341634

1635+
// TODO: Also add this for "Animation Time"
1636+
// Upgrade the "Instance Position" node to add the "Loop Level" input
1637+
if reference == DefinitionIdentifier::ProtoNode(graphene_std::vector_nodes::instance::instance_position::IDENTIFIER) && inputs_count < 2 {
1638+
let mut node_template = resolve_document_node_type(&reference)?.default_node_template();
1639+
document.network_interface.replace_implementation(node_id, network_path, &mut node_template);
1640+
1641+
document
1642+
.network_interface
1643+
.set_input(&InputConnector::node(*node_id, 0), NodeInput::value(TaggedValue::None, false), network_path);
1644+
document
1645+
.network_interface
1646+
.set_input(&InputConnector::node(*node_id, 1), NodeInput::value(TaggedValue::U32(0), false), network_path);
1647+
}
1648+
16351649
// Migrate from the old source/target "Morph" node to the new vector table based "Morph" node.
16361650
// This doesn't produce exactly equivalent results in cases involving input vector tables with multiple rows.
16371651
// The old version would zip the source and target table rows, interpoleating each pair together.

frontend/src/state-providers/tooltip.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ export function createTooltipState(editor: Editor) {
4040
// Before we schedule a new future tooltip appearance, we clear the existing one
4141
if (tooltipTimeout) clearTimeout(tooltipTimeout);
4242

43+
// Don't show tooltips while mouse buttons are pressed
44+
if (e.buttons !== 0) return;
45+
4346
// Schedule the tooltip to appear at this cursor position after a delay
4447
tooltipTimeout = setTimeout(() => {
4548
update((state) => {

node-graph/nodes/vector/src/instance.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@ use graphic_types::Vector;
77
use graphic_types::raster_types::{CPU, Raster};
88
use vector_types::GradientStops;
99

10-
#[repr(transparent)]
11-
#[derive(dyn_any::DynAny)]
12-
struct HashableDVec2(DVec2);
13-
14-
impl std::hash::Hash for HashableDVec2 {
15-
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
16-
self.0.x.to_bits().hash(state);
17-
self.0.y.to_bits().hash(state);
18-
}
19-
}
20-
2110
#[node_macro::node(name("Instance on Points"), category("Instancing"), path(core_types::vector))]
2211
async fn instance_on_points<T: Into<Graphic> + Default + Send + Clone + 'static>(
2312
ctx: impl ExtractAll + CloneVarArgs + Sync + Ctx + InjectVarArgs,
@@ -38,7 +27,7 @@ async fn instance_on_points<T: Into<Graphic> + Default + Send + Clone + 'static>
3827
let mut iteration = async |index, point| {
3928
let transformed_point = transform.transform_point2(point);
4029

41-
let new_ctx = OwnedContextImpl::from(ctx.clone()).with_index(index).with_vararg(Box::new(HashableDVec2(transformed_point)));
30+
let new_ctx = OwnedContextImpl::from(ctx.clone()).with_index(index).with_position(transformed_point);
4231
let generated_instance = instance.eval(new_ctx.into_context()).await;
4332

4433
for mut generated_row in generated_instance.into_iter() {
@@ -168,7 +157,7 @@ mod test {
168157
let owned = OwnedContextImpl::default().into_context();
169158
let rect = RectangleNode::new(
170159
FutureWrapperNode(()),
171-
ExtractXyNode::new(InstancePositionNode {}, FutureWrapperNode(XY::Y)),
160+
ExtractXyNode::new(InstancePositionNode((), 0), FutureWrapperNode(XY::Y)),
172161
FutureWrapperNode(2_f64),
173162
FutureWrapperNode(false),
174163
FutureWrapperNode(0_f64),

node-graph/nodes/vector/src/vector_modification_nodes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ async fn apply_transform(_ctx: impl Ctx, mut vector: Table<Vector>) -> Table<Vec
3636
for (_, point) in vector.point_domain.positions_mut() {
3737
*point = transform.transform_point2(*point);
3838
}
39+
vector.segment_domain.transform(transform);
3940

4041
*row.transform = DAffine2::IDENTITY;
4142
}

0 commit comments

Comments
 (0)