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

Vector Drift Test Pinch Zoom Fix #8644

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Changed timing to fastframe
  • Loading branch information
stephenspol committed Nov 7, 2022
commit 827b3d1c8d62a438af9cf6bd7ae06794048d954d
40 changes: 21 additions & 19 deletions spec/suites/map/handler/Map.TouchZoomSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,33 +177,35 @@ describe("Map.TouchZoom", () => {

let alreadyCalled = false;
const hand = new Hand({
timing: 'frame',
timing: 'fastframe',
onStop() {
if (alreadyCalled) {
return; // Will recursivly call itself otherwise
}
alreadyCalled = true;
setTimeout(() => {
if (alreadyCalled) {
return; // Will recursivly call itself otherwise
}
alreadyCalled = true;

const renderedRect = polygon._path.getBoundingClientRect();
const renderedRect = polygon._path.getBoundingClientRect();

const width = renderedRect.width;
const height = renderedRect.height;
const width = renderedRect.width;
const height = renderedRect.height;

expect(height < 50).to.be(true);
expect(width < 50).to.be(true);
expect(height + width > 0).to.be(true);
expect(height < 50).to.be(true);
expect(width < 50).to.be(true);
expect(height + width > 0).to.be(true);

const x = renderedRect.x;
const y = renderedRect.y;
const x = renderedRect.x;
const y = renderedRect.y;

expect(x).to.be.within(299, 301);
expect(y).to.be.within(270, 280);
expect(x).to.be.within(299, 301);
expect(y).to.be.within(270, 280);

// Fingers lifted after expects as bug goes away when lifted
this._fingers[0].up();
this._fingers[1].up();
// Fingers lifted after expects as bug goes away when lifted
this._fingers[0].up();
this._fingers[1].up();

done();
done();
}, 100);
}
});

Expand Down