can change linear when it's linear + non-generic

This commit is contained in:
Ryan Di 2025-04-30 20:22:43 +10:00
parent 721f5ec0f4
commit 2b66da4305

View file

@ -643,7 +643,6 @@ export const getSwitchCategoryFromElements = (
return null; return null;
} }
let onlyLinear = true;
let canBeLinear = false; let canBeLinear = false;
for (const element of elements) { for (const element of elements) {
if ( if (
@ -653,17 +652,10 @@ export const getSwitchCategoryFromElements = (
) { ) {
return "generic"; return "generic";
} }
if (element.type !== "arrow" && element.type !== "line") {
onlyLinear = false;
canBeLinear = false;
}
if (onlyLinear) {
if (isLinearElement(element) && isLinearElementElligible(element)) { if (isLinearElement(element) && isLinearElementElligible(element)) {
canBeLinear = true; canBeLinear = true;
} }
} }
}
if (canBeLinear) { if (canBeLinear) {
return "linear"; return "linear";