Rename "useReaderHorizontalModeInvertXYScrolling" to reflect actual behavior

The Y scroll direction gets mapped to the X direction. And the horizontal direction gets inverted based on the reading direction.
This commit is contained in:
schroda
2025-11-12 03:09:25 +01:00
parent 88f1ef7384
commit 197d55f819
2 changed files with 3 additions and 3 deletions

View File

@@ -30,7 +30,7 @@ import { applyStyles } from '@/base/utils/ApplyStyles.ts';
import { withPropsFrom } from '@/base/hoc/withPropsFrom.tsx'; import { withPropsFrom } from '@/base/hoc/withPropsFrom.tsx';
import { useReaderAutoScroll } from '@/features/reader/auto-scroll/hooks/useReaderAutoScroll.ts'; import { useReaderAutoScroll } from '@/features/reader/auto-scroll/hooks/useReaderAutoScroll.ts';
import { useReaderHideOverlayOnUserScroll } from '@/features/reader/overlay/hooks/useReaderHideOverlayOnUserScroll.ts'; import { useReaderHideOverlayOnUserScroll } from '@/features/reader/overlay/hooks/useReaderHideOverlayOnUserScroll.ts';
import { useReaderHorizontalModeInvertXYScrolling } from '@/features/reader/viewer/hooks/useReaderHorizontalModeInvertXYScrolling.ts'; import { useReaderHorizontalModeRevampScrolling } from '@/features/reader/viewer/hooks/useReaderHorizontalModeRevampScrolling.ts';
import { useReaderHideCursorOnInactivity } from '@/features/reader/viewer/hooks/useReaderHideCursorOnInactivity.ts'; import { useReaderHideCursorOnInactivity } from '@/features/reader/viewer/hooks/useReaderHideCursorOnInactivity.ts';
import { useReaderScrollToStartOnPageChange } from '@/features/reader/viewer/hooks/useReaderScrollToStartOnPageChange.ts'; import { useReaderScrollToStartOnPageChange } from '@/features/reader/viewer/hooks/useReaderScrollToStartOnPageChange.ts';
import { useReaderHandlePageSelection } from '@/features/reader/viewer/hooks/useReaderHandlePageSelection.ts'; import { useReaderHandlePageSelection } from '@/features/reader/viewer/hooks/useReaderHandlePageSelection.ts';
@@ -252,7 +252,7 @@ const BaseReaderViewer = ({
scrollElementRef, scrollElementRef,
); );
useReaderHideCursorOnInactivity(scrollElementRef); useReaderHideCursorOnInactivity(scrollElementRef);
useReaderHorizontalModeInvertXYScrolling(readingMode, readingDirection, scrollElementRef); useReaderHorizontalModeRevampScrolling(readingMode, readingDirection, scrollElementRef);
useReaderHideOverlayOnUserScroll(isOverlayVisible, showPreview, setShowPreview, scrollElementRef); useReaderHideOverlayOnUserScroll(isOverlayVisible, showPreview, setShowPreview, scrollElementRef);
useReaderAutoScroll( useReaderAutoScroll(
isOverlayVisible, isOverlayVisible,

View File

@@ -10,7 +10,7 @@ import { MutableRefObject, useEffect } from 'react';
import { ReadingDirection, ReadingMode } from '@/features/reader/Reader.types.ts'; import { ReadingDirection, ReadingMode } from '@/features/reader/Reader.types.ts';
import { PointerDeviceUtil } from '@/lib/PointerDeviceUtil.ts'; import { PointerDeviceUtil } from '@/lib/PointerDeviceUtil.ts';
export const useReaderHorizontalModeInvertXYScrolling = ( export const useReaderHorizontalModeRevampScrolling = (
readingMode: ReadingMode, readingMode: ReadingMode,
readingDirection: ReadingDirection, readingDirection: ReadingDirection,
scrollElementRef: MutableRefObject<HTMLDivElement | null>, scrollElementRef: MutableRefObject<HTMLDivElement | null>,