diff --git a/src/widget/position_widget.ts b/src/widget/position_widget.ts index 79f324d2b..7556c1431 100644 --- a/src/widget/position_widget.ts +++ b/src/widget/position_widget.ts @@ -1557,6 +1557,36 @@ class DimensionTool extends Tool { }), ).element, ); + + this.registerDisposer(new MouseEventBinder(plot.element, inputEventMap)); + + registerActionListener( + plot.element, + "adjust-via-wheel", + (actionEvent) => { + actionEvent.stopPropagation(); + const event = actionEvent.detail; + const { deltaY } = event; + if (deltaY === 0) { + return; + } + positionWidget.adjustDimensionPosition( + this.dimensionId, + Math.sign(deltaY), + ); + }, + ); + + registerActionListener( + plot.element, + "adjust-velocity-via-wheel", + (actionEvent) => { + actionEvent.stopPropagation(); + const factor = getWheelZoomAmount(actionEvent.detail); + viewer.velocity.multiplyVelocity(this.dimensionId, factor); + }, + ); + return { positionWidget }; }