comparison cagou/core/widgets_handler.py @ 300:efd3fbc85aaf

core (widgets_handler): use explicit floor division to avoid warnings.
author Goffi <goffi@goffi.org>
date Fri, 28 Jun 2019 12:30:17 +0200
parents 1b835bcfa663
children 772c170b47a9
comparison
equal deleted inserted replaced
299:86b1cd8121dd 300:efd3fbc85aaf
140 touch_rx, touch_ry = self.to_widget(*touch.pos, relative=True) 140 touch_rx, touch_ry = self.to_widget(*touch.pos, relative=True)
141 if (touch_ry <= self.height and 141 if (touch_ry <= self.height and
142 touch_ry >= self.height - self.split_size - self.split_margin or 142 touch_ry >= self.height - self.split_size - self.split_margin or
143 touch_ry <= self.height and 143 touch_ry <= self.height and
144 touch_ry >= self.height - self.sp_zone and 144 touch_ry >= self.height - self.sp_zone and
145 touch_rx >= self.width/2 - self.sp_zone/2 and 145 touch_rx >= self.width//2 - self.sp_zone//2 and
146 touch_rx <= self.width/2 + self.sp_zone/2): 146 touch_rx <= self.width//2 + self.sp_zone//2):
147 # split area is touched, we activate top split mode 147 # split area is touched, we activate top split mode
148 self._split = "top" 148 self._split = "top"
149 self._draw_ellipse() 149 self._draw_ellipse()
150 elif (touch_rx >= 0 and 150 elif (touch_rx >= 0 and
151 touch_rx <= self.split_size + self.split_margin or 151 touch_rx <= self.split_size + self.split_margin or
152 touch_rx >= 0 and 152 touch_rx >= 0 and
153 touch_rx <= self.sp_zone and 153 touch_rx <= self.sp_zone and
154 touch_ry >= self.height/2 - self.sp_zone/2 and 154 touch_ry >= self.height//2 - self.sp_zone//2 and
155 touch_ry <= self.height/2 + self.sp_zone/2): 155 touch_ry <= self.height//2 + self.sp_zone//2):
156 # split area is touched, we activate left split mode 156 # split area is touched, we activate left split mode
157 self._split = "left" 157 self._split = "left"
158 touch.ud['ori_width'] = self.width 158 touch.ud['ori_width'] = self.width
159 self._draw_ellipse() 159 self._draw_ellipse()
160 else: 160 else: