PDF: add pan across x axis by pressing space and moving the mouse - #408
PDF: add pan across x axis by pressing space and moving the mouse#408kenekoba wants to merge 8 commits into
Conversation
taylorhadden
left a comment
There was a problem hiding this comment.
My primary thought here is: should we instead be panning with a Right click & drag or with a Space + LMB & Drag?
we may need to reserve right click operations for future features (e.g. highlight, other operations, etc) |
This reverts commit 7d4390a.
This comment was marked as off-topic.
This comment was marked as off-topic.
taylorhadden
left a comment
There was a problem hiding this comment.
Thanks for making these changes! Just a small note about the css.
I'll see how Space + Drag feels. I anticipate that I will change it to be a Space + LMB + Drag gesture, but we'll see.
| -webkit-user-select: text; | ||
| user-select: text; | ||
|
|
||
| .panning { |
There was a problem hiding this comment.
You need to use &.panning here to have it affect the container as well. This selector compiles to article .container .panning and using & gives you article .container.panning.
There was a problem hiding this comment.
the panning class is applied to the viewerElement not the container itself:
<div class="container pdfViewer" bind:this={container}>
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div bind:this={viewerElement} class={{ 'panning': isPanning }} on:mousemove={onMouseMove} on:click={onClick}></div>
</div>
| @@ -1 +1 @@ | |||
| And it's got nothing in it! No newline at end of file | |||
There was a problem hiding this comment.
Not sure why this is showing up as changed. Ideally it's not in the PR.
There was a problem hiding this comment.
Oh, I see your other comment now. That's annoying! Windows' terrible file management issues rise again. I should shorten that filename…
OK, I think I'm done here. as a reminder, I've added another feature where pressing shift while scrolling changes the scroll direction. (web browsers implement this feature) |

Hi,
almost all PDF viewer softwares allow the user to scroll x axis by pressing space and moving (dragging) the mouse
this feature is not needed in laptops because of touchpad but in desktop that only has mouse & keyboard it's needed