Paper scroller can't slide in both axis at the same time (using touchpad)

226 views
Skip to first unread message

Alexander Nestorov

unread,
Mar 5, 2021, 7:26:30 PM3/5/21
to JointJS
Using my mac's touchpad (or my magic trackpad) I can slide the paper scroller of my paper on one direction at a time. I can either scroll it on the X axis or on the Y axis, but I can't scroll on both axis at the same time.

I'm not sure if this can be reproduced with a mouse (most probably not), but it can be reproduced with any touchpad that supports multidirectional scrolling (2 axis at the same time).

Is this expected behaviour or is that a bug? Or maybe just missing feature?

Alexander Nestorov

unread,
Apr 22, 2021, 1:19:33 PM4/22/21
to JointJS
I wasn't sure this could even be achieved in a web-browser, but it seems that it is possible.


What do you think @Roman? Worth implementing?



Roman Bruckner

unread,
Apr 26, 2021, 10:27:02 AM4/26/21
to joi...@googlegroups.com
Hi Alex,

to be honest I am not sure why this is not the default behaviour in browsers. The PaperScroller does not handle this at all. We let the browser do the user scrolling (just by having a container with overflow: scroll).

You can scroll manually on mousewheel as shown here.

            paperScroller.lock();

            paperScroller.el.addEventListener('mousewheel', function(evt) {

                const dx = evt.deltaX;
                const dy = evt.deltaY;

                paperScroller.el.scrollLeft += dx;
                paperScroller.el.scrollTop += dy;

            }, false);

Best,
Roman




--

---
You received this message because you are subscribed to the Google Groups "JointJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jointjs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jointjs/d22e1612-80d7-4a10-94d2-3d74826685afn%40googlegroups.com.


--

Alexander Nestorov

unread,
Apr 26, 2021, 11:53:40 AM4/26/21
to joi...@googlegroups.com
Hi Roman!

Certainly it feels like this should be the default behaviour in web browsers, but unfortunately that's not the
case in any of the web browsers I tried.

A related feature would be inertia-drag. Are you open to patches? I'm interested in both things and I
might as well write the code myself if JointJS won't support that. I'm open to submitting my code if 
you feel you can merge it.

Regards

You received this message because you are subscribed to a topic in the Google Groups "JointJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jointjs/RCEtwGeQJus/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jointjs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jointjs/CAB8Z7Xe1h0ToW8aiJ70x0xQsrNv3jLh06_%2BXa_Nvm0FYTxLSmQ%40mail.gmail.com.

Roman Bruckner

unread,
Apr 26, 2021, 1:31:39 PM4/26/21
to joi...@googlegroups.com
Hi Alex,

we're definitely open to accepting pull requests with new features.

JointJS - just open a PR on GitHub
Rappid - please PM me

Thank you,
Roman

Alexander Nestorov

unread,
Apr 26, 2021, 1:33:14 PM4/26/21
to joi...@googlegroups.com
Great!

Were would you like to have the inertia-drag and the bidirectional scrolling features? JointJS or Rappid?



Roman Bruckner

unread,
Apr 26, 2021, 2:07:39 PM4/26/21
to joi...@googlegroups.com
I think it would make sense to implement this as part of Rappid's PaperScroller (JointJS Paper does not scroll). If a lower-level feature/change related to the Paper is required, this could be added to JointJS.
Best,
Roman


Alexander Nestorov

unread,
Apr 26, 2021, 3:38:13 PM4/26/21
to joi...@googlegroups.com
Sounds good! 

I'll start working on this shortly!

Regards


Alexander Nestorov

unread,
May 3, 2021, 2:52:33 PM5/3/21
to JointJS
Patch has been submitted :) 

Alexander Nestorov

unread,
Mar 5, 2022, 10:00:10 AM3/5/22
to JointJS
Hi Roman!

I saw the Rappid 3.5.0 release (and the JointJS 3.5.x releases)! Kudos for the great work!

I spent yesterday evening upgrading to the new version of both libs and I haven't encountered any regressions so far, which is great!
I also made a full diff of the source code just to check what/how the code changed. While I do see some bug fixes regarding
the mousewheel, I couldn't find neither the "scroll-both-axis-at-the-same-time" patch nor the "pitch-to-zoom" patch that I sent
you some time ago and I just wanted to confirm if you decided to exclude them from this release and if you plan to merge them in future releases.

Regards!

Roman Bruckner

unread,
Mar 7, 2022, 8:52:21 AM3/7/22
to joi...@googlegroups.com
Hi Alex,

Thank you for the feedback on Rappid v3.5.

The "scroll-both-axis-at-the-same-time" patch and the "pinch-to-zoom" features have been excluded from this release and we do have plans to add them in the next release. I have your codepen, just have to turn this into a feature and test it in all browsers.

Best,
Roman

Alexander Nestorov

unread,
Jul 11, 2022, 3:07:58 PM7/11/22
to joi...@googlegroups.com
Hi Roman!

I just wanted to check if you had the chance to merge this feature into jointjs+ (kudos for the name change!)

Regards!


Reply all
Reply to author
Forward
0 new messages