Merge pull request #2324 from rsimon/master

Applied touch rotate fix suggested in #2319
This commit is contained in:
Ian Gilman 2023-04-06 14:22:54 -07:00 committed by GitHub
commit 5b56d6fa16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3422,7 +3422,8 @@ function onCanvasPinch( event ) {
event.gesturePoints[0].currentPos.x - event.gesturePoints[1].currentPos.x);
var angle2 = Math.atan2(event.gesturePoints[0].lastPos.y - event.gesturePoints[1].lastPos.y,
event.gesturePoints[0].lastPos.x - event.gesturePoints[1].lastPos.x);
this.viewport.setRotation(this.viewport.getRotation() + ((angle1 - angle2) * (180 / Math.PI)));
centerPt = this.viewport.pointFromPixel( event.center, true );
this.viewport.rotateTo(this.viewport.getRotation(true) + ((angle1 - angle2) * (180 / Math.PI)), centerPt, true);
}
}
}