feat: wheel select
This commit is contained in:
parent
53ee52dac8
commit
7dc8618761
|
@ -40,6 +40,7 @@ const Stage = forwardRef(({
|
|||
'mouseout',
|
||||
'mousedown',
|
||||
'mouseup',
|
||||
'wheel',
|
||||
]
|
||||
.map((event) => K.fromEvents(renderer.element, event)),
|
||||
),
|
||||
|
|
|
@ -26,7 +26,13 @@ function EntitiesSide({
|
|||
if (!events) {
|
||||
return undefined;
|
||||
}
|
||||
const onValue = ({clientX, clientY, target, type}) => {
|
||||
const onValue = ({
|
||||
clientX,
|
||||
clientY,
|
||||
deltaY,
|
||||
target,
|
||||
type,
|
||||
}) => {
|
||||
const updatePosition = () => {
|
||||
const {left, top} = target.getBoundingClientRect();
|
||||
patch.diff(
|
||||
|
@ -52,6 +58,12 @@ function EntitiesSide({
|
|||
setIsHolding(false);
|
||||
break;
|
||||
}
|
||||
case 'wheel': {
|
||||
const {length} = resource.entities;
|
||||
const inc = deltaY / Math.abs(deltaY);
|
||||
setSelectedEntityIndex((selectedEntityIndex + length + inc) % length);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user