chore: changed the function name

This commit is contained in:
gitstart 2022-12-08 05:11:25 +00:00
parent b467894eea
commit 9ed547bc4f

View File

@ -17,7 +17,7 @@ export const withMeasure = (StoryFn: StoryFunction<Renderer>, context: StoryCont
const { measureEnabled } = context.globals;
useEffect(() => {
const onMouseMove = (event: MouseEvent) => {
const onPointerMove = (event: MouseEvent) => {
window.requestAnimationFrame(() => {
event.stopPropagation();
pointer.x = event.clientX;
@ -25,15 +25,15 @@ export const withMeasure = (StoryFn: StoryFunction<Renderer>, context: StoryCont
});
};
document.addEventListener('pointermove', onMouseMove);
document.addEventListener('pointermove', onPointerMove);
return () => {
document.removeEventListener('pointermove', onMouseMove);
document.removeEventListener('pointermove', onPointerMove);
};
}, []);
useEffect(() => {
const onMouseOver = (event: MouseEvent) => {
const onPointerOver = (event: MouseEvent) => {
window.requestAnimationFrame(() => {
event.stopPropagation();
findAndDrawElement(event.clientX, event.clientY);
@ -47,7 +47,7 @@ export const withMeasure = (StoryFn: StoryFunction<Renderer>, context: StoryCont
};
if (measureEnabled) {
document.addEventListener('pointerover', onMouseOver);
document.addEventListener('pointerover', onPointerOver);
init();
window.addEventListener('resize', onResize);
// Draw the element below the pointer when first enabled