diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-04-03 10:50:50 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-04-05 10:43:15 +1000 |
commit | ac47b4ea5b4f7b920b84a1e70adce3475e3be346 (patch) | |
tree | 9112a0bfe48e73cfb454956eeda60148e78c2bef /src | |
parent | 368d96f4dfd4605b80d039ec4508c906c3723cf7 (diff) |
Allow soft button areas to overlap on the edge
For percent-based configuration in the form of
middle button 33%-66%, right button 66%-0 we'd get an error because of the
one device unit overlap. This was neither documented nor useful, because
leaving a 1% gap leaves an actual gap between the buttons. Allow for an
overlap of one device unit on the edge of the buttons.
What's picked in that case depends on the implementation of
is_inside_softbutton_area but since one device unit is so small, it doesn't
matter.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/synaptics.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/synaptics.c b/src/synaptics.c index 3437d9d..f0a8269 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -421,13 +421,13 @@ SynapticsIsSoftButtonAreasValid(int *values) if ((right_bottom <= middle_bottom && right_bottom >= middle_top) || (right_top <= middle_bottom && right_top >= middle_top)) { /* Check for overlapping left edges */ - if ((right_left < middle_left && right_right >= middle_left) || - (middle_left < right_left && middle_right >= right_left)) + if ((right_left < middle_left && right_right > middle_left) || + (middle_left < right_left && middle_right > right_left)) return FALSE; /* Check for overlapping right edges */ - if ((right_right > middle_right && right_left <= middle_right) || - (middle_right > right_right && middle_left <= right_right)) + if ((right_right > middle_right && right_left < middle_right) || + (middle_right > right_right && middle_left < right_right)) return FALSE; } @@ -435,13 +435,13 @@ SynapticsIsSoftButtonAreasValid(int *values) if ((right_left >= middle_left && right_left <= middle_right) || (right_right >= middle_left && right_right <= middle_right)) { /* Check for overlapping top edges */ - if ((right_top < middle_top && right_bottom >= middle_top) || - (middle_top < right_top && middle_bottom >= right_top)) + if ((right_top < middle_top && right_bottom > middle_top) || + (middle_top < right_top && middle_bottom > right_top)) return FALSE; /* Check for overlapping bottom edges */ - if ((right_bottom > middle_bottom && right_top <= middle_bottom) || - (middle_bottom > right_bottom && middle_top <= right_bottom)) + if ((right_bottom > middle_bottom && right_top < middle_bottom) || + (middle_bottom > right_bottom && middle_top < right_bottom)) return FALSE; } } |