Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas Dragging on Mobile #166

Open
thyandrecardoso opened this issue Sep 5, 2013 · 4 comments
Open

Canvas Dragging on Mobile #166

thyandrecardoso opened this issue Sep 5, 2013 · 4 comments

Comments

@thyandrecardoso
Copy link

Hi,
Canvas dragging does not seem to be working on any of the available examples, when on mobile (at least iPad).

Is it possible to make it work on iPad?

@LonMcGregor
Copy link

I'm not sure what causes this [tested on mobiles, tablets] on the spacetree, but a quick and dirty way to make it work (as far as i can see) is to go to MouseEventsManager.attachEvents [in the non-minified file], and change the touch handlers as follows:

      'touchstart': function(e, win) {
-        that.handleEvent('TouchStart', e, win, that.makeEventObject(e, win));
+        that.handleEvent('MouseDown', e, win, that.makeEventObject(e, win));
      },
      'touchmove': function(e, win) {
-        that.handleEvent('TouchMove', e, win, that.makeEventObject(e, win));
+        that.handleEvent('MouseMove', e, win, that.makeEventObject(e, win));
      },
      'touchend': function(e, win) {
-        that.handleEvent('TouchEnd', e, win, that.makeEventObject(e, win));
+        that.handleEvent('MouseUp', e, win, that.makeEventObject(e, win));
      }

@pkExec
Copy link

pkExec commented Nov 25, 2016

How can this still be in issue 3 years later?
Mobile panning doesn't work even in the basic examples: https://philogb.github.io/jit/static/v20/Jit/Examples/Spacetree/example1.html

@koctob
Copy link

koctob commented Apr 18, 2017

Thanx LonMcGregor.

It's working with your modification. Does someone plan to fix this issue?

@Photon89
Copy link

Photon89 commented Apr 30, 2018

Also affected by this, a fix would be great! The workaround by @LonMcGregor works for me as well, though, thanks for that!

Photon89 added a commit to serlo-graphs/serlo-graphs.github.io that referenced this issue Apr 30, 2018
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

No branches or pull requests

5 participants