Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fix incorrect radiusX/Y to width/height translation
Browse files Browse the repository at this point in the history
Currently, in the case of touch, width/height use radiusX/radiusY, which
results in half the expected width/height (should be the diameters)

Closes gh-343
  • Loading branch information
patrickhlauke authored and scottgonzalez committed Apr 25, 2017
1 parent 3448030 commit e1a456c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ var touchEvents = {
e.detail = this.clickCount;
e.button = 0;
e.buttons = this.typeToButtons(cte.type);
e.width = inTouch.radiusX || inTouch.webkitRadiusX || 0;
e.height = inTouch.radiusY || inTouch.webkitRadiusY || 0;
e.width = (inTouch.radiusX || inTouch.webkitRadiusX || 0) * 2;
e.height = (inTouch.radiusY || inTouch.webkitRadiusY || 0) * 2;
e.pressure = inTouch.force || inTouch.webkitForce || 0.5;
e.isPrimary = this.isPrimaryTouch(inTouch);
e.pointerType = this.POINTER_TYPE;
Expand Down

0 comments on commit e1a456c

Please sign in to comment.