Disable extrude button if there is no extrudable geometry (#2730)

Disable extrude button if there is no extrudeable geometry
This commit is contained in:
Kurt Hutten
2024-06-21 13:20:42 +10:00
committed by GitHub
parent 1beb6b5186
commit d85211c5a4
5 changed files with 242 additions and 2 deletions

View File

@ -16,6 +16,7 @@ import { Program } from 'lang/wasm'
import {
doesPipeHaveCallExp,
getNodeFromPath,
hasSketchPipeBeenExtruded,
isSingleCursorInPipe,
} from 'lang/queryAst'
import { CommandArgument } from './commandTypes'
@ -387,6 +388,7 @@ export function canExtrudeSelection(selection: Selections) {
)
return (
!!isSketchPipe(selection) &&
commonNodes.every((n) => !hasSketchPipeBeenExtruded(n.selection, n.ast)) &&
commonNodes.every((n) => nodeHasClose(n)) &&
commonNodes.every((n) => !nodeHasExtrude(n))
)