zoom tweaks
This commit is contained in:
@ -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',
|
||||||
cmd: {
|
batch_id: uuidv4(),
|
||||||
type: 'default_camera_zoom',
|
requests: [
|
||||||
magnitude: -event.deltaY * 0.4,
|
{
|
||||||
},
|
cmd: {
|
||||||
cmd_id: uuidv4(),
|
type: 'camera_drag_start',
|
||||||
|
interaction: 'zoom',
|
||||||
|
window: { x: 5, y: 5 },
|
||||||
|
},
|
||||||
|
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
|
||||||
|
Reference in New Issue
Block a user