jit icon indicating copy to clipboard operation
jit copied to clipboard

Canvas Dragging on Mobile

Open thyandrecardoso opened this issue 10 years ago • 4 comments

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?

thyandrecardoso avatar Sep 05 '13 11:09 thyandrecardoso

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));
      }

LonMcGregor avatar Mar 28 '16 17:03 LonMcGregor

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

pkExec avatar Nov 25 '16 14:11 pkExec

Thanx LonMcGregor.

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

koctob avatar Apr 18 '17 07:04 koctob

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

Photon89 avatar Apr 30 '18 05:04 Photon89