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

Selection not working after first selection - Chrome + tablet touch mode #35

Open
AlexDarbyFujitsuGmail opened this issue Apr 26, 2018 · 6 comments

Comments

@AlexDarbyFujitsuGmail
Copy link

There is a issue which happens after a image selection has been made.

To reproduce:

  1. start chome browser
  2. open webpage https://picturae.github.io/openseadragonselection/
  3. open chrome developer tools (More tools / Developer tools)
  4. developer tools - select the Toogle device toolbar to set tablet touch mode
  5. webpage - select the tool selection icon (empty square)
  6. create a selection on the image
  7. confirm or cancel the selection
  8. try to create a new selection (this will not be possible)
@iangilman
Copy link

Hopefully @picturae can help out, but if not, you might try looking at the MouseTracker handlers in selection.js.

@sekwah41
Copy link
Contributor

sekwah41 commented May 8, 2018

Issue is fixed by on cancel calling
this.outerTracker.setTracking(false); this.outerTracker.setTracking(true);

So I am not sure what needs to be changed but it solves the problem

@iangilman
Copy link

Good find! It would be nice to know why that fixes it, but even adding it to this plugin as is might be an improvement.

@sekwah41
Copy link
Contributor

sekwah41 commented May 9, 2018

I will make a quick pull request in a min for this fix

@sekwah41
Copy link
Contributor

sekwah41 commented May 13, 2018

@iangilman seems that the pointers are not being reset correctly. I have managed to so far narrow it down to clearTrackedPointers(tracker). If you add the below passthrough to $.MouseTracker.prototype it also fixes the issue.
selection.js

cancel: function() {
            /*
             * These two lines have been added to fix a issue with mobile where the selection is just a pinpoint after the first drag
             * For some reason disabling then re-enabling the tracking fixes this issue.
             */
            this.outerTracker.clearPoints();
            this.viewer.raiseEvent('selection_cancel', false);
            return this.undraw();
        },

$.MouseTracker.prototype from openseadragon.js

clearPoints: function() {
            clearTrackedPointers(this);
        },

My suggestion would be to either look at how the trackers are handled or add an option to call this on trackers into openseadragon at least as a fix for now as well as for more power to addons.

@iangilman
Copy link

@sekwah41 sounds promising. @msalsbery do you have any thoughts on the above?

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

3 participants