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