mirror of
https://github.com/MrXujiang/h5-Dooring.git
synced 2026-01-19 12:21:07 +00:00
commit
15dd6916cb
@ -214,11 +214,11 @@ const Container = (props: {
|
|||||||
}, [graphTpl, mediaTpl, template]);
|
}, [graphTpl, mediaTpl, template]);
|
||||||
|
|
||||||
const [dragstate, setDragState] = useState({ x: 0, y: 0 });
|
const [dragstate, setDragState] = useState({ x: 0, y: 0 });
|
||||||
const [render] = useGetBall(setDragState, {
|
// const [render] = useGetBall(setDragState, {
|
||||||
innerStyle: { top: '10px', left: '10px', cursor: 'pointer' },
|
// innerStyle: { top: '10px', left: '10px', cursor: 'pointer' },
|
||||||
ratioSpeed: { x: 1.2, y: 1.2 },
|
// ratioSpeed: { x: 1.2, y: 1.2 },
|
||||||
intervalDelay: 5,
|
// intervalDelay: 5,
|
||||||
});
|
// });
|
||||||
|
|
||||||
const renderRight = useMemo(() => {
|
const renderRight = useMemo(() => {
|
||||||
if (context.theme === 'h5') {
|
if (context.theme === 'h5') {
|
||||||
@ -409,6 +409,22 @@ const Container = (props: {
|
|||||||
};
|
};
|
||||||
}, [diffmove.move]);
|
}, [diffmove.move]);
|
||||||
|
|
||||||
|
const onwheelFn = useMemo(() => {
|
||||||
|
return (e: React.WheelEvent<HTMLDivElement>) => {
|
||||||
|
if (e.deltaY > 0) {
|
||||||
|
setDragState(prev => ({
|
||||||
|
x: prev.x,
|
||||||
|
y: prev.y + 10,
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
setDragState(prev => ({
|
||||||
|
x: prev.x,
|
||||||
|
y: prev.y - 10,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (diffmove.move && containerRef.current) {
|
if (diffmove.move && containerRef.current) {
|
||||||
containerRef.current.style.cursor = 'move';
|
containerRef.current.style.cursor = 'move';
|
||||||
@ -470,6 +486,7 @@ const Container = (props: {
|
|||||||
onMouseMove={throttle(mousemovefn, 500)}
|
onMouseMove={throttle(mousemovefn, 500)}
|
||||||
onMouseUp={mouseupfn}
|
onMouseUp={mouseupfn}
|
||||||
onMouseLeave={mouseupfn}
|
onMouseLeave={mouseupfn}
|
||||||
|
onWheel={onwheelFn}
|
||||||
>
|
>
|
||||||
<div className={styles.tickMarkTop}>
|
<div className={styles.tickMarkTop}>
|
||||||
<Calibration direction="up" id="calibrationUp" multiple={scaleNum} />
|
<Calibration direction="up" id="calibrationUp" multiple={scaleNum} />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user