Disable extrude button if there is no extrudable geometry (#2730)
Disable extrude button if there is no extrudeable geometry
This commit is contained in:
@ -63,6 +63,7 @@ import {
|
||||
import {
|
||||
getNodeFromPath,
|
||||
getNodePathFromSourceRange,
|
||||
hasExtrudableGeometry,
|
||||
isSingleCursorInPipe,
|
||||
} from 'lang/queryAst'
|
||||
import { TEST } from 'env'
|
||||
@ -447,8 +448,13 @@ export const ModelingMachineProvider = ({
|
||||
if (
|
||||
selectionRanges.codeBasedSelections.length === 0 ||
|
||||
isSelectionLastLine(selectionRanges, codeManager.code)
|
||||
)
|
||||
return true
|
||||
) {
|
||||
// they have no selection, we should enable the button
|
||||
// so they can select the face through the cmdbar
|
||||
// BUT only if there's extrudable geometry
|
||||
if (hasExtrudableGeometry(kclManager.ast)) return true
|
||||
return false
|
||||
}
|
||||
if (!isPipe) return false
|
||||
|
||||
return canExtrudeSelection(selectionRanges)
|
||||
|
Reference in New Issue
Block a user