Skip to content

PDF: add pan across x axis by pressing space and moving the mouse - #408

Closed
kenekoba wants to merge 8 commits into
suchnsuch:mainfrom
kenekoba:pdf-pan-x-scroll
Closed

PDF: add pan across x axis by pressing space and moving the mouse#408
kenekoba wants to merge 8 commits into
suchnsuch:mainfrom
kenekoba:pdf-pan-x-scroll

Conversation

@kenekoba

@kenekoba kenekoba commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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

@kenekoba kenekoba changed the title add pan across x axis by pressing space and moving the mouse PDF: add pan across x axis by pressing space and moving the mouse Jul 29, 2026

@taylorhadden taylorhadden left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My primary thought here is: should we instead be panning with a Right click & drag or with a Space + LMB & Drag?

Comment thread apps/tangent-electron/src/app/views/node-views/PdfView.svelte Outdated
Comment thread apps/tangent-electron/src/app/views/node-views/PdfView.svelte Outdated
Comment thread apps/tangent-electron/src/app/views/node-views/PdfView.svelte Outdated
Comment thread apps/tangent-electron/src/app/views/node-views/PdfView.svelte Outdated
Comment thread apps/tangent-electron/src/app/views/node-views/PdfView.svelte Outdated
@kenekoba

kenekoba commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

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)

@kenekoba

This comment was marked as off-topic.

@taylorhadden taylorhadden left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this is showing up as changed. Ideally it's not in the PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see your other comment now. That's annoying! Windows' terrible file management issues rise again. I should shorten that filename…

@kenekoba kenekoba Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the stupid part is that I've managed to restore the file by Github web editor, but it's still listed as changed files, despite that I've copied the file content exactly as it was

{BA8A0F9C-4338-4BA2-B6F9-B7B2691E7EFF}

@kenekoba

kenekoba commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

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.

OK, I think I'm done here.
choose what feels more natural

as a reminder, I've added another feature where pressing shift while scrolling changes the scroll direction. (web browsers implement this feature)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants