Skip to content

constraint colors #7647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"bson": "^6.10.3",
"chokidar": "^4.0.3",
"codemirror": "^6.0.1",
"culori": "^4.0.2",

Check warning on line 48 in package.json

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

package-dependencies-check

Package dependencies with variant versions may lead to dependency hijack and confusion attacks. Better to specify an exact version or use packagelock.json for a specific version of the package.
"decamelize": "^6.0.0",
"diff": "^7.0.0",
"electron-updater": "^6.6.2",
Expand Down Expand Up @@ -170,6 +171,7 @@
"@playwright/test": "^1.52.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^15.0.7",
"@types/culori": "^4.0.0",
"@types/diff": "^7.0.2",
"@types/electron": "^1.6.10",
"@types/hammerjs": "^2.0.46",
Expand Down
28 changes: 26 additions & 2 deletions src/clientSideScene/sceneEntities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ export class SceneEntities {
group: segment,
scale: factor,
sceneInfra: this.sceneInfra,
ast: this.kclManager.ast,
code: this.codeManager.code,
})
callBack && !err(callBack) && callbacks.push(callBack)
if (segment.name === PROFILE_START) {
Expand Down Expand Up @@ -729,6 +731,8 @@ export class SceneEntities {
scale,
theme: this.sceneInfra._theme,
isDraft: false,
ast: maybeModdedAst,
code: this.codeManager.code,
})
_profileStart.layers.set(SKETCH_LAYER)
_profileStart.traverse((child) => {
Expand Down Expand Up @@ -866,6 +870,8 @@ export class SceneEntities {
isSelected,
sceneInfra: this.sceneInfra,
selection,
ast: maybeModdedAst,
code: this.codeManager.code,
})
if (err(result)) return
const { group: _group, updateOverlaysCallback } = result
Expand Down Expand Up @@ -3124,6 +3130,15 @@ export class SceneEntities {
})
}
callbacks.push(startProfileCallBack)
let minIndex = -1
if (draftInfo) {
sketchNodePaths.forEach((path) => {
const currentIndex = Number(path[1][0])
if (currentIndex < minIndex || minIndex === -1) {
minIndex = currentIndex
}
})
}

callbacks.push(
...sgPaths.map((group, index) =>
Expand All @@ -3134,7 +3149,8 @@ export class SceneEntities {
modifiedAst,
orthoFactor,
sketch,
snappedToTangent
snappedToTangent,
minIndex
)
)
)
Expand Down Expand Up @@ -3163,7 +3179,8 @@ export class SceneEntities {
modifiedAst: Program,
orthoFactor: number,
sketch: Sketch,
snappedToTangent: boolean = false
snappedToTangent: boolean = false,
truncatedExpressionIndexOffset?: number
): (() => SegmentOverlayPayload | null) => {
const segPathToNode = getNodePathFromSourceRange(
modifiedAst,
Expand Down Expand Up @@ -3256,6 +3273,9 @@ export class SceneEntities {
scale: factor,
prevSegment: sgPaths[index - 1],
sceneInfra: this.sceneInfra,
ast: modifiedAst,
code: this.codeManager.code,
truncatedExpressionIndexOffset,
})
if (callBack && !err(callBack)) return callBack

Expand Down Expand Up @@ -3421,6 +3441,8 @@ export class SceneEntities {
group: parent,
scale: factor,
sceneInfra: this.sceneInfra,
ast: this.kclManager.ast,
code: this.codeManager.code,
})
return
}
Expand Down Expand Up @@ -3498,6 +3520,8 @@ export class SceneEntities {
group: parent,
scale: factor,
sceneInfra: this.sceneInfra,
ast: this.kclManager.ast,
code: this.codeManager.code,
})
}
const isSelected = parent?.userData?.isSelected
Expand Down
Loading
Loading