Compare commits

...

4 Commits

Author SHA1 Message Date
548b45905e Cut release v0.11.3 (#1020)
cut release v0.11.3
2023-11-08 12:57:00 +11:00
141fd2f3f1 fix variables panel and others (#1021) 2023-11-08 01:27:43 +00:00
604d931962 selections fix follow up (#1019) 2023-11-07 23:10:30 +00:00
b1668410f8 Neaten up stdlib code (#1017) 2023-11-07 12:12:18 -06:00
6 changed files with 15 additions and 16 deletions

View File

@ -1,6 +1,6 @@
{
"name": "untitled-app",
"version": "0.11.2",
"version": "0.11.3",
"private": true,
"dependencies": {
"@codemirror/autocomplete": "^6.10.2",

View File

@ -8,7 +8,7 @@
},
"package": {
"productName": "kittycad-modeling",
"version": "0.11.2"
"version": "0.11.3"
},
"tauri": {
"allowlist": {

View File

@ -32,11 +32,10 @@ export function useEngineConnectionSubscriptions() {
const unSubClick = engineCommandManager.subscribeTo({
event: 'select_with_point',
callback: async (engineEvent) => {
if (!context.sketchEnginePathId) return
const event = await getEventForSelectWithPoint(engineEvent, {
sketchEnginePathId: context.sketchEnginePathId,
})
send(event)
event && send(event)
},
})
return () => {

View File

@ -238,10 +238,10 @@ class KclManager {
defaultPlanes: this.defaultPlanes,
})
this.isExecuting = false
this._logs = logs
this._kclErrors = errors
this._programMemory = programMemory
this._ast = { ...ast }
this.logs = logs
this.kclErrors = errors
this.programMemory = programMemory
this.ast = { ...ast }
if (updateCode) {
this.code = recast(ast)
}

View File

@ -102,8 +102,8 @@ export async function getEventForSelectWithPoint(
Models['OkModelingCmdResponse_type'],
{ type: 'select_with_point' }
>,
{ sketchEnginePathId }: { sketchEnginePathId: string }
): Promise<ModelingMachineEvent> {
{ sketchEnginePathId }: { sketchEnginePathId?: string }
): Promise<ModelingMachineEvent | null> {
if (!data?.entity_id) {
return {
type: 'Set selection',
@ -120,6 +120,7 @@ export async function getEventForSelectWithPoint(
},
}
}
if (!sketchEnginePathId) return null
// selected a vertex
const res = await engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',

View File

@ -31,7 +31,7 @@ pub struct StdLib {
impl StdLib {
pub fn new() -> Self {
let internal_fns: Vec<Box<(dyn crate::docs::StdLibFn)>> = vec![
let internal_fns: [Box<dyn crate::docs::StdLibFn>; 55] = [
Box::new(Show),
Box::new(LegLen),
Box::new(LegAngX),
@ -88,11 +88,10 @@ impl StdLib {
Box::new(crate::std::math::Log10),
Box::new(crate::std::math::Ln),
];
let mut fns = HashMap::new();
for internal_fn in &internal_fns {
fns.insert(internal_fn.name().to_string(), internal_fn.clone());
}
let fns = internal_fns
.into_iter()
.map(|internal_fn| (internal_fn.name(), internal_fn))
.collect();
Self { fns }
}