From e1a456c722a5f27f699506e082d8142026c85a96 Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Mon, 24 Apr 2017 23:43:09 +0100 Subject: [PATCH] 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 --- src/touch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/touch.js b/src/touch.js index f6bb3053..c518de3f 100644 --- a/src/touch.js +++ b/src/touch.js @@ -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;