KCL: Fix format

This commit is contained in:
Adam Chalmers
2025-06-03 18:04:35 -05:00
committed by GitHub
parent 2dc76a71cc
commit c373f33507
3 changed files with 22 additions and 22 deletions

View File

@ -532,7 +532,7 @@ test.describe('Testing Camera Movement', () => {
.then((value) => parseFloat(value)) .then((value) => parseFloat(value))
} }
async function doOrbitWith(callback = async () => { }) { async function doOrbitWith(callback = async () => {}) {
await resetCamera() await resetCamera()
await test.step(`Perform orbit`, async () => { await test.step(`Perform orbit`, async () => {

View File

@ -79,7 +79,7 @@ impl Context {
self.execute_typed(program_ast_json, path, settings) self.execute_typed(program_ast_json, path, settings)
.await .await
.and_then(|outcome|JsValue::from_serde(&outcome).map_err(|e| { .and_then(|outcome| JsValue::from_serde(&outcome).map_err(|e| {
// The serde-wasm-bindgen does not work here because of weird HashMap issues. // The serde-wasm-bindgen does not work here because of weird HashMap issues.
// DO NOT USE serde_wasm_bindgen::to_value it will break the frontend. // DO NOT USE serde_wasm_bindgen::to_value it will break the frontend.
KclErrorWithOutputs::no_outputs(KclError::internal( KclErrorWithOutputs::no_outputs(KclError::internal(

View File

@ -63,19 +63,19 @@ interface ThreeCamValues {
export type ReactCameraProperties = export type ReactCameraProperties =
| { | {
type: 'perspective' type: 'perspective'
fov?: number fov?: number
position: [number, number, number] position: [number, number, number]
target: [number, number, number] target: [number, number, number]
quaternion: [number, number, number, number] quaternion: [number, number, number, number]
} }
| { | {
type: 'orthographic' type: 'orthographic'
zoom?: number zoom?: number
position: [number, number, number] position: [number, number, number]
target: [number, number, number] target: [number, number, number]
quaternion: [number, number, number, number] quaternion: [number, number, number, number]
} }
const lastCmdDelay = 50 const lastCmdDelay = 50
@ -273,11 +273,11 @@ export class CameraControls {
type CallBackParam = Parameters< type CallBackParam = Parameters<
( (
| Subscription< | Subscription<
| 'default_camera_zoom' | 'default_camera_zoom'
| 'camera_drag_end' | 'camera_drag_end'
| 'default_camera_get_settings' | 'default_camera_get_settings'
| 'zoom_to_fit' | 'zoom_to_fit'
> >
| UnreliableSubscription<'camera_drag_move'> | UnreliableSubscription<'camera_drag_move'>
)['callback'] )['callback']
>[0] >[0]
@ -371,7 +371,7 @@ export class CameraControls {
} }
private _isCamMovingCallback: (isMoving: boolean, isTween: boolean) => void = private _isCamMovingCallback: (isMoving: boolean, isTween: boolean) => void =
() => { } () => {}
setIsCamMovingCallback(cb: (isMoving: boolean, isTween: boolean) => void) { setIsCamMovingCallback(cb: (isMoving: boolean, isTween: boolean) => void) {
this._isCamMovingCallback = cb this._isCamMovingCallback = cb
} }
@ -856,7 +856,7 @@ export class CameraControls {
// zPosition should stay the same // zPosition should stay the same
const xyRadius = Math.sqrt( const xyRadius = Math.sqrt(
(this.target.x - this.camera.position.x) ** 2 + (this.target.x - this.camera.position.x) ** 2 +
(this.target.y - this.camera.position.y) ** 2 (this.target.y - this.camera.position.y) ** 2
) )
const xyAngle = Math.atan2( const xyAngle = Math.atan2(
this.camera.position.y - this.target.y, this.camera.position.y - this.target.y,
@ -1272,7 +1272,7 @@ export class CameraControls {
], ],
} }
} }
reactCameraPropertiesCallback: (a: ReactCameraProperties) => void = () => { } reactCameraPropertiesCallback: (a: ReactCameraProperties) => void = () => {}
setReactCameraPropertiesCallback = ( setReactCameraPropertiesCallback = (
cb: (a: ReactCameraProperties) => void cb: (a: ReactCameraProperties) => void
) => { ) => {