Nadro/2608/sketch mode scene state improvements (#3866)

* bug: fixing multiple state issues with the engine and modeling app to enable/disable planes/axis/delete code

* fix: yarn tsc fmt lint xgen

* fix: adding a comment back that I deleted on accident

* fix: adding formatting back?

* fix: reverting syntax

* fix: removing click line tool because the line tool is automatically selected. Clicking this will exit

* fix: Fixed a E2E test that had a line tool workflow with no points

---------

Co-authored-by: Frank Noirot <frank@zoo.dev>
Co-authored-by: 49fl <ircsurfer33@gmail.com>
This commit is contained in:
Kevin Nadro
2024-10-09 10:33:20 -04:00
committed by GitHub
parent b745cec079
commit 01c6774c54
5 changed files with 61 additions and 10 deletions

View File

@ -295,15 +295,24 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
'break',
{
id: 'line',
onClick: ({ modelingState, modelingSend }) =>
modelingSend({
type: 'change tool',
data: {
tool: !modelingState.matches({ Sketch: 'Line tool' })
? 'line'
: 'none',
},
}),
onClick: ({ modelingState, modelingSend }) => {
if (modelingState.matches({ Sketch: { 'Line tool': 'No Points' } })) {
// Exit the sketch state if there are no points and they press ESC
modelingSend({
type: 'Cancel',
})
} else {
// Exit the tool if there are points and they press ESC
modelingSend({
type: 'change tool',
data: {
tool: !modelingState.matches({ Sketch: 'Line tool' })
? 'line'
: 'none',
},
})
}
},
icon: 'line',
status: 'available',
disabled: (state) =>