Skip to content

Commit 2df49c4

Browse files
committed
Fix: Improve drag scrolling (Ignore right-click and add activation dead zone)
1 parent 56b0f4f commit 2df49c4

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1919
- Support playing background music on a specific page [`23aae8a`](https://github.com/ollm/OpenComic/commit/23aae8abdc8c1bd983411f0f9eeac974218694fa)
2020
- Options in OPDS to auto-download files from the catalog [`594d69f`](https://github.com/ollm/OpenComic/commit/594d69f81e3740c0be32e284dac3aed1aba69de9)
2121
- Support for tabs [`d9f7fa0`](https://github.com/ollm/OpenComic/commit/d9f7fa048b743c918c44e077e0bae08705e7b8c0)
22-
- Option to extract document images (PDF and EPUB)
22+
- Option to extract document images (PDF and EPUB) [`56b0f4f`](https://github.com/ollm/OpenComic/commit/56b0f4fda8c4b174469a2088c95ab786810d59b1)
2323

2424
##### 🐛 Bug Fixes
2525

@@ -30,6 +30,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3030
- Prevent crash when retrieving metadata with Sharp for many large images (Linux only) [`d5616d8`](https://github.com/ollm/OpenComic/commit/d5616d86bd38841e02bf70d4a2e2502063c45328)
3131
- Extract files when the file in it starts with the '-' character [`3806516`](https://github.com/ollm/OpenComic/commit/38065169d0a7583a7543154fad44351af221a23c)
3232
- Use reading sort for thumbnail/poster generation [`cca841e`](https://github.com/ollm/OpenComic/commit/cca841e3eacc88b60ca55d619a5f67beeef7f646)
33+
- Improve drag scrolling (Ignore right-click and add activation dead zone)
3334

3435
## [v1.6.5](https://github.com/ollm/OpenComic/releases/tag/v1.6.5) (31-10-2025)
3536

scripts/reading.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4943,20 +4943,25 @@ function pointermove(event)
49434943

49444944
if(!readingDragScroll.start)
49454945
{
4946-
readingDragScroll.start = true;
4947-
4948-
dom.query('body').addClass('dragging');
4946+
if(Math.abs(pageY - readingDragScroll.pageY) > 16)
4947+
{
4948+
readingDragScroll.pageY = pageY;
4949+
readingDragScroll.start = true;
4950+
dom.query('body').addClass('dragging');
4951+
}
49494952
}
4953+
else
4954+
{
4955+
if(readingDragScroll.speed.length > 2)
4956+
readingDragScroll.speed.shift();
49504957

4951-
if(readingDragScroll.speed.length > 2)
4952-
readingDragScroll.speed.shift();
4953-
4954-
readingDragScroll.speed.push({
4955-
time: performance.now(),
4956-
pageY: pageY,
4957-
});
4958+
readingDragScroll.speed.push({
4959+
time: performance.now(),
4960+
pageY: pageY,
4961+
});
49584962

4959-
readingDragScroll.content.scrollTop(readingDragScroll.scrollTop - (pageY - readingDragScroll.pageY));
4963+
readingDragScroll.content.scrollTop(readingDragScroll.scrollTop - (pageY - readingDragScroll.pageY));
4964+
}
49604965
}
49614966

49624967
if(hiddenContentLeft || hiddenBarHeader) // Show content left and header bar when they are hidden
@@ -5271,7 +5276,7 @@ async function read(path, index = 1, end = false, isCanvas = false, isEbook = fa
52715276

52725277
if(onReading && isLoaded && (!haveZoom || config.readingGlobalZoom) && !config.readingScrollWithMouse && readingViewIs('scroll'))
52735278
{
5274-
if(e.originalEvent.pointerType != 'touch' && e.originalEvent.button >= 0 && e.originalEvent.button <= 2)
5279+
if(e.originalEvent.pointerType != 'touch' && e.originalEvent.button >= 0 && e.originalEvent.button <= 1)
52755280
{
52765281
// e.preventDefault();
52775282

0 commit comments

Comments
 (0)