Compare commits

...

1 Commits

Author SHA1 Message Date
8445d2bd70 zoom tweaks 2024-06-14 06:41:42 +10:00

View File

@ -433,7 +433,6 @@ export class CameraControls {
} }
onMouseWheel = (event: WheelEvent) => { onMouseWheel = (event: WheelEvent) => {
// Assume trackpad if the deltas are small and integers
this.handleStart() this.handleStart()
if (this.syncDirection === 'engineToClient') { if (this.syncDirection === 'engineToClient') {
@ -445,12 +444,35 @@ export class CameraControls {
return return
} }
this.engineCommandManager.sendSceneCommand({ this.engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req', type: 'modeling_cmd_batch_req',
batch_id: uuidv4(),
requests: [
{
cmd: { cmd: {
type: 'default_camera_zoom', type: 'camera_drag_start',
magnitude: -event.deltaY * 0.4, interaction: 'zoom',
window: { x: 5, y: 5 },
}, },
cmd_id: uuidv4(), cmd_id: uuidv4(),
},
{
cmd: {
type: 'camera_drag_move',
interaction: 'zoom',
window: { x: 0, y: 5 - event.deltaY },
},
cmd_id: uuidv4(),
},
{
cmd: {
type: 'camera_drag_end',
interaction: 'zoom',
window: { x: 5, y: 5 - event.deltaY },
},
cmd_id: uuidv4(),
},
],
responses: false,
}) })
this.handleEnd() this.handleEnd()
return return