This is not a nice way of doing it. This statement draws a rectangle of width this.p.w and height 2 * this.p.h. Basically, you are drawing a rectangle larger than the object size itself (which is this.p.w and this.p.h). When a touch event occurs, it is noticed in the region defined by this.p.w and this.p.h, so half of the rectangle will be not be clickable. So, change this.p.h instead.