chiark / gitweb /
Button zones: Remove inexplicable pad_with/2 offset
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 23 Apr 2016 18:27:28 +0000 (19:27 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 26 Apr 2016 19:42:32 +0000 (20:42 +0100)
commit88e8d8d49cc5e462b8b385a20c0a46d9a34145f1
tree22ae20fcb6d368aa49edc4f24f9a7e4a844d6270
parent35b5a69fb105df3ca601e8a274b4e3b5da899293
Button zones: Remove inexplicable pad_with/2 offset

When button zones are in use, the code attempts to calculate which
zone the finger is in.  The left and right edges of the zones are
calculated according the nths of pad_width, where n is the number of
zones.

These left and right sides are compared with `pos', and the zone is
the one where left<=pos<=right.

This would all be correct if pos were the touch's x coordinate.
However, inexplicably, it isn't: it has had pad_width/2 added.

The git history does not reveal an explanation for adding pad_width/2.
Removing it makes the button zones work.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/gestures.c