fix sketch flash part 2 (#6366)
This commit is contained in:
@ -894,7 +894,6 @@ export class SceneEntities {
|
||||
) => {
|
||||
if (trap(modifiedAst)) return Promise.reject(modifiedAst)
|
||||
const nextAst = await this.kclManager.updateAst(modifiedAst, false)
|
||||
this.tearDownSketch({ removeAxis: false })
|
||||
this.sceneInfra.resetMouseListeners()
|
||||
await this.setupSketch({
|
||||
sketchEntryNodePath,
|
||||
@ -968,7 +967,6 @@ export class SceneEntities {
|
||||
|
||||
const draftExpressionsIndices = { start: index, end: index }
|
||||
|
||||
if (shouldTearDown) this.tearDownSketch({ removeAxis: false })
|
||||
this.sceneInfra.resetMouseListeners()
|
||||
|
||||
const { truncatedAst } = await this.setupSketch({
|
||||
@ -1838,7 +1836,6 @@ export class SceneEntities {
|
||||
const index = sg.paths.length // because we've added a new segment that's not in the memory yet
|
||||
const draftExpressionsIndices = { start: index, end: index }
|
||||
|
||||
this.tearDownSketch({ removeAxis: false })
|
||||
this.sceneInfra.resetMouseListeners()
|
||||
|
||||
const { truncatedAst } = await this.setupSketch({
|
||||
@ -2069,7 +2066,6 @@ export class SceneEntities {
|
||||
// Get the insertion index from the modified path
|
||||
const insertIndex = Number(mod.pathToNode[1][0])
|
||||
|
||||
this.tearDownSketch({ removeAxis: false })
|
||||
this.sceneInfra.resetMouseListeners()
|
||||
|
||||
const { truncatedAst } = await this.setupSketch({
|
||||
@ -2491,7 +2487,6 @@ export class SceneEntities {
|
||||
this.sceneInfra.setCallbacks({
|
||||
onDragEnd: async () => {
|
||||
if (addingNewSegmentStatus !== 'nothing') {
|
||||
this.tearDownSketch({ removeAxis: false })
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
this.setupSketch({
|
||||
sketchEntryNodePath,
|
||||
@ -2566,7 +2561,6 @@ export class SceneEntities {
|
||||
mod.modifiedAst
|
||||
)
|
||||
if (err(didReParse)) return
|
||||
this.tearDownSketch({ removeAxis: false })
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
this.setupSketch({
|
||||
sketchEntryNodePath: pathToNode,
|
||||
|
@ -1494,7 +1494,6 @@ export const ModelingMachineProvider = ({
|
||||
async ({ input: { sketchDetails, data } }) => {
|
||||
if (!sketchDetails || !data)
|
||||
return reject('No sketch details or data')
|
||||
sceneEntitiesManager.tearDownSketch({ removeAxis: false })
|
||||
|
||||
const result = await sceneEntitiesManager.setupDraftCircle(
|
||||
sketchDetails.sketchEntryNodePath,
|
||||
@ -1515,7 +1514,6 @@ export const ModelingMachineProvider = ({
|
||||
async ({ input: { sketchDetails, data } }) => {
|
||||
if (!sketchDetails || !data)
|
||||
return reject('No sketch details or data')
|
||||
sceneEntitiesManager.tearDownSketch({ removeAxis: false })
|
||||
|
||||
const result =
|
||||
await sceneEntitiesManager.setupDraftCircleThreePoint(
|
||||
@ -1538,7 +1536,6 @@ export const ModelingMachineProvider = ({
|
||||
async ({ input: { sketchDetails, data } }) => {
|
||||
if (!sketchDetails || !data)
|
||||
return reject('No sketch details or data')
|
||||
sceneEntitiesManager.tearDownSketch({ removeAxis: false })
|
||||
|
||||
const result = await sceneEntitiesManager.setupDraftRectangle(
|
||||
sketchDetails.sketchEntryNodePath,
|
||||
@ -1559,7 +1556,6 @@ export const ModelingMachineProvider = ({
|
||||
async ({ input: { sketchDetails, data } }) => {
|
||||
if (!sketchDetails || !data)
|
||||
return reject('No sketch details or data')
|
||||
sceneEntitiesManager.tearDownSketch({ removeAxis: false })
|
||||
const result = await sceneEntitiesManager.setupDraftCenterRectangle(
|
||||
sketchDetails.sketchEntryNodePath,
|
||||
sketchDetails.sketchNodePaths,
|
||||
@ -1579,7 +1575,6 @@ export const ModelingMachineProvider = ({
|
||||
async ({ input: { sketchDetails, data } }) => {
|
||||
if (!sketchDetails || !data)
|
||||
return reject('No sketch details or data')
|
||||
sceneEntitiesManager.tearDownSketch({ removeAxis: false })
|
||||
const result = await sceneEntitiesManager.setupDraftArcThreePoint(
|
||||
sketchDetails.sketchEntryNodePath,
|
||||
sketchDetails.sketchNodePaths,
|
||||
@ -1599,7 +1594,6 @@ export const ModelingMachineProvider = ({
|
||||
async ({ input: { sketchDetails, data } }) => {
|
||||
if (!sketchDetails || !data)
|
||||
return reject('No sketch details or data')
|
||||
sceneEntitiesManager.tearDownSketch({ removeAxis: false })
|
||||
const result = await sceneEntitiesManager.setupDraftArc(
|
||||
sketchDetails.sketchEntryNodePath,
|
||||
sketchDetails.sketchNodePaths,
|
||||
|
@ -767,9 +767,7 @@ export const modelingMachine = setup({
|
||||
})().catch(reportRejection)
|
||||
},
|
||||
'tear down client sketch': () => {
|
||||
if (sceneEntitiesManager.activeSegments) {
|
||||
sceneEntitiesManager.tearDownSketch({ removeAxis: false })
|
||||
}
|
||||
},
|
||||
'remove sketch grid': () => sceneEntitiesManager.removeSketchGrid(),
|
||||
'set up draft line': assign(({ context: { sketchDetails }, event }) => {
|
||||
|
Reference in New Issue
Block a user