feat: the op is picked when a node is added, not changed afterwards

\`add node\` made a gain and nothing else, so every other op was two steps. It
is a menu of the twelve now, each carrying its index through
\`math_op_index()\`'s space rather than a cast of the enum -- which is also
what \`math_dialog_sync()\` now uses to drive the op dropdown, since that
order is the dialog's and not the declaration's.
This commit is contained in:
Martino Ferrari committed 2026-10-07 02:39:26 +02:00
1 parent bafa391ad8
commit 5a69b2147b
3 files changed
+85 -9

No files matched your search

+7
View File
@@ -106,6 +106,13 @@ MathOp math_op_at(int index) {
}
}
int math_op_index(MathOp op) {
for (int i = 0; i < math_op_count(); ++i) {
if (math_op_at(i) == op) return i;
}
return 0;
}
int math_op_arity(MathOp op) {
switch (op) {
case MathOp::Source: return 0;