@@ -7,17 +7,6 @@ use graphic_types::Vector;
77use graphic_types:: raster_types:: { CPU , Raster } ;
88use 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) ) ]
2211async 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 ) ,
0 commit comments