Skip to content

Commit 2ec0ff3

Browse files
EzbazeKeavon
andauthored
Improve node creation menu and categorization (#2719)
* Change node categories Signed-off-by: ezbaze <rybitwamateusz3@gmail.com> * Restore Ezbaze's other work that was lost in the rebase --------- Signed-off-by: ezbaze <rybitwamateusz3@gmail.com> Co-authored-by: Keavon Chambers <keavon@keavon.com>
1 parent 59bb319 commit 2ec0ff3

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

editor/src/messages/portfolio/document/node_graph/node_properties.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,16 +1211,16 @@ pub(crate) fn grid_properties(node_id: NodeId, context: &mut NodePropertiesConte
12111211
}
12121212
}
12131213

1214-
let rows = number_widget(
1215-
ParameterWidgetsInfo::from_index(document_node, node_id, RowsInput::INDEX, true, context),
1216-
NumberInput::default().min(1.),
1217-
);
12181214
let columns = number_widget(
12191215
ParameterWidgetsInfo::from_index(document_node, node_id, ColumnsInput::INDEX, true, context),
12201216
NumberInput::default().min(1.),
12211217
);
1218+
let rows = number_widget(
1219+
ParameterWidgetsInfo::from_index(document_node, node_id, RowsInput::INDEX, true, context),
1220+
NumberInput::default().min(1.),
1221+
);
12221222

1223-
widgets.extend([LayoutGroup::Row { widgets: rows }, LayoutGroup::Row { widgets: columns }]);
1223+
widgets.extend([LayoutGroup::Row { widgets: columns }, LayoutGroup::Row { widgets: rows }]);
12241224

12251225
widgets
12261226
}

frontend/src/components/floating-menus/NodeCatalog.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@
164164
.text-label {
165165
padding-left: 16px;
166166
position: relative;
167+
pointer-events: none;
167168
168169
&::before {
169170
content: "";

node-graph/gcore/src/logic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn string_length(_: impl Ctx, #[implementations(String)] string: String) -> usiz
3737
string.len()
3838
}
3939

40-
#[node_macro::node(category("Text"))]
40+
#[node_macro::node(category("Math: Logic"))]
4141
async fn switch<T, C: Send + 'n + Clone>(
4242
#[implementations(Context)] ctx: C,
4343
condition: bool,

node-graph/gcore/src/vector/generator_nodes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ fn grid<T: GridSpacing>(
158158
#[implementations(f64, DVec2)]
159159
spacing: T,
160160
#[default(30., 30.)] angles: DVec2,
161-
#[default(10)] rows: u32,
162161
#[default(10)] columns: u32,
162+
#[default(10)] rows: u32,
163163
) -> VectorDataTable {
164164
let (x_spacing, y_spacing) = spacing.as_dvec2().into();
165165
let (angle_a, angle_b) = angles.into();

node-graph/gcore/src/vector/vector_nodes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ where
210210
vector_data
211211
}
212212

213-
#[node_macro::node(category("Vector"), path(graphene_core::vector))]
213+
#[node_macro::node(category("Instancing"), path(graphene_core::vector))]
214214
async fn repeat<I: 'n + Send + Clone>(
215215
_: impl Ctx,
216216
// TODO: Implement other GraphicElementRendered types.
@@ -249,7 +249,7 @@ where
249249
result_table
250250
}
251251

252-
#[node_macro::node(category("Vector"), path(graphene_core::vector))]
252+
#[node_macro::node(category("Instancing"), path(graphene_core::vector))]
253253
async fn circular_repeat<I: 'n + Send + Clone>(
254254
_: impl Ctx,
255255
// TODO: Implement other GraphicElementRendered types.
@@ -284,7 +284,7 @@ where
284284
result_table
285285
}
286286

287-
#[node_macro::node(name("Copy to Points"), category("Vector"), path(graphene_core::vector))]
287+
#[node_macro::node(name("Copy to Points"), category("Instancing"), path(graphene_core::vector))]
288288
async fn copy_to_points<I: 'n + Send + Clone>(
289289
_: impl Ctx,
290290
points: VectorDataTable,

0 commit comments

Comments
 (0)