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

Event does not fire for target scale value when simulating pinching #5

Open
jacksonrayhamilton opened this issue Apr 28, 2016 · 0 comments

Comments

@jacksonrayhamilton
Copy link

When I use Simulator.gestures.pinch, I expect a pinch event to eventually fire with the scale I specify as an option. So, in the following test case:

package.json:

{
  "dependencies": {
    "hammer-simulator": "0.0.1",
    "hammerjs": "2.0.8"
  }
}

index.html:

<body>
  <div class="test-element"></div>
  <script src="node_modules/hammerjs/hammer.js"></script>
  <script src="node_modules/hammer-simulator/index.js"></script>
  <script src="test.js"></script>
</body>

test.js:

(function () {

    'use strict';

    var element = document.querySelector('.test-element');

    var hammertime = new Hammer(element);
    hammertime.get('pinch').set({enable: true});

    hammertime.on('pinch', function (event) {
        console.log('event.scale', event.scale);
    });

    Simulator.gestures.pinch(element, {
        scale: 2.0
    });

}());

I expect that an event.scale of 2 will eventually be logged. However, the final value to be printed is only 1.9230769230769231. Is this expected or is it a bug?

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

1 participant