@@ -160,7 +160,7 @@ pub(crate) fn property_from_type(
160160 Some ( "Fraction" ) => number_widget ( default_info, number_input. mode_range ( ) . min ( min ( 0. ) ) . max ( max ( 1. ) ) ) . into ( ) ,
161161 Some ( "IntegerCount" ) => number_widget ( default_info, number_input. int ( ) . min ( min ( 1. ) ) ) . into ( ) ,
162162 Some ( "SeedValue" ) => number_widget ( default_info, number_input. int ( ) . min ( min ( 0. ) ) ) . into ( ) ,
163- Some ( "PixelSize" ) => coordinate_widget ( default_info, "X" , "Y" , unit. unwrap_or ( " px" ) , None , false ) ,
163+ Some ( "PixelSize" ) => vec2_widget ( default_info, "X" , "Y" , unit. unwrap_or ( " px" ) , None , false ) ,
164164 Some ( "TextArea" ) => text_area_widget ( default_info) . into ( ) ,
165165
166166 // For all other types, use TypeId-based matching
@@ -175,13 +175,13 @@ pub(crate) fn property_from_type(
175175 Some ( x) if x == TypeId :: of :: < u64 > ( ) => number_widget ( default_info, number_input. int ( ) . min ( min ( 0. ) ) ) . into ( ) ,
176176 Some ( x) if x == TypeId :: of :: < bool > ( ) => bool_widget ( default_info, CheckboxInput :: default ( ) ) . into ( ) ,
177177 Some ( x) if x == TypeId :: of :: < String > ( ) => text_widget ( default_info) . into ( ) ,
178- Some ( x) if x == TypeId :: of :: < DVec2 > ( ) => coordinate_widget ( default_info, "X" , "Y" , "" , None , false ) ,
178+ Some ( x) if x == TypeId :: of :: < DVec2 > ( ) => vec2_widget ( default_info, "X" , "Y" , "" , None , false ) ,
179179 Some ( x) if x == TypeId :: of :: < DAffine2 > ( ) => transform_widget ( default_info, & mut extra_widgets) ,
180180 // ==========================
181181 // PRIMITIVE COLLECTION TYPES
182182 // ==========================
183183 Some ( x) if x == TypeId :: of :: < Vec < f64 > > ( ) => array_of_number_widget ( default_info, TextInput :: default ( ) ) . into ( ) ,
184- Some ( x) if x == TypeId :: of :: < Vec < DVec2 > > ( ) => array_of_coordinates_widget ( default_info, TextInput :: default ( ) ) . into ( ) ,
184+ Some ( x) if x == TypeId :: of :: < Vec < DVec2 > > ( ) => array_of_vec2_widget ( default_info, TextInput :: default ( ) ) . into ( ) ,
185185 // ====================
186186 // GRAPHICAL DATA TYPES
187187 // ====================
@@ -626,7 +626,7 @@ pub fn transform_widget(parameter_widgets_info: ParameterWidgetsInfo, extra_widg
626626 }
627627}
628628
629- pub fn coordinate_widget ( parameter_widgets_info : ParameterWidgetsInfo , x : & str , y : & str , unit : & str , min : Option < f64 > , is_integer : bool ) -> LayoutGroup {
629+ pub fn vec2_widget ( parameter_widgets_info : ParameterWidgetsInfo , x : & str , y : & str , unit : & str , min : Option < f64 > , is_integer : bool ) -> LayoutGroup {
630630 let ParameterWidgetsInfo { document_node, node_id, index, .. } = parameter_widgets_info;
631631
632632 let mut widgets = start_widgets ( parameter_widgets_info) ;
@@ -723,7 +723,7 @@ pub fn array_of_number_widget(parameter_widgets_info: ParameterWidgetsInfo, text
723723 widgets
724724}
725725
726- pub fn array_of_coordinates_widget ( parameter_widgets_info : ParameterWidgetsInfo , text_props : TextInput ) -> Vec < WidgetHolder > {
726+ pub fn array_of_vec2_widget ( parameter_widgets_info : ParameterWidgetsInfo , text_props : TextInput ) -> Vec < WidgetHolder > {
727727 let ParameterWidgetsInfo { document_node, node_id, index, .. } = parameter_widgets_info;
728728
729729 let mut widgets = start_widgets ( parameter_widgets_info) ;
@@ -1249,7 +1249,7 @@ pub(crate) fn grid_properties(node_id: NodeId, context: &mut NodePropertiesConte
12491249 if let Some ( & TaggedValue :: GridType ( grid_type) ) = grid_type_input. as_non_exposed_value ( ) {
12501250 match grid_type {
12511251 GridType :: Rectangular => {
1252- let spacing = coordinate_widget ( ParameterWidgetsInfo :: new ( node_id, SpacingInput :: < f64 > :: INDEX , true , context) , "W" , "H" , " px" , Some ( 0. ) , false ) ;
1252+ let spacing = vec2_widget ( ParameterWidgetsInfo :: new ( node_id, SpacingInput :: < f64 > :: INDEX , true , context) , "W" , "H" , " px" , Some ( 0. ) , false ) ;
12531253 widgets. push ( spacing) ;
12541254 }
12551255 GridType :: Isometric => {
@@ -1259,7 +1259,7 @@ pub(crate) fn grid_properties(node_id: NodeId, context: &mut NodePropertiesConte
12591259 NumberInput :: default ( ) . label ( "H" ) . min ( 0. ) . unit ( " px" ) ,
12601260 ) ,
12611261 } ;
1262- let angles = coordinate_widget ( ParameterWidgetsInfo :: new ( node_id, AnglesInput :: INDEX , true , context) , "" , "" , "°" , None , false ) ;
1262+ let angles = vec2_widget ( ParameterWidgetsInfo :: new ( node_id, AnglesInput :: INDEX , true , context) , "" , "" , "°" , None , false ) ;
12631263 widgets. extend ( [ spacing, angles] ) ;
12641264 }
12651265 }
0 commit comments