From c3a7ffacfeb156ff3ccb4413d7709e90534e7758 Mon Sep 17 00:00:00 2001 From: PastLeo Date: Tue, 31 May 2016 17:17:09 +0800 Subject: [PATCH] fix button check detection origin problem --- src/gamecontroller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gamecontroller.js b/src/gamecontroller.js index 693559e..a688a05 100644 --- a/src/gamecontroller.js +++ b/src/gamecontroller.js @@ -921,8 +921,8 @@ */ TouchableButton.prototype.check = function( touchX, touchY ) { var radius = this.radius + GameController.options.touchRadius / 2; - return Math.abs(touchX - this.x) < radius && - Math.abs(touchY - this.y) < radius; + return Math.abs(touchX - this.x - this.radius) < radius && + Math.abs(touchY - this.y - this.radius) < radius; }; TouchableButton.prototype.draw = function() {