From c0b48a8b0e2e0af0af18e32c7ab06e4ebdd5948c Mon Sep 17 00:00:00 2001 From: Will Sember Date: Wed, 15 Apr 2015 15:46:43 -0400 Subject: [PATCH] Added height checks to ensure touch is inside the navigation drawer or its main panel. --- __init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index 7021e67..149faf2 100644 --- a/__init__.py +++ b/__init__.py @@ -509,7 +509,10 @@ def on_touch_down(self, touch): if self._anim_progress < 0.001: # i.e. closed valid_region = (self.x <= touch.x <= - (self.x + self.touch_accept_width)) + (self.x + self.touch_accept_width)) and \ + (self.y <= + touch.y <= + (self.y + self.height)) if not valid_region: self._main_panel.on_touch_down(touch) return False @@ -519,7 +522,10 @@ def on_touch_down(self, touch): return False valid_region = (self._main_panel.x <= touch.x <= - (self._main_panel.x + self._main_panel.width)) + (self._main_panel.x + self._main_panel.width)) and \ + (self._main_panel.y <= + touch.y <= + (self._main_panel.y + self._main_panel.height)) if not valid_region: if self._main_above: if col_main: