Horz/Vert distance constraint with modal workflow (#43)

* button style tweak

* Remove duplication constraint ast transforms

* giveSketchFnCallTag to return if line already had a tag

* remove duplication

* update tag name to referenceSegName

* Update transform shape to return key details about the transform

* add modal to hor vert distance workflow

* fix browser env stuff from breaking tests

* fmt
This commit is contained in:
Kurt Hutten
2023-03-07 15:45:59 +11:00
committed by GitHub
parent a0518c556f
commit 2ac24bcd95
16 changed files with 376 additions and 203 deletions

View File

@ -4,7 +4,7 @@ import { lexer } from '../tokeniser'
import {
ConstraintType,
getTransformInfos,
transformAstForHorzVert,
transformAstSketchLines,
} from './sketchcombos'
import { recast } from '../recast'
import { initPromise } from '../rust'
@ -32,11 +32,12 @@ function testingSwapSketchFnCall({
const transformInfos = getTransformInfos([range], ast, constraintType)
if (!transformInfos) throw new Error('nope')
const { modifiedAst } = transformAstForHorzVert({
const { modifiedAst } = transformAstSketchLines({
ast,
programMemory,
selectionRanges: [range],
transformInfos,
referenceSegName: '',
})
return {
newCode: recast(modifiedAst),