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

Commit e1a456c

Browse files
patrickhlaukescottgonzalez
authored andcommitted
Fix incorrect radiusX/Y to width/height translation
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
1 parent 3448030 commit e1a456c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/touch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ var touchEvents = {
146146
e.detail = this.clickCount;
147147
e.button = 0;
148148
e.buttons = this.typeToButtons(cte.type);
149-
e.width = inTouch.radiusX || inTouch.webkitRadiusX || 0;
150-
e.height = inTouch.radiusY || inTouch.webkitRadiusY || 0;
149+
e.width = (inTouch.radiusX || inTouch.webkitRadiusX || 0) * 2;
150+
e.height = (inTouch.radiusY || inTouch.webkitRadiusY || 0) * 2;
151151
e.pressure = inTouch.force || inTouch.webkitForce || 0.5;
152152
e.isPrimary = this.isPrimaryTouch(inTouch);
153153
e.pointerType = this.POINTER_TYPE;

0 commit comments

Comments
 (0)